diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix index f06649e1991a5..21c69ed560a32 100644 --- a/nixos/lib/make-ext4-fs.nix +++ b/nixos/lib/make-ext4-fs.nix @@ -10,7 +10,7 @@ pkgs.stdenv.mkDerivation { name = "ext4-fs.img"; - buildInputs = with pkgs; [e2fsprogs libfaketime perl]; + nativeBuildInputs = with pkgs; [e2fsprogs libfaketime perl]; # For obtaining the closure of `storePaths'. exportReferencesGraph = diff --git a/nixos/lib/make-squashfs.nix b/nixos/lib/make-squashfs.nix index e66c0ae8f6615..9d47a3222cc27 100644 --- a/nixos/lib/make-squashfs.nix +++ b/nixos/lib/make-squashfs.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation { name = "squashfs.img"; - buildInputs = [perl squashfsTools]; + nativeBuildInputs = [perl squashfsTools]; # For obtaining the closure of `storeContents'. exportReferencesGraph = diff --git a/nixos/modules/security/wrappers/default.nix b/nixos/modules/security/wrappers/default.nix index 1f64213accd46..77e4b2a616d8e 100644 --- a/nixos/modules/security/wrappers/default.nix +++ b/nixos/modules/security/wrappers/default.nix @@ -17,7 +17,7 @@ let hardeningEnable = [ "pie" ]; installPhase = '' mkdir -p $out/bin - gcc -Wall -O2 -DWRAPPER_DIR=\"${parentWrapperDir}\" \ + $CC -Wall -O2 -DWRAPPER_DIR=\"${parentWrapperDir}\" \ -lcap-ng -lcap ${./wrapper.c} -o $out/bin/security-wrapper ''; }; @@ -79,7 +79,7 @@ let ({ owner = "root"; group = "root"; } // s) - else if + else if (s ? "setuid" && s.setuid) || (s ? "setgid" && s.setgid) || (s ? "permissions") diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix index f65e2fe1851b3..626b3b2195de8 100644 --- a/pkgs/applications/networking/browsers/w3m/default.nix +++ b/pkgs/applications/networking/browsers/w3m/default.nix @@ -53,8 +53,12 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - configureFlags = "--with-ssl=${openssl.dev} --with-gc=${boehmgc.dev}" - + optionalString graphicsSupport " --enable-image=${optionalString x11Support "x11,"}fb"; + configureFlags = + [ "--with-ssl=${openssl.dev}" "--with-gc=${boehmgc.dev}" ] + ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "ac_cv_func_setpgrp_void=yes" + ] + ++ optional graphicsSupport "--enable-image=${optionalString x11Support "x11,"}fb"; preConfigure = '' substituteInPlace ./configure --replace "/lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64" /no-such-path diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index cfec3209b98aa..d317a5701f19d 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -228,6 +228,6 @@ stdenv.mkDerivation ({ # To avoid a dependency on the build system 'bash'. preFixup = '' - rm $bin/bin/{ldd,tzselect,catchsegv,xtrace} + rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace} ''; }) diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index debd7b39c86a0..7090c5ceceeca 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -6,7 +6,7 @@ https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED */ -{ stdenv, callPackage, writeText +{ stdenv, buildPackages, callPackage, writeText , allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ] }: @@ -26,7 +26,7 @@ callPackage ./common.nix { inherit stdenv; } { # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. buildPhase = '' - mkdir -p $TMPDIR/"${stdenv.cc.libc.out}/lib/locale" + mkdir -p $TMPDIR/"${buildPackages.stdenv.cc.libc.out}/lib/locale" # Hack to allow building of the locales (needed since glibc-2.12) sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix index 5140402eacb9a..28c8a915c6357 100644 --- a/pkgs/development/libraries/libomxil-bellagio/default.nix +++ b/pkgs/development/libraries/libomxil-bellagio/default.nix @@ -8,7 +8,10 @@ stdenv.mkDerivation rec { url = "mirror://sourceforge/omxil/omxil/Bellagio%20${version}/${name}.tar.gz"; sha256 = "0k6p6h4npn8p1qlgq6z3jbfld6n1bqswzvxzndki937gr0lhfg2r"; }; - + + configureFlags = + stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ]; + patches = [ ./fedora-fixes.patch ]; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/pixman/default.nix b/pkgs/development/libraries/pixman/default.nix index dc378711d36ba..3980af97a597c 100644 --- a/pkgs/development/libraries/pixman/default.nix +++ b/pkgs/development/libraries/pixman/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { configureFlags = stdenv.lib.optional stdenv.isArm "--disable-arm-iwmmxt"; - doCheck = true; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; postInstall = glib.flattenInclude; diff --git a/pkgs/development/libraries/uthash/default.nix b/pkgs/development/libraries/uthash/default.nix index 9c252004656c1..6337edf68caf2 100644 --- a/pkgs/development/libraries/uthash/default.nix +++ b/pkgs/development/libraries/uthash/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = stdenv.lib.optional doCheck perl; - doCheck = true; + doCheck = stdenv.buildPlatform == stdenv.hostPlatform; checkTarget = "-C tests/"; installPhase = '' diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index 9e21a141c728d..833f3094011c3 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -2,11 +2,12 @@ perl: { buildInputs ? [], name, ... } @ attrs: -perl.stdenv.mkDerivation ( +with perl.stdenv; +mkDerivation ( { outputs = [ "out" "devdoc" ]; - doCheck = true; + doCheck = hostPlatform == buildPlatform; checkTarget = "test"; diff --git a/pkgs/os-specific/linux/cpupower/default.nix b/pkgs/os-specific/linux/cpupower/default.nix index d6d529627e244..c148b6cb5045e 100644 --- a/pkgs/os-specific/linux/cpupower/default.nix +++ b/pkgs/os-specific/linux/cpupower/default.nix @@ -5,6 +5,7 @@ stdenv.mkDerivation { src = kernel.src; + nativeBuildInputs = [ gettext ]; buildInputs = [ coreutils pciutils gettext ]; configurePhase = '' @@ -15,7 +16,7 @@ stdenv.mkDerivation { ''; buildPhase = '' - make + make CROSS=${stdenv.cc.targetPrefix} ''; installPhase = '' diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index 1e2c1dafb2db6..31dd0cbf18d84 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { # This is to avoid self-references, which causes the initrd to explode # in size and in turn prevents mdraid systems from booting. - allowedReferences = [ stdenv.glibc.out ]; + allowedReferences = [ stdenv.cc.libc.out ]; patches = [ ./no-self-references.patch ]; diff --git a/pkgs/tools/misc/ms-sys/default.nix b/pkgs/tools/misc/ms-sys/default.nix index 744e5d99ef5e9..3b7f3019998c4 100644 --- a/pkgs/tools/misc/ms-sys/default.nix +++ b/pkgs/tools/misc/ms-sys/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { name = "ms-sys-${version}"; version = "2.5.3"; - + src = fetchurl { url = "mirror://sourceforge/ms-sys/${name}.tar.gz"; sha256 = "0mijf82cbji4laip6hiy3l5ka5mzq5sivjvyv7wxnc2fd3v7hgp0"; }; - buildInputs = [ gettext ]; + nativeBuildInputs = [ gettext ]; enableParallelBuilding = true; diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix index 68240210e7466..2670367475345 100644 --- a/pkgs/tools/misc/parted/default.nix +++ b/pkgs/tools/misc/parted/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { # Tests were previously failing due to Hydra running builds as uid 0. # That should hopefully be fixed now. - doCheck = true; + doCheck = stdenv.buildPlatform == stdenv.hostPlatform; preCheck = stdenv.lib.optionalString doCheck diff --git a/pkgs/tools/system/ddrescue/default.nix b/pkgs/tools/system/ddrescue/default.nix index 5f439ccdb530d..bf2ff5a620670 100644 --- a/pkgs/tools/system/ddrescue/default.nix +++ b/pkgs/tools/system/ddrescue/default.nix @@ -16,6 +16,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ lzip ]; doCheck = hostPlatform == buildPlatform; + configureFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ]; meta = with stdenv.lib; { description = "GNU ddrescue, a data recovery tool";