summary refs log tree commit diff
path: root/pkgs/development/libraries/gdk-pixbuf
diff options
context:
space:
mode:
authorRick van Schijndel <rol3517@gmail.com>2021-05-21 23:21:27 +0200
committerRick van Schijndel <rol3517@gmail.com>2021-05-25 21:24:10 +0200
commit4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c (patch)
treebe019f7d233e5988b43f43120d141b8415d40c0a /pkgs/development/libraries/gdk-pixbuf
parent17689c66d46a2a1ff20ed3b1b83f8ac83aedf0bc (diff)
downloadnixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar.gz
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar.bz2
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar.lz
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar.xz
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.tar.zst
nixpkgs-4a98b2f40e50ae3e87b99bf4abd197e57b5f7b2c.zip
gdk-pixbuf: support cross-compilation by disabling introspection and gtk_doc
I don't know why the gating on whether gobject-introspection is or isn't
null was added, but I removed it.

It was added here: 7fbcc562609249a6ba81b26064e31c00ed38ebda.
Diffstat (limited to 'pkgs/development/libraries/gdk-pixbuf')
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix18
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index fd2d62a032c..7f63d5f67e7 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -22,11 +22,16 @@
 , lib
 }:
 
+let
+  withGtkDoc = stdenv.buildPlatform == stdenv.hostPlatform;
+in
 stdenv.mkDerivation rec {
   pname = "gdk-pixbuf";
   version = "2.42.6";
 
-  outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
+  outputs = [ "out" "dev" "man" ]
+    ++ lib.optional withGtkDoc "devdoc"
+    ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
@@ -63,8 +68,8 @@ stdenv.mkDerivation rec {
   ];
 
   mesonFlags = [
-    "-Dgtk_doc=true"
-    "-Dintrospection=${if gobject-introspection != null then "enabled" else "disabled"}"
+    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
+    "-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}"
     "-Dgio_sniffing=false"
   ];
 
@@ -85,9 +90,6 @@ stdenv.mkDerivation rec {
       moveToOutput "bin" "$dev"
       moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
 
-      # So that devhelp can find this.
-      mkdir -p "$devdoc/share/devhelp"
-      mv "$out/share/doc" "$devdoc/share/devhelp/books"
     '' + lib.optionalString stdenv.isDarwin ''
       # meson erroneously installs loaders with .dylib extension on Darwin.
       # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
@@ -98,6 +100,10 @@ stdenv.mkDerivation rec {
     '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
       # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
       $dev/bin/gdk-pixbuf-query-loaders --update-cache
+    '' + lib.optionalString withGtkDoc ''
+      # So that devhelp can find this.
+      mkdir -p "$devdoc/share/devhelp"
+      mv "$out/share/doc" "$devdoc/share/devhelp/books"
     '';
 
   # The fixDarwinDylibNames hook doesn't patch binaries.