diff options
author | Florian Klink <flokli@flokli.de> | 2020-12-27 13:45:46 +0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2020-12-27 13:47:52 +0100 |
commit | d24918b70e5aaa41aaa55b393cd1341377acfb00 (patch) | |
tree | 73837f0d98b2f785c8ef1468e536ed67aa6fc8c3 /pkgs/os-specific/linux | |
parent | 52261c4c2754ce26098eef93dd9354d3b6b4ef88 (diff) |
iwd: fix cross compilation
This derivation uses wrapPython to wrap some "test scripts" that are shipped in the "test" output. As these test scripts require gobject-introspection, which doesn't cross-compile at all, let's only patch and ship them when not cross-compiling.
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r-- | pkgs/os-specific/linux/iwd/default.nix | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/iwd/default.nix b/pkgs/os-specific/linux/iwd/default.nix index 64ac3342acf21..0cbd7ff3a3ad4 100644 --- a/pkgs/os-specific/linux/iwd/default.nix +++ b/pkgs/os-specific/linux/iwd/default.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation rec { sha256 = "0gzpdgfwzlqj2n3amf2zhi2hlpa412878yphgx79y6b5gn1y1lm2"; }; - outputs = [ "out" "man" "test" ]; + outputs = [ "out" "man" ] + ++ stdenv.lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "test"; nativeBuildInputs = [ autoreconfHook @@ -38,7 +39,9 @@ stdenv.mkDerivation rec { checkInputs = [ openssl ]; - pythonPath = [ + # wrapPython wraps the scripts in $test. They pull in gobject-introspection, + # which doesn't cross-compile. + pythonPath = stdenv.lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ python3Packages.dbus-python python3Packages.pygobject3 ]; @@ -61,11 +64,12 @@ stdenv.mkDerivation rec { doCheck = true; postInstall = '' - mkdir -p $test/bin - cp -a test/* $test/bin/ mkdir -p $out/share cp -a doc $out/share/ cp -a README AUTHORS TODO $out/share/doc/ + '' + stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + mkdir -p $test/bin + cp -a test/* $test/bin/ ''; preFixup = '' |