about summary refs log tree commit diff
path: root/pkgs/development/libraries/glib
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-12-10 11:33:36 +0000
committerJörg Thalheim <joerg@thalheim.io>2018-12-10 11:36:02 +0000
commitefa57f8820e77971d3212e838eebd36c6a046c83 (patch)
tree4839849e801f806c704c95469aed703521392e73 /pkgs/development/libraries/glib
parentec59713c5c317cfe8f0a0ffc90af55bbd3deeb1f (diff)
downloadnixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar.gz
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar.bz2
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar.lz
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar.xz
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.tar.zst
nixlib-efa57f8820e77971d3212e838eebd36c6a046c83.zip
glib: fix cross -> inherit devdoc from native build
Glib uses gobject introspection to generate documentation.
If we would want to cross-compile those, we would need native binaries
from the previous build stage. Instead we can simply just copy over
the generated documentation.
Diffstat (limited to 'pkgs/development/libraries/glib')
-rw-r--r--pkgs/development/libraries/glib/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 1eb50fc4f100..22acd530093e 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -2,6 +2,7 @@
 , libiconv, zlib, libffi, pcre, libelf, gnome3, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
 # use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
 , utillinuxMinimal ? null
+, buildPackages
 
 # this is just for tests (not in the closure of any regular package)
 , doCheck ? stdenv.config.doCheckByDefault or false
@@ -78,12 +79,16 @@ stdenv.mkDerivation rec {
     utillinuxMinimal # for libmount
   ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales ];
+  nativeBuildInputs = [
+    meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
+  ];
 
   propagatedBuildInputs = [ zlib libffi gettext libiconv ];
 
   mesonFlags = [
-    "-Dgtk_doc=true"
+    # Avoid the need for gobject introspection binaries in PATH in cross-compiling case.
+    # Instead we just copy them over from the native output.
+    "-Dgtk_doc=${if stdenv.hostPlatform == stdenv.buildPlatform then "true" else "false"}"
   ];
 
   LC_ALL = "en_US.UTF-8";
@@ -126,6 +131,8 @@ stdenv.mkDerivation rec {
     # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
     sed '1i#line 1 "${name}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
       -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
+  '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    cp -r ${buildPackages.glib.devdoc} $devdoc
   '';
 
   checkInputs = [ tzdata libxml2 desktop-file-utils shared-mime-info ];