flathub / org.tug.texworks

https://flathub.org/apps/details/org.tug.texworks
0 stars 3 forks source link

Make TeXworks work with host TeX binaries #11

Open stloeffler opened 3 years ago

stloeffler commented 3 years ago

According to https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access, the host's /usr is mounted under /var/run/host/usr. Adding the relevant bin paths under that folder allows TeXworks to access them (see the currently unused binpaths.patch).

However

It would be possible to set LD_LIBRARY_PATH, but doing so globally when invoking TeXworks is not a good idea (for the same reason as above - this could potentially run TeXworks with incompatible host libraries instead of the sandbox libraries). One possibility would be to modify the Tw sources to set LD_LIBRARY_PATH only when running executables from the host (i.e. from somewhere under /var/run/host), but determining the proper settings (at runtime) is probably not trivial.

LyzardKing commented 3 years ago

This works for me: Running the flatpak with the permission --talk-name=org.freedesktop.Flatpak flatpak run --talk-name=org.freedesktop.Flatpak org.tug.texworks and adding the external command as flatpak-spawn --host <command> <args>