@@ -1,4 +1,9 @@
1−{ stdenv, fetchurl, coreutils }:
1+{ stdenv, fetchurl
2+, coreutils
3+, buildPlatform, hostPlatform
4+}:
5+
6+let inherit (stdenv.lib) optionals; in
27
38stdenv.mkDerivation rec {
49 name = "findutils-4.6.0";
@@ -10,20 +15,18 @@ stdenv.mkDerivation rec {
1015
1116 patches = [ ./memory-leak.patch ./no-install-statedir.patch ];
1217
13− buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort
18+ buildInputs = optionals (hostPlatform == buildPlatform) [ coreutils ]; # bin/updatedb script needs to call sort
1419
1520 # Since glibc-2.25 the i686 tests hang reliably right after test-sleep.
16− doCheck = !stdenv.isDarwin && (stdenv.system != "i686-linux");
21+ doCheck
22+ = !hostPlatform.isDarwin
23+ && !(hostPlatform.libc == "glibc" && hostPlatform.isi686)
24+ && hostPlatform == buildPlatform;
1725
1826 outputs = [ "out" "info" ];
1927
2028 configureFlags = [ "--localstatedir=/var/cache" ];
2129
22− crossAttrs = {
23− # Fix the 'buildInputs = [ coreutils ]' above - that adds the cross coreutils to PATH :(
24− propagatedBuildInputs = [ ];
25− };
26−
2730 enableParallelBuilding = true;
2831
2932 meta = {