rpath is not properly set after "ninja install" if subprojects are used
I originally filed this as a meson bug at https://github.com/mesonbuild/meson/issues/4136 but I was told that this is ultimately something which needs to be fixed in gnome-boxes. Copying from the original bug report:
gnome-boxes uses subprojects: https://gitlab.gnome.org/GNOME/gnome-boxes/tree/master/subprojects In Debian, gtk-frdp and libovf-glib are not packaged as system libraries yet, so when building gnome-boxes the internal subprojects are used. The binary in the build dir has
RUNPATH $ORIGIN/../subprojects/gtk-frdp/src:$ORIGIN/../subprojects/libovf-glib/govf
The two libraries are installed into pkglibdir and required by the binary:
NEEDED libgtk-frdp-0.1.so
NEEDED libgovf-0.1.so
After a ninja install, the runpath is gone from the binary. The result is, that the binary crashes, as it can't find the libraries
Jusse suggested that gnome-boxes should set the rpath if the internal subprojects are used:
if dep_object.type_name() == 'internal'
# set up rpath using install_rpath
else
# deps comr from the system, no need for rpathing
endif