summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel-headers
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-10-25 20:24:32 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-10-25 23:05:16 -0400
commit1b77815d251db62fb34b56b432067d1e39a861b2 (patch)
tree517cf992ec1e3ad445565ee47f7fa3bc6460329c /pkgs/os-specific/linux/kernel-headers
parent7081b5e1aee0d3e0257c16734c07a9b7dace2af9 (diff)
downloadnixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar.gz
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar.bz2
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar.lz
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar.xz
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.tar.zst
nixpkgs-1b77815d251db62fb34b56b432067d1e39a861b2.zip
linux-headers: Fix bootstrap tools reference
Diffstat (limited to 'pkgs/os-specific/linux/kernel-headers')
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index fa339e56e2e..eb0059f55c3 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -17,10 +17,8 @@ let
     # 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.
     depsBuildBuild = [ buildPackages.stdenv.cc ];
-    # TODO make unconditional next mass rebuild
-    nativeBuildInputs = [ perl ] ++ lib.optional
-      (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform)
-      elf-header;
+    # `elf-header` is null when libc provides `elf.h`.
+    nativeBuildInputs = [ perl elf-header ];
 
     extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
 
@@ -57,10 +55,15 @@ let
 
     installPhase = ''
       make headers_install INSTALL_HDR_PATH=$out $makeFlags
-
-      # Some builds (e.g. KVM) want a kernel.release.
-      mkdir -p $out/include/config
+    ''
+    # Some builds (e.g. KVM) want a kernel.release.
+    + '' mkdir -p $out/include/config
       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; {
@@ -74,7 +77,6 @@ in {
   linuxHeaders = common {
     version = "4.18.3";
     sha256 = "1m23hjd02bg8mqnd8dc4z4m3kxds1cyrc6j5saiwnhzbz373rvc1";
-    # TODO make unconditional next mass rebuild
     patches = [
        ./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