From d710c2d9430f0ebc3f743c4ca5c6e3e5718c149e Mon Sep 17 00:00:00 2001 From: Ross MacLeod Date: Sun, 4 Jun 2017 17:32:55 +0000 Subject: [PATCH] findutils: modernize and fix cross --- pkgs/tools/misc/findutils/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index 53d75485d5c..06a140fed50 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchurl, coreutils }: +{ stdenv, fetchurl +, coreutils +, buildPlatform, hostPlatform +}: + +let inherit (stdenv.lib) optionals; in stdenv.mkDerivation rec { name = "findutils-4.6.0"; @@ -10,20 +15,18 @@ stdenv.mkDerivation rec { patches = [ ./memory-leak.patch ./no-install-statedir.patch ]; - buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort + buildInputs = optionals (hostPlatform == buildPlatform) [ coreutils ]; # bin/updatedb script needs to call sort # Since glibc-2.25 the i686 tests hang reliably right after test-sleep. - doCheck = !stdenv.isDarwin && (stdenv.system != "i686-linux"); + doCheck + = !hostPlatform.isDarwin + && !(hostPlatform.libc == "glibc" && hostPlatform.isi686) + && hostPlatform == buildPlatform; outputs = [ "out" "info" ]; configureFlags = [ "--localstatedir=/var/cache" ]; - crossAttrs = { - # Fix the 'buildInputs = [ coreutils ]' above - that adds the cross coreutils to PATH :( - propagatedBuildInputs = [ ]; - }; - enableParallelBuilding = true; meta = {