fix(linux): ship gio-launch-desktop so the bundled libgio can launch URLs
Root cause of the broken 'Sign in with Plex' and update links on portable builds: the bundle ships Ubuntu's libgio, whose compiled-in helper path (/usr/lib/x86_64-linux-gnu/glib-2.0/gio-launch-desktop) exists only on Debian-family hosts. glib then falls back to a bare PATH search, and distros like Fedora keep the helper in /usr/libexec outside PATH, so every URL/desktop-file spawn failed. Installing the RPM masked it only because system glib is built with the right path. Bundle the build host's gio-launch-desktop next to the libgio it was built with (bundle-libs.sh now fails the build if libgio is bundled and the helper cannot be found) and export GIO_LAUNCH_DESKTOP from plezy.sh, which glib checks before its compiled-in path. Covers the tarball and the deb/rpm/pacman packages alike, since they all ship the same bundle and launch through the wrapper. close #1477
This commit is contained in:
@@ -114,6 +114,34 @@ if [[ -n "$GIO_MODULE_DIR" && -d "$GIO_MODULE_DIR" ]]; then
|
||||
bundle_module_dir "$GIO_MODULE_DIR" "$GIO_DEST"
|
||||
fi
|
||||
|
||||
# gio-launch-desktop helper
|
||||
# libgio spawns URI/desktop-file handlers through this binary. Its location is
|
||||
# compiled into libgio as the *build host's* pkglibexecdir (an Ubuntu
|
||||
# multiarch path), which does not exist on other distros, and glib's bare-name
|
||||
# PATH fallback misses hosts that keep the helper in /usr/libexec (Fedora).
|
||||
# Every launchUrl then failed (#1477). Ship the helper that matches the
|
||||
# bundled libgio; plezy.sh points GIO_LAUNCH_DESKTOP at it.
|
||||
if compgen -G "$LIB_DIR/libgio-2.0.so*" > /dev/null; then
|
||||
GLIB_LIBDIR="$(pkg-config --variable=libdir glib-2.0 2>/dev/null || true)"
|
||||
GIO_HELPER=""
|
||||
for candidate in "${GLIB_LIBDIR:+$GLIB_LIBDIR/glib-2.0/gio-launch-desktop}" \
|
||||
/usr/libexec/gio-launch-desktop \
|
||||
/usr/lib/glib-2.0/gio-launch-desktop; do
|
||||
if [[ -n "$candidate" && -x "$candidate" ]]; then
|
||||
GIO_HELPER="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ -z "$GIO_HELPER" ]]; then
|
||||
echo "Error: libgio is bundled but no gio-launch-desktop helper was found on the build host." >&2
|
||||
echo "Without it, URL launching breaks on every distro whose glib layout differs from the builder's." >&2
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$LIB_DIR/glib-2.0"
|
||||
cp -a "$GIO_HELPER" "$LIB_DIR/glib-2.0/gio-launch-desktop"
|
||||
echo "==> Bundled gio-launch-desktop from $GIO_HELPER"
|
||||
fi
|
||||
|
||||
# GTK IM modules + print backends
|
||||
GTK_LIBDIR="$(pkg-config --variable=libdir gtk+-3.0 2>/dev/null || true)"
|
||||
if [[ -n "$GTK_LIBDIR" ]]; then
|
||||
|
||||
@@ -27,6 +27,14 @@ if [[ -d "$INSTALL_DIR/lib/gio/modules" ]]; then
|
||||
export GIO_MODULE_DIR="$INSTALL_DIR/lib/gio/modules"
|
||||
fi
|
||||
|
||||
# gio-launch-desktop: the bundled libgio spawns URL/desktop-file handlers
|
||||
# through this helper. Its compiled-in path only exists on the build distro
|
||||
# and glib's PATH fallback misses hosts that keep it in /usr/libexec, which
|
||||
# broke every URL launch (#1477). Point libgio at the bundled copy.
|
||||
if [[ -x "$INSTALL_DIR/lib/glib-2.0/gio-launch-desktop" ]]; then
|
||||
export GIO_LAUNCH_DESKTOP="$INSTALL_DIR/lib/glib-2.0/gio-launch-desktop"
|
||||
fi
|
||||
|
||||
# GTK IM modules
|
||||
if [[ -f "$INSTALL_DIR/lib/gtk-3.0/3.0.0/immodules.cache" ]]; then
|
||||
export GTK_IM_MODULE_FILE="$INSTALL_DIR/lib/gtk-3.0/3.0.0/immodules.cache"
|
||||
|
||||
Reference in New Issue
Block a user