linuxHeaders: replace rsync by cp and find

See https://github.com/NixOS/nixpkgs/pull/78994#issuecomment-584437442
This commit is contained in:
Orivej Desh 2020-02-11 01:41:58 +00:00
parent d48e99d912
commit 330707e54d

View File

@ -1,7 +1,4 @@
{ stdenvNoCC, lib, buildPackages
, fetchurl, perl, rsync
, elf-header
}:
{ stdenvNoCC, lib, buildPackages, fetchurl, perl, elf-header }:
let
makeLinuxHeaders = { src, version, patches ? [] }: stdenvNoCC.mkDerivation {
@ -16,7 +13,7 @@ let
# We do this so we have a build->build, not build->host, C compiler.
depsBuildBuild = [ buildPackages.stdenv.cc ];
# `elf-header` is null when libc provides `elf.h`.
nativeBuildInputs = [ perl rsync elf-header ];
nativeBuildInputs = [ perl elf-header ];
extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
@ -47,8 +44,15 @@ let
make headers_check $makeFlags
'';
# The following command requires rsync:
# make headers_install INSTALL_HDR_PATH=$out $makeFlags
# but rsync depends on popt which does not compile on aarch64 without
# updateAutotoolsGnuConfigScriptsHook which is not enabled in stage2,
# so we replicate it with cp. This also reduces bootstrap closure size.
installPhase = ''
make headers_install INSTALL_HDR_PATH=$out $makeFlags
mkdir -p $out
cp -r usr/include $out
find $out -type f ! -name '*.h' -delete
''
# Some builds (e.g. KVM) want a kernel.release.
+ ''