I think @sergiusens is actually referring to this topic:
Note that it isn’t as simple as “not using desktop-launch
” though. That will prevent LD_LIBRARY_PATH
from being altered, but it is likely that many of the libraries desktop apps use will start searching for their plugins from the host system rather than those shipped with the snap.
I don’t have a good answer for this other than:
-
rebuild GTK+ and all other libraries that have plugins to use a prefix of
/snap/myapp/current/
so they’ll have the correct search path without setting an environment variable. -
modify the application to sanitise the environment before calling a subprocess. I’m not sure quite how you’d do this other than running something before
desktop-launch
to capture the pristine environment.
I don’t think there is an easy answer like using patchelf to modify rpaths.