summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel-headers/2.4.nix
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-10 21:32:35 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-03-10 21:32:35 +0000
commit5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6 (patch)
tree683f75a411d23dbe329c94897777b295f87d4c94 /pkgs/os-specific/linux/kernel-headers/2.4.nix
parent648b17197ff0812c9f94816e134001ce918a26c1 (diff)
downloadnixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar.gz
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar.bz2
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar.lz
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar.xz
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.tar.zst
nixlib-5b7f1ef09a10adc515e3386bd0cb38fb3e4167a6.zip
Making busybox cross build with kernel 2.4 for mipsel (I had to disable 'ionice', which
requires some headers >= 2.6.12).

I also add the kernel 2.4 headers expression I forgot in my last commit.

svn path=/nixpkgs/trunk/; revision=20540
Diffstat (limited to 'pkgs/os-specific/linux/kernel-headers/2.4.nix')
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.4.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/2.4.nix b/pkgs/os-specific/linux/kernel-headers/2.4.nix
new file mode 100644
index 000000000000..c179801ca553
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel-headers/2.4.nix
@@ -0,0 +1,54 @@
+{stdenv, fetchurl, perl, cross ? null}:
+
+assert cross == null -> stdenv.isLinux;
+
+let
+  version = "2.4.37.9";
+  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/v2.4/linux-${version}.tar.bz2";
+    sha256 = "08rca9lcb5l5w483hgaqk8pi2njd7cmwpkifjqxwlb3g8liz4r5g";
+  };
+
+  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.system == "armv5tel-linux" then "arm" else
+    abort "don't know what the kernel include directory is called for this platform";
+
+  buildInputs = [perl];
+
+  patchPhase = ''
+    sed -i s,/bin/pwd,pwd, Makefile
+  '';
+
+  extraIncludeDirs =
+    if cross != null then
+      (if cross.arch == "powerpc" then ["ppc"] else [])
+    else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
+
+  buildPhase = ''
+    cp arch/$platform/${kernelHeadersBaseConfig} .config
+    make mrproper symlinks include/linux/{version,compile}.h \
+      ARCH=$platform
+    yes "" | make oldconfig ARCH=$platform
+  '';
+
+  installPhase = ''
+    ensureDir $out/include
+    cp -a include/{asm,asm-$platform,acpi,linux,pcmcia,scsi,video} \
+      $out/include
+  '';
+}