From d3cf97b56ed237a7033194850b7a324d039abf2d Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 1 Oct 2011 22:25:28 +0000 Subject: [PATCH] Cleaner decoupling of glibc and linuxPackages while keeping kernelHeaders a linuxPackage and having a single default.nix for kernelHeaders svn path=/nixpkgs/branches/stdenv-updates/; revision=29554 --- pkgs/os-specific/linux/kernel-headers/default.nix | 4 ++-- pkgs/os-specific/linux/kernel/generic.nix | 8 +------- pkgs/top-level/all-packages.nix | 11 ++++++++++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index d2c6bf9d700e..bb2e6a288037 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -3,7 +3,7 @@ assert cross == null -> stdenv.isLinux; let - version = kernel.headersVersion; + version = kernel.version; kernelHeadersBaseConfig = if (cross == null) then stdenv.platform.kernelHeadersBaseConfig else @@ -13,7 +13,7 @@ in stdenv.mkDerivation { name = "linux-headers-${version}"; - src = kernel.headersSrc; + src = kernel.src; targetConfig = if (cross != null) then cross.config else null; diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 11aaf176891c..af62125eb757 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -3,15 +3,9 @@ , # The kernel source tarball. src -, # The kernel headers source tarball. - headersSrc ? src - , # The kernel version. version -, # The kernel headers version. - headersVersion ? version - , # The version number used for the module directory modDirVersion ? version @@ -75,7 +69,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; passthru = { - inherit version modDirVersion kernelPatches headersSrc headersVersion; + inherit version modDirVersion kernelPatches; # Combine the `features' attribute sets of all the kernel patches. features = lib.fold (x: y: (if x ? features then x.features else {}) // y) features kernelPatches; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 92fa24586c75..89a7a541aab4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5242,7 +5242,16 @@ let libnl1 = callPackage ../os-specific/linux/libnl/v1.nix { }; - linuxHeaders = linuxPackages.kernelHeaders; + linuxHeaders = + let + + kernel = { + src = linuxPackages.kernel.src; + version = linuxPackages.kernel.version; + }; + + in + callPackage ../os-specific/linux/kernel-headers { inherit kernel; }; linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix { inherit stdenv fetchurl perl;