From 34da7e2ce2ca92bdeb73d8257e2ca145a0fc45a5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 29 Jul 2018 16:48:24 -0400 Subject: treewide: Remove stdenv.isCross I *want* cross-specific overrides to be verbose, so I rather not have this shorthand. This makes the syntactic overhead more proportional to the maintainence cost. Hopefully this pushes people towards fewer conditionals and more abstractions. --- pkgs/os-specific/linux/apparmor/default.nix | 24 ++++++++++++++---------- pkgs/os-specific/linux/iputils/default.nix | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index cbbe4d5ca462..08428f95b06c 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -2,9 +2,9 @@ , pkgconfig, which , flex, bison , linuxHeaders ? stdenv.cc.libc.linuxHeaders -, python , gawk -, perl +, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform && perl.meta.available or false, perl +, withPython ? stdenv.hostPlatform == stdenv.buildPlatform && python.meta.available or false, python , swig , ncurses , pam @@ -76,10 +76,9 @@ let perl ]; - buildInputs = stdenv.lib.optionals (!stdenv.isCross) [ - perl - python - ]; + buildInputs = [] + ++ stdenv.lib.optional withPerl perl + ++ stdenv.lib.optional withPython python; # required to build apparmor-parser dontDisableStatic = true; @@ -92,11 +91,14 @@ let postPatch = "cd ./libraries/libapparmor"; # https://gitlab.com/apparmor/apparmor/issues/1 - configureFlags = stdenv.lib.optionalString (!stdenv.isCross) "--with-python --with-perl"; + configureFlags = [ + (stdenv.lib.withFeature withPerl "perl") + (stdenv.lib.withFeature withPython "python") + ]; - outputs = if stdenv.isCross then [ "out" ] else [ "out" "python" ]; + outputs = [ "out" ] ++ stdenv.lib.optional withPython "python"; - postInstall = stdenv.lib.optionalString (!stdenv.isCross) '' + postInstall = stdenv.lib.optionalString withPython '' mkdir -p $python/lib mv $out/lib/python* $python/lib/ ''; @@ -137,7 +139,9 @@ let inherit doCheck; - meta = apparmor-meta "user-land utilities"; + meta = apparmor-meta "user-land utilities" // { + broken = !(withPython && withPerl); + }; }; apparmor-bin-utils = stdenv.mkDerivation { diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 4caa0acb4b6a..3430797666eb 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { ] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn; # ninfod probably could build on cross, but the Makefile doesn't pass --host etc to the sub configure... - buildFlags = "man all" + stdenv.lib.optionalString (!stdenv.isCross) " ninfod"; + buildFlags = "man all" + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) " ninfod"; installPhase = '' -- cgit 1.4.1