I’m making a snap of an mono/xamarin gtk app.
It uses mono-complete which installs a lot of .libraries and .dll
In these libs there are some .dll.config
files.
These .dll.config
files contains lines like
<dllmap dll="gtksharpglue-2" target="/usr/lib/cli/gtk-sharp-2.0/libgtksharpglue-2.so"/>
<dllmap dll="glibsharpglue-2" target="/usr/lib/cli/glib-sharp-2.0/libglibsharpglue-2.so"/>
That means that the mono + app searches for the corresponding .so
starting from /
where it can’t be found. They are in
$SNAP/
and I get a lot of errors like
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for ‘Gtk.Container’ threw an exception. —> System.DllNotFoundException: ~/usr/lib/cli/gtk-sharp-2.0/libgtksharpglue-2.so assembly: type: member:(null)
Question
How do I specify that the .so
files must be searched from $SNAP/
In snapcraft.yaml ?
MONO_PATH
is set to
MONO_PATH: $SNAP/etc/mono:$SNAP/usr/bin:$SNAP/usr/lib:$SNAP/usr/lib/mono:$SNAP/usr/share/mono:$SNAP/usr/lib/cli:$SNAP/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0:$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/lib/cli/gtk-sharp-2.0:$SNAP/usr/lib/cli/glib-sharp-2.0:$SNAP/usr/lib/cli/atk-sharp-2.0:$SNAP/usr/lib/cli/gdk-sharp-2.0