mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
main: Prepend RPATH or RUNPATH paths to gir search paths
If one wants to run tests the non-installed gnome-shell, that currently fails as gnome-shell the executable attempts to link against ./build/src/libgnome-shell.so, but when GObject introspection tries to find what library to link to for Shell, it goes to the installed libgnome-shell.so, causing two different versions of libgnome-shell.so to be loaded. This, however, can be avoided thanks to meson adding $ORIGIN paths to relevant libraries before installing an executable. What this means in practice is that we can inspect ourself upon startup, discover whether the RPATH/RUNPATH header contains $ORIGIN, and if so, expand it to the directory containing the executable, and prepend the introspection search paths with said directory. This effectively means that the introspection machinery now finds the same library that the linker linked the gnome-shell executable with, making it run successfully. It's not possible to use $GI_TYPELIB_PATH since g_irepository_prepend_library_path() takes precedence. There is no "append" variant of that API. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1349>
This commit is contained in:
parent
1559f03a82
commit
9bc89b821c
3 changed files with 82 additions and 0 deletions
|
|
@ -36,3 +36,6 @@
|
|||
|
||||
/* Define if polkit defines autocleanup functions */
|
||||
#mesondefine HAVE_POLKIT_AUTOCLEANUP
|
||||
|
||||
/* Define to 1 if the <elf.h> and <link.h> header file exist. */
|
||||
#mesondefine HAVE_EXE_INTROSPECTION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue