summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel-headers
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-26 23:40:40 +0100
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-10-25 21:45:04 -0400
commit7081b5e1aee0d3e0257c16734c07a9b7dace2af9 (patch)
tree2c3c8fe216d8a1fd2d61600fb87aa98791215218 /pkgs/os-specific/linux/kernel-headers
parentddebab3575e8bd95b23b744156c7f6ab23b563f1 (diff)
downloadnixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar.gz
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar.bz2
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar.lz
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar.xz
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.tar.zst
nixpkgs-7081b5e1aee0d3e0257c16734c07a9b7dace2af9.zip
linux-headers: Clean up with mass rebuild
Diffstat (limited to 'pkgs/os-specific/linux/kernel-headers')
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix30
1 files changed, 9 insertions, 21 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index 011668f0c67..fa339e56e2e 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -4,7 +4,7 @@
 }:
 
 let
-  common = { version, sha256, patches ? [] }: stdenvNoCC.mkDerivation ({
+  common = { version, sha256, patches ? [] }: stdenvNoCC.mkDerivation {
     name = "linux-headers-${version}";
 
     src = fetchurl {
@@ -24,12 +24,11 @@ let
 
     extraIncludeDirs = lib.optional stdenvNoCC.hostPlatform.isPowerPC ["ppc"];
 
-    # "patches" array defaults to 'null' to avoid changing hash
-    # and causing mass rebuild
     inherit patches;
 
-    # TODO avoid native hack next rebuild
-    makeFlags = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then null else [
+    hardeningDisable = lib.optional stdenvNoCC.buildPlatform.isDarwin "format";
+
+    makeFlags = [
       "SHELL=bash"
       # Avoid use of runtime build->host compilers for checks. These
       # checks only cared to work around bugs in very old compilers, so
@@ -41,11 +40,8 @@ let
       "HOSTCXX:=$(BUILD_CXX)"
     ];
 
-    # TODO avoid native hack next rebuild
     # Skip clean on darwin, case-sensitivity issues.
-    buildPhase = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then ''
-      make mrproper headers_check SHELL=bash
-    '' else lib.optionalString (!stdenvNoCC.buildPlatform.isDarwin) ''
+    buildPhase = lib.optionalString (!stdenvNoCC.buildPlatform.isDarwin) ''
       make mrproper $makeFlags
     ''
     # For some reason, doing `make install_headers` twice, first without
@@ -55,17 +51,12 @@ let
       make headers_install $makeFlags
     '';
 
-    # TODO avoid native hack next rebuild
-    checkPhase = if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then null else ''
+    checkPhase = ''
       make headers_check $makeFlags
     '';
 
-    # TODO avoid native hack next rebuild
-    installPhase = (if stdenvNoCC.hostPlatform == stdenvNoCC.buildPlatform then ''
-      make INSTALL_HDR_PATH=$out headers_install
-    '' else ''
+    installPhase = ''
       make headers_install INSTALL_HDR_PATH=$out $makeFlags
-    '') + ''
 
       # Some builds (e.g. KVM) want a kernel.release.
       mkdir -p $out/include/config
@@ -77,17 +68,14 @@ let
       license = licenses.gpl2;
       platforms = platforms.linux;
     };
-  } // lib.optionalAttrs (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform) {
-    # TODO Make unconditional next mass rebuild
-    hardeningDisable = lib.optional stdenvNoCC.buildPlatform.isDarwin "format";
-  });
+  };
 in {
 
   linuxHeaders = common {
     version = "4.18.3";
     sha256 = "1m23hjd02bg8mqnd8dc4z4m3kxds1cyrc6j5saiwnhzbz373rvc1";
     # TODO make unconditional next mass rebuild
-    patches = lib.optionals (stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform) [
+    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
     ];