flathub / net.ankiweb.Anki

https://flathub.org/apps/details/net.ankiweb.Anki
20 stars 13 forks source link

Can't run dvisvgm, missing libgs.so #109

Closed aijony closed 2 months ago

aijony commented 11 months ago

When I generate LaTeX using svgs instead of pngs (which are working), I get the following error

dvisvgm: error while loading shared libraries: libgs.so.10: cannot open shared object file: No such file or directory

Which is the ghostscript library file. I tried to use flatpak run --env LD_LIBRARY_PATH=/app/texlive/lib net.ankiweb.Anki but it did not work.

However, it does work if I use flatpak run --devel net.ankiweb.Anki where the library file is now found in /usr/lib/sdk/texlive/lib/, and I also don't have to set LD_LIBRARY_PATH. I was sadly unable to come up with a better solution.

rayes0 commented 2 months ago

It appears that anki calls commands with a blank LD_LIBRARY_PATH (https://github.com/ankitects/anki/blob/a1fa865bb2e324c38f2361c58315c5b046c31d46/pylib/anki/utils.py#L202C1-L207C49), which would explain why setting LD_LIBRARY_PATH manually does not work.

rayes0 commented 2 months ago

This should be solved by #144. Let me know if you have any issues.