cth103 / dcpomatic

DCP-o-matic repository: main is the development branch (where v2.16.x versions are being made) and v2.17.x has the v2.17.x "unstable" versions (main is merged there every so often).
https://dcpomatic.com/
GNU General Public License v2.0
111 stars 23 forks source link

Unable to run Appimage on NixOS due to hardcoded location of shared libraries #24

Closed eyduh closed 11 months ago

eyduh commented 11 months ago

Hi,

I'm trying to run the Appimage on NixOS 23.11 without success.

[eyduh@editing-bench:~/Downloads]$ ./DCP-o-matic-2.16.70-x86_64.AppImage 
DCP-o-matic-2.16.70-x86_64.AppImage installed in /home/eyduh/.cache/appimage-run/9d6e44d863d326eaf97b546b666b0b9ad69d8a750b2db417f77ccce429491b5e
/home/eyduh/.cache/appimage-run/9d6e44d863d326eaf97b546b666b0b9ad69d8a750b2db417f77ccce429491b5e/usr/bin/dcpomatic2: error while loading shared libraries: libthai.so.0: cannot open shared object file: No such file or directory

If I run the DCP in an environment with the required libraries I encounter the same issue:


[eyduh@editing-bench:~/Downloads]$ nix-shell -p libthai

[nix-shell:~/Downloads]$ ./DCP-o-matic-2.16.70-x86_64.AppImage 
DCP-o-matic-2.16.70-x86_64.AppImage installed in /home/eyduh/.cache/appimage-run/9d6e44d863d326eaf97b546b666b0b9ad69d8a750b2db417f77ccce429491b5e
/home/eyduh/.cache/appimage-run/9d6e44d863d326eaf97b546b666b0b9ad69d8a750b2db417f77ccce429491b5e/usr/bin/dcpomatic2: error while loading shared libraries: libthai.so.0: cannot open shared object file: No such file or directory

Since the Appimage depends on shared libraries that are expected to reside in /usr/lib/* it fails to locate these libaries even if installed on the host as the actual location on nixos is in the nix store like a so

[nix-shell:~]$ nix repl
Welcome to Nix 2.18.1. Type :? for help.

nix-repl> :l <nixpkgs>
Added 19749 variables.

nix-repl> "${libthai}"
"/nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29"

nix-repl> :q

[nix-shell:~]$ du -a /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29
4       /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/lib/libthai.la
52      /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/lib/libthai.so.0.3.1
4       /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/lib/libthai.so
60      /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/lib
576     /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/share/libthai/thbrk.tri
576     /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/share/libthai
576     /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29/share
636     /nix/store/7056l05jgksy4l9y2anifdg8p9q7vf85-libthai-0.1.29

Judging by this completely different issue, I would run into a similar issue with a few other libraries as well.

I'll look into setting up a nix derivation to build dcp-o-matic from source based on the instructions on your website but until then, would it be impractical to bundle these libraries into the AppImage? Alternatively, a way for it to find the libraries when in a non-standard location?

Thanks!

cth103 commented 11 months ago

Hi, I think this was also reported for Slackware: https://dcpomatic.com/bugs/view.php?id=2642 I'll take a look.

cth103 commented 11 months ago

Maybe you could try the builds here: https://dcpomatic.com/build/appimage/39478c7 They add libthai and seem to work to me on a VM running nixOS.

cth103 commented 11 months ago

This change has now been merged into the main branch of DoM and will be in 2.16.72.

eyduh commented 11 months ago

I only tried the main program thus far but works like a charm c:

Cheers!