diff options
author | Tor Hedin Brønner <torhedinbronner@gmail.com> | 2018-09-14 13:50:04 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2018-11-30 21:35:15 +0100 |
commit | 38c529f57aa50c1cdb36c1af0488dac363629b72 (patch) | |
tree | 1aea03ce06133d7cfeed5bfe610f0e355571eb02 | |
parent | 9d8ea55e301d56fdc1f4062c8623d36e2eb3dc90 (diff) | |
download | nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar.gz nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar.bz2 nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar.lz nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar.xz nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.tar.zst nixpkgs-38c529f57aa50c1cdb36c1af0488dac363629b72.zip |
glib: use absolute path for `gio-launch-desktop`
glib tries to look up `gio-launch-desktop` in the path which obviously can fail. Specifically this now happens when launching gnome-shell.
-rw-r--r-- | pkgs/development/libraries/glib/default.nix | 15 | ||||
-rw-r--r-- | pkgs/development/libraries/glib/fix-gio-launch-desktop-path.patch | 11 |
2 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index de56b6a5d10..1eb50fc4f10 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -59,7 +59,11 @@ stdenv.mkDerivation rec { ++ optionals stdenv.hostPlatform.isMusl [ ./quark_init_on_demand.patch ./gobject_init_on_demand.patch - ] ++ [ ./schema-override-variable.patch ]; + ] ++ [ + ./schema-override-variable.patch + # Require substituteInPlace in postPatch + ./fix-gio-launch-desktop-path.patch + ]; outputs = [ "bin" "out" "dev" "devdoc" ]; outputBin = "dev"; @@ -88,6 +92,10 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace meson.build --replace "install_dir : 'bin'," "install_dir : glib_bindir," + + # substitute fix-gio-launch-desktop-path.patch + substituteInPlace gio/gdesktopappinfo.c --replace "@bindir@" "$out/bin" + chmod +x gio/tests/gengiotypefuncs.py patchShebangs gio/tests/gengiotypefuncs.py patchShebangs glib/gen-unicode-tables.pl @@ -106,6 +114,11 @@ stdenv.mkDerivation rec { mv "$dev/bin/$app" "$bin/bin" done + # Add gio-launch-desktop to $out so we can refer to it from $dev + mkdir $out/bin + mv "$dev/bin/gio-launch-desktop" "$out/bin/" + ln -s "$out/bin/gio-launch-desktop" "$bin/bin/" + moveToOutput "share/glib-2.0" "$dev" substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev" sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|" diff --git a/pkgs/development/libraries/glib/fix-gio-launch-desktop-path.patch b/pkgs/development/libraries/glib/fix-gio-launch-desktop-path.patch new file mode 100644 index 00000000000..4fdec2dd7e7 --- /dev/null +++ b/pkgs/development/libraries/glib/fix-gio-launch-desktop-path.patch @@ -0,0 +1,11 @@ +--- a/gio/gdesktopappinfo.c ++++ b/gio/gdesktopappinfo.c +@@ -2725,7 +2725,7 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info, + + /* Fall back on usual searching in $PATH */ + if (tmp == NULL) +- tmp = "gio-launch-desktop"; ++ tmp = "@bindir@/gio-launch-desktop"; + g_once_init_leave (&gio_launch_desktop_path, tmp); + } + |