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.

+48 -34
+1 -1
pkgs/development/libraries/libgcrypt/default.nix
··· 30 ++ stdenv.lib.optional stdenv.isDarwin gettext 31 ++ stdenv.lib.optional enableCapabilities libcap; 32 33 - preConfigure = stdenv.lib.optionalString stdenv.isCross '' 34 # This is intentional: gpg-error-config is a shell script that will work during the build 35 mkdir -p "$NIX_BUILD_TOP"/bin 36 ln -s ${libgpgerror.dev}/bin/gpg-error-config "$NIX_BUILD_TOP/bin"
··· 30 ++ stdenv.lib.optional stdenv.isDarwin gettext 31 ++ stdenv.lib.optional enableCapabilities libcap; 32 33 + preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' 34 # This is intentional: gpg-error-config is a shell script that will work during the build 35 mkdir -p "$NIX_BUILD_TOP"/bin 36 ln -s ${libgpgerror.dev}/bin/gpg-error-config "$NIX_BUILD_TOP/bin"
+10 -9
pkgs/development/tools/build-managers/meson/default.nix
··· 1 - { lib, python3Packages, stdenv, targetPlatform, writeTextDir, substituteAll }: let 2 - targetPrefix = lib.optionalString stdenv.isCross 3 - (targetPlatform.config + "-"); 4 - in python3Packages.buildPythonApplication rec { 5 version = "0.46.1"; 6 pname = "meson"; 7 ··· 48 49 crossFile = writeTextDir "cross-file.conf" '' 50 [binaries] 51 - c = '${targetPrefix}cc' 52 - cpp = '${targetPrefix}c++' 53 - ar = '${targetPrefix}ar' 54 - strip = '${targetPrefix}strip' 55 pkgconfig = 'pkg-config' 56 57 [properties] ··· 69 # checkInputs = [ ninja pkgconfig ]; 70 # checkPhase = "python ./run_project_tests.py"; 71 72 - inherit (stdenv) cc isCross; 73 74 meta = with lib; { 75 homepage = http://mesonbuild.com;
··· 1 + { lib, python3Packages, stdenv, targetPlatform, writeTextDir, substituteAll }: 2 + 3 + python3Packages.buildPythonApplication rec { 4 version = "0.46.1"; 5 pname = "meson"; 6 ··· 47 48 crossFile = writeTextDir "cross-file.conf" '' 49 [binaries] 50 + c = '${stdenv.cc.targetPrefix}cc' 51 + cpp = '${stdenv.cc.targetPrefix}c++' 52 + ar = '${stdenv.cc.bintools.targetPrefix}ar' 53 + strip = '${stdenv.cc.bintools.targetPrefix}strip' 54 pkgconfig = 'pkg-config' 55 56 [properties] ··· 68 # checkInputs = [ ninja pkgconfig ]; 69 # checkPhase = "python ./run_project_tests.py"; 70 71 + inherit (stdenv) cc; 72 + 73 + isCross = stdenv.buildPlatform != stdenv.hostPlatform; 74 75 meta = with lib; { 76 homepage = http://mesonbuild.com;
+14 -10
pkgs/os-specific/linux/apparmor/default.nix
··· 2 , pkgconfig, which 3 , flex, bison 4 , linuxHeaders ? stdenv.cc.libc.linuxHeaders 5 - , python 6 , gawk 7 - , perl 8 , swig 9 , ncurses 10 , pam ··· 76 perl 77 ]; 78 79 - buildInputs = stdenv.lib.optionals (!stdenv.isCross) [ 80 - perl 81 - python 82 - ]; 83 84 # required to build apparmor-parser 85 dontDisableStatic = true; ··· 92 93 postPatch = "cd ./libraries/libapparmor"; 94 # https://gitlab.com/apparmor/apparmor/issues/1 95 - configureFlags = stdenv.lib.optionalString (!stdenv.isCross) "--with-python --with-perl"; 96 97 - outputs = if stdenv.isCross then [ "out" ] else [ "out" "python" ]; 98 99 - postInstall = stdenv.lib.optionalString (!stdenv.isCross) '' 100 mkdir -p $python/lib 101 mv $out/lib/python* $python/lib/ 102 ''; ··· 137 138 inherit doCheck; 139 140 - meta = apparmor-meta "user-land utilities"; 141 }; 142 143 apparmor-bin-utils = stdenv.mkDerivation {
··· 2 , pkgconfig, which 3 , flex, bison 4 , linuxHeaders ? stdenv.cc.libc.linuxHeaders 5 , gawk 6 + , withPerl ? stdenv.hostPlatform == stdenv.buildPlatform && perl.meta.available or false, perl 7 + , withPython ? stdenv.hostPlatform == stdenv.buildPlatform && python.meta.available or false, python 8 , swig 9 , ncurses 10 , pam ··· 76 perl 77 ]; 78 79 + buildInputs = [] 80 + ++ stdenv.lib.optional withPerl perl 81 + ++ stdenv.lib.optional withPython python; 82 83 # required to build apparmor-parser 84 dontDisableStatic = true; ··· 91 92 postPatch = "cd ./libraries/libapparmor"; 93 # https://gitlab.com/apparmor/apparmor/issues/1 94 + configureFlags = [ 95 + (stdenv.lib.withFeature withPerl "perl") 96 + (stdenv.lib.withFeature withPython "python") 97 + ]; 98 99 + outputs = [ "out" ] ++ stdenv.lib.optional withPython "python"; 100 101 + postInstall = stdenv.lib.optionalString withPython '' 102 mkdir -p $python/lib 103 mv $out/lib/python* $python/lib/ 104 ''; ··· 139 140 inherit doCheck; 141 142 + meta = apparmor-meta "user-land utilities" // { 143 + broken = !(withPython && withPerl); 144 + }; 145 }; 146 147 apparmor-bin-utils = stdenv.mkDerivation {
+1 -1
pkgs/os-specific/linux/iputils/default.nix
··· 30 ] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn; 31 32 # ninfod probably could build on cross, but the Makefile doesn't pass --host etc to the sub configure... 33 - buildFlags = "man all" + stdenv.lib.optionalString (!stdenv.isCross) " ninfod"; 34 35 installPhase = 36 ''
··· 30 ] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn; 31 32 # ninfod probably could build on cross, but the Makefile doesn't pass --host etc to the sub configure... 33 + buildFlags = "man all" + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) " ninfod"; 34 35 installPhase = 36 ''
-2
pkgs/stdenv/generic/default.nix
··· 141 inherit overrides; 142 143 inherit cc; 144 - 145 - isCross = targetPlatform != buildPlatform; 146 } 147 148 # Propagate any extra attributes. For instance, we use this to
··· 141 inherit overrides; 142 143 inherit cc; 144 } 145 146 # Propagate any extra attributes. For instance, we use this to
+6 -1
pkgs/tools/compression/lzip/default.nix
··· 11 sha256 = "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"; 12 }; 13 14 - configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3" + stdenv.lib.optionalString stdenv.isCross " CXX=${stdenv.cc.targetPrefix}c++"; 15 16 setupHook = ./lzip-setup-hook.sh; 17
··· 11 sha256 = "0319q59kb8g324wnj7xzbr7vvlx5bcs13lr34j0zb3kqlyjq2fy9"; 12 }; 13 14 + configureFlags = [ 15 + "CPPFLAGS=-DNDEBUG" 16 + "CFLAGS=-O3" 17 + "CXXFLAGS=-O3" 18 + ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) 19 + "CXX=${stdenv.cc.targetPrefix}c++"; 20 21 setupHook = ./lzip-setup-hook.sh; 22
+16 -10
pkgs/tools/system/monit/default.nix
··· 1 - {stdenv, fetchurl, openssl, bison, flex, pam, zlib, usePAM ? stdenv.isLinux 2 - , buildPlatform, hostPlatform }: 3 - let useSSL = (openssl != null); 4 - isCross = ( buildPlatform != hostPlatform ) ; in 5 stdenv.mkDerivation rec { 6 name = "monit-5.25.2"; 7 ··· 15 stdenv.lib.optionals useSSL [ openssl ] ++ 16 stdenv.lib.optionals usePAM [ pam ]; 17 18 - configureFlags = 19 - if useSSL then [ 20 "--with-ssl-incl-dir=${openssl.dev}/include" 21 "--with-ssl-lib-dir=${openssl.out}/lib" 22 - ] else [ "--without-ssl" ] ++ 23 - stdenv.lib.optionals (! usePAM) [ "--without-pam" ] ++ 24 # will need to check both these are true for musl 25 - stdenv.lib.optionals isCross [ "libmonit_cv_setjmp_available=yes" 26 - "libmonit_cv_vsnprintf_c99_conformant=yes"]; 27 28 meta = { 29 homepage = http://mmonit.com/monit/;
··· 1 + { stdenv 2 + , fetchurl, bison, flex 3 + , zlib 4 + , usePAM ? stdenv.hostPlatform.isLinux, pam 5 + , useSSL ? true, openssl 6 + }: 7 + 8 stdenv.mkDerivation rec { 9 name = "monit-5.25.2"; 10 ··· 18 stdenv.lib.optionals useSSL [ openssl ] ++ 19 stdenv.lib.optionals usePAM [ pam ]; 20 21 + configureFlags = [ 22 + (stdenv.lib.withFeature usePAM "pam") 23 + ] ++ (if useSSL then [ 24 "--with-ssl-incl-dir=${openssl.dev}/include" 25 "--with-ssl-lib-dir=${openssl.out}/lib" 26 + ] else [ 27 + "--without-ssl" 28 + ]) ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 29 # will need to check both these are true for musl 30 + "libmonit_cv_setjmp_available=yes" 31 + "libmonit_cv_vsnprintf_c99_conformant=yes" 32 + ]; 33 34 meta = { 35 homepage = http://mmonit.com/monit/;