diff options
author | Simon McVittie <smcv@collabora.com> | 2022-07-14 14:28:11 +0100 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2022-07-25 01:00:53 +0200 |
commit | ae15c800ceeaa79f42cd1fa9f9ffabaab6658abf (patch) | |
tree | e67d944fb86b31ceb7193f485fb07a827b3529b1 | |
parent | 8157668eacd69312cfa954218a6362e897450bf1 (diff) | |
download | glib-ae15c800ceeaa79f42cd1fa9f9ffabaab6658abf.tar.gz |
Install gio-launch-desktop in a non-PATH location
This is an internal helper executable, which users shouldn't invoke
directly (see glib#1633).
When building for a single-architecture distribution, we can install
it as ${libexecdir}/gio-launch-desktop.
When building for a multiarch distribution, installing it into an
architecture-specific location and packaging it alongside the GLib
library avoids the problem discussed in glib#1633 where it would either
cause a circular dependency between the GLib library and a common
cross-architecture package (libglib2.0-bin in Debian), or require a
separate package just to contain gio-launch-desktop, or cause different
architectures' copies to overwrite each other.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | gio/gdesktopappinfo.c | 4 | ||||
-rw-r--r-- | gio/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 4813425ac..c46a8f09b 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -2926,6 +2926,10 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info, if (!is_setuid) tmp = g_getenv ("GIO_LAUNCH_DESKTOP"); + /* Allow build system to specify path to gio-launch-desktop */ + if (tmp == NULL && g_file_test (GIO_LAUNCH_DESKTOP, G_FILE_TEST_IS_EXECUTABLE)) + tmp = GIO_LAUNCH_DESKTOP; + /* Fall back on usual searching in $PATH */ if (tmp == NULL) tmp = "gio-launch-desktop"; diff --git a/gio/meson.build b/gio/meson.build index 60ca579d1..9557464e8 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -1,6 +1,7 @@ gio_c_args = [ '-DG_LOG_DOMAIN="GLib-GIO"', '-DGIO_COMPILATION', + '-DGIO_LAUNCH_DESKTOP="@0@"'.format(glib_prefix / multiarch_libexecdir / 'gio-launch-desktop'), '-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir), '-DLOCALSTATEDIR="@0@"'.format(glib_localstatedir), ] @@ -402,6 +403,7 @@ if host_system != 'windows' gio_launch_desktop = executable('gio-launch-desktop', 'gio-launch-desktop.c', install : true, + install_dir : multiarch_libexecdir, c_args : gio_c_args, # intl.lib is not compatible with SAFESEH link_args : noseh_link_args) diff --git a/meson.build b/meson.build index 3f28a71ee..1d1122627 100644 --- a/meson.build +++ b/meson.build @@ -88,11 +88,13 @@ if get_option('multiarch') # to an architecture-dependent location, with a compatibility symlink # in the PATH. multiarch_bindir = get_option('libdir') / 'glib-2.0' + multiarch_libexecdir = multiarch_bindir pkgconfig_multiarch_bindir = '${libdir}/glib-2.0' else # For single-architecture distributions, just install them into the PATH # as was traditionally done. multiarch_bindir = get_option('bindir') + multiarch_libexecdir = get_option('libexecdir') pkgconfig_multiarch_bindir = '${bindir}' endif |