From e29253ad9b847873fa8c5d736a45951d67623eef Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 3 Apr 2022 19:01:27 +0200 Subject: [PATCH] gnome.eog: Hardcode library path in gir By default, gobject-introspection refers to libraries using their file name in the GIR file. Since we do not have FHS to reliably find libraries by their name, we are patching gobject-introspection to use absolute paths. This works fine for libraries installed to "$out/lib" but when a different path is used, the hard-coded absolute path will be incorrect. To deal with this case, we also patch Meson to be able to pass the install_dir to gobject-introspection. But it currently only passes the data for targets that have absolute install_dir set. To have correct libeog path, we therefore need to absolutize the install_dir. --- pkgs/desktops/gnome/core/eog/default.nix | 7 +++++++ pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch diff --git a/pkgs/desktops/gnome/core/eog/default.nix b/pkgs/desktops/gnome/core/eog/default.nix index 08baf9022f71..9a152921994d 100644 --- a/pkgs/desktops/gnome/core/eog/default.nix +++ b/pkgs/desktops/gnome/core/eog/default.nix @@ -38,6 +38,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-+zW/tRZ6QhIfWae5t6wNdbvQUXua/W2Rgx6E01c13fg="; }; + patches = [ + # Fix path to libeog.so in the gir file. + # We patch gobject-introspection to hardcode absolute paths but + # our Meson patch will only pass the info when install_dir is absolute as well. + ./fix-gir-lib-path.patch + ]; + nativeBuildInputs = [ meson ninja diff --git a/pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch b/pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch new file mode 100644 index 000000000000..eb087b58a317 --- /dev/null +++ b/pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/meson.build b/src/meson.build +index cc9d3856..f909836d 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -165,7 +165,7 @@ libeog = shared_library( + link_args: ldflags, + link_depends: symbol_map, + install: true, +- install_dir: eog_pkglibdir, ++ install_dir: eog_prefix / eog_pkglibdir, + ) + + libeog_dep = declare_dependency(