git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commite29253ad9b847873fa8c5d736a45951d67623eef authorJan Tojnar <jtojnar@gmail.com> dateSun 3 Apr 2022, 19:01 (5 years ago) parentac726e8
2 files changed+20
pkgs/desktops/gnome/core/eog/default.nix+7 pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patch+13
pkgs/desktops/gnome/core/eog/default.nix+7
@@ -38,6 +38,13 @@ stdenv.mkDerivation rec {
3838 sha256 = "sha256-+zW/tRZ6QhIfWae5t6wNdbvQUXua/W2Rgx6E01c13fg=";
3939 };
4040
41+ patches = [
42+ # Fix path to libeog.so in the gir file.
43+ # We patch gobject-introspection to hardcode absolute paths but
44+ # our Meson patch will only pass the info when install_dir is absolute as well.
45+ ./fix-gir-lib-path.patch
46+ ];
47+
4148 nativeBuildInputs = [
4249 meson
4350 ninja
pkgs/desktops/gnome/core/eog/fix-gir-lib-path.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/src/meson.build b/src/meson.build
2+index cc9d3856..f909836d 100644
3+--- a/src/meson.build
4++++ b/src/meson.build
5+@@ -165,7 +165,7 @@ libeog = shared_library(
6+ link_args: ldflags,
7+ link_depends: symbol_map,
8+ install: true,
9+- install_dir: eog_pkglibdir,
10++ install_dir: eog_prefix / eog_pkglibdir,
11+ )
12+
13+ libeog_dep = declare_dependency(