about summary refs log tree commit diff
path: root/pkgs/development/libraries/libgudev/default.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2021-10-23 12:01:00 +0300
committerArtturin <Artturin@artturin.com>2021-11-05 19:57:03 +0200
commit6e08facfa0fb7c644fa49310da9d86a5e01c5bba (patch)
tree759feca4c6bbad6f28124b083789dd76c1f608cb /pkgs/development/libraries/libgudev/default.nix
parentc36938b9ff753e36cecc5ddae6c537e6efa6f874 (diff)
libgudev: enable strictDeps
libgudev: make gobject-introspection conditional to fix binfmt cross-compile
Diffstat (limited to 'pkgs/development/libraries/libgudev/default.nix')
-rw-r--r--pkgs/development/libraries/libgudev/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix
index 87061ae6559a9..6a63947c8a57f 100644
--- a/pkgs/development/libraries/libgudev/default.nix
+++ b/pkgs/development/libraries/libgudev/default.nix
@@ -5,9 +5,10 @@
 , ninja
 , udev
 , glib
-, gobject-introspection
 , gnome
 , vala
+, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
+, gobject-introspection
 }:
 
 stdenv.mkDerivation rec {
@@ -21,12 +22,18 @@ stdenv.mkDerivation rec {
     sha256 = "1al6nr492nzbm8ql02xhzwci2kwb1advnkaky3j9636jf08v41hd";
   };
 
+  strictDeps = true;
+
+  depsBuildBuild = [ pkg-config ];
+
   nativeBuildInputs = [
     pkg-config
-    gobject-introspection
     meson
     ninja
     vala
+    glib # for glib-mkenums needed during the build
+  ] ++ lib.optionals withIntrospection [
+    gobject-introspection
   ];
 
   buildInputs = [
@@ -37,8 +44,8 @@ stdenv.mkDerivation rec {
   mesonFlags = [
     # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway
     "-Dtests=disabled"
+    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
   ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-    "-Dintrospection=disabled"
     "-Dvapi=disabled"
   ];