linux-headers: Fix bootstrap tools reference

This commit is contained in:
John Ericson 2018-10-25 20:24:32 -04:00
parent 7081b5e1ae
commit 1b77815d25

View File

@ -17,10 +17,8 @@ let
# It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc. # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
# We do this so we have a build->build, not build->host, C compiler. # We do this so we have a build->build, not build->host, C compiler.
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
# TODO make unconditional next mass rebuild # `elf-header` is null when libc provides `elf.h`.
nativeBuildInputs = [ perl ] ++ lib.optional nativeBuildInputs = [ perl elf-header ];
(stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform)
elf-header;
extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"]; extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
@ -57,10 +55,15 @@ let
installPhase = '' installPhase = ''
make headers_install INSTALL_HDR_PATH=$out $makeFlags make headers_install INSTALL_HDR_PATH=$out $makeFlags
''
# Some builds (e.g. KVM) want a kernel.release. # Some builds (e.g. KVM) want a kernel.release.
mkdir -p $out/include/config + '' mkdir -p $out/include/config
echo "${version}-default" > $out/include/config/kernel.release echo "${version}-default" > $out/include/config/kernel.release
''
# These oddly named file records teh `SHELL` passed, which causes bootstrap
# tools run-time dependency.
+ ''
find "$out" -name '..install.cmd' -print0 | xargs -0 rm
''; '';
meta = with lib; { meta = with lib; {
@ -74,7 +77,6 @@ in {
linuxHeaders = common { linuxHeaders = common {
version = "4.18.3"; version = "4.18.3";
sha256 = "1m23hjd02bg8mqnd8dc4z4m3kxds1cyrc6j5saiwnhzbz373rvc1"; sha256 = "1m23hjd02bg8mqnd8dc4z4m3kxds1cyrc6j5saiwnhzbz373rvc1";
# TODO make unconditional next mass rebuild
patches = [ patches = [
./no-relocs.patch # for building x86 kernel headers on non-ELF platforms ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
./no-dynamic-cc-version-check.patch # so we can use `stdenvNoCC`, see `makeFlags` above ./no-dynamic-cc-version-check.patch # so we can use `stdenvNoCC`, see `makeFlags` above