Author: viric
Date: Tue May  8 16:38:21 2012
New Revision: 34021
URL: https://nixos.org/websvn/nix/?rev=34021&sc=1

Log:
The jujuutils are meant for a recent kernel, more recent than our linuxHeaders.
Therefore I add recent linuxHeaders for it.

It's quite a hack to build it mixed with 2.6.35 headers and 3.3.5, but it 
builds at least.

Added:
   nixpkgs/trunk/pkgs/os-specific/linux/kernel-headers/3.3.5.nix
Modified:
   nixpkgs/trunk/pkgs/os-specific/linux/jujuutils/default.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/os-specific/linux/jujuutils/default.nix
==============================================================================
--- nixpkgs/trunk/pkgs/os-specific/linux/jujuutils/default.nix  Tue May  8 
15:31:21 2012        (r34020)
+++ nixpkgs/trunk/pkgs/os-specific/linux/jujuutils/default.nix  Tue May  8 
16:38:21 2012        (r34021)
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, linuxHeaders}:
 
 stdenv.mkDerivation {
   name = "jujuutils-0.2";
@@ -8,6 +8,8 @@
     sha256 = "1r74m7s7rs9d6y7cffi7mdap3jf96qwm1v6jcw53x5cikgmfxn4x";
   };
 
+  buildInputs = [ linuxHeaders ];
+
   meta = {
     description = "Utilities around FireWire devices connected to a Linux 
computer";
     license = "GPLv2";

Added: nixpkgs/trunk/pkgs/os-specific/linux/kernel-headers/3.3.5.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/os-specific/linux/kernel-headers/3.3.5.nix       Tue May 
 8 16:38:21 2012        (r34021)
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, perl, cross ? null }:
+
+assert cross == null -> stdenv.isLinux;
+
+let
+  version = "3.3.5";
+  kernelHeadersBaseConfig = if cross == null then
+      stdenv.platform.kernelHeadersBaseConfig
+    else
+      cross.platform.kernelHeadersBaseConfig;
+in
+
+stdenv.mkDerivation {
+  name = "linux-headers-${version}";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
+    sha256 = "0i74jn47f6vs5kcvk8abvz3k08z32c9bbqw0sdjkdxwvr4jbczpv";
+  };
+
+  targetConfig = if (cross != null) then cross.config else null;
+
+  platform =
+    if cross != null then cross.platform.kernelArch else
+    if stdenv.system == "i686-linux" then "i386" else
+    if stdenv.system == "x86_64-linux" then "x86_64" else
+    if stdenv.system == "powerpc-linux" then "powerpc" else
+    if stdenv.isArm then "arm" else
+    if stdenv.platform ? kernelArch then stdenv.platform.kernelArch else
+    abort "don't know what the kernel include directory is called for this 
platform";
+
+  buildInputs = [perl];
+
+  extraIncludeDirs =
+    if cross != null then
+       (if cross.arch == "powerpc" then ["ppc"] else [])
+    else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
+
+  buildPhase = ''
+    if test -n "$targetConfig"; then
+       export ARCH=$platform
+    fi
+    make ${kernelHeadersBaseConfig}
+    make mrproper headers_check
+  '';
+
+  installPhase = ''
+    make INSTALL_HDR_PATH=$out headers_install
+
+    # Some builds (e.g. KVM) want a kernel.release.
+    mkdir -p $out/include/config
+    echo "${version}-default" > $out/include/config/kernel.release
+  '';
+
+  # !!! hacky
+  fixupPhase = ''
+    ln -s asm $out/include/asm-$platform
+    if test "$platform" = "i386" -o "$platform" = "x86_64"; then
+      ln -s asm $out/include/asm-x86
+    fi
+  '';
+}

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Tue May  8 15:31:21 
2012        (r34020)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Tue May  8 16:38:21 
2012        (r34021)
@@ -5539,7 +5539,9 @@
 
   iwlwifi6000g2bucode = callPackage 
../os-specific/linux/firmware/iwlwifi-6000g2b-ucode { };
 
-  jujuutils = callPackage ../os-specific/linux/jujuutils { };
+  jujuutils = callPackage ../os-specific/linux/jujuutils {
+    linuxHeaders = linuxHeaders33;
+  };
 
   kbd = callPackage ../os-specific/linux/kbd { };
 
@@ -5559,6 +5561,8 @@
 
   linuxHeaders = callPackage ../os-specific/linux/kernel-headers { };
 
+  linuxHeaders33 = callPackage ../os-specific/linux/kernel-headers/3.3.5.nix { 
};
+
   linuxHeaders26Cross = forceBuildDrv (import 
../os-specific/linux/kernel-headers/2.6.32.nix {
     inherit stdenv fetchurl perl;
     cross = assert crossSystem != null; crossSystem;
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to