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>
This commit is contained in:
Simon McVittie
2022-07-14 14:28:11 +01:00
committed by Philip Withnall
parent 8157668eac
commit ae15c800ce
3 changed files with 8 additions and 0 deletions

View File

@@ -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";