gnome-shell/config.h.meson
Jonas Ådahl 9bc89b821c 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>
2022-11-25 22:09:37 +01:00

42 lines
1.1 KiB
Plaintext

/* The prefix for our gettext translation domains. */
#mesondefine GETTEXT_PACKAGE
/* Version number of package */
#mesondefine VERSION
/* Version number of package */
#mesondefine PACKAGE_VERSION
/* Define to 1 if you have the `fdwalk' function. */
#mesondefine HAVE_FDWALK
/* Define to 1 if you have the `mallinfo' function. */
#mesondefine HAVE_MALLINFO
/* Define to 1 if you have the `mallinfo2' function. */
#mesondefine HAVE_MALLINFO2
/* Define to 1 fi you have the <sys/resource.h> header file. */
#mesondefine HAVE_SYS_RESOURCE_H
/* Define if we have NetworkManager */
#mesondefine HAVE_NETWORKMANAGER
/* Define if we have systemd */
#mesondefine HAVE_SYSTEMD
/* Define if _NL_TIME_FIRST_WEEKDATE is available */
#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
/* Define if you have the `g_desktop_app_info_launch_uris_as_manager_with_fds` function */
#mesondefine HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
/* Define if fdwalk is available in libc */
#mesondefine HAVE_FDWALK
/* 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