diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2012-05-08 16:38:21 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2012-05-08 16:38:21 +0000 |
commit | b713e291a47c68f478b84e4fd9324e3f4bf45d4d (patch) | |
tree | 89c32d68ea97feb426f79747c1ec79f6ca0568e1 /pkgs/os-specific | |
parent | 671857995da45ed2f292bd8d64a609f674b407d9 (diff) | |
download | nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar.gz nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar.bz2 nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar.lz nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar.xz nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.tar.zst nixlib-b713e291a47c68f478b84e4fd9324e3f4bf45d4d.zip |
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. svn path=/nixpkgs/trunk/; revision=34021
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/jujuutils/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel-headers/3.3.5.nix | 62 |
2 files changed, 65 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/jujuutils/default.nix b/pkgs/os-specific/linux/jujuutils/default.nix index ca9bd5197cab..c52aae291ebe 100644 --- a/pkgs/os-specific/linux/jujuutils/default.nix +++ b/pkgs/os-specific/linux/jujuutils/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, linuxHeaders}: stdenv.mkDerivation { name = "jujuutils-0.2"; @@ -8,6 +8,8 @@ stdenv.mkDerivation { sha256 = "1r74m7s7rs9d6y7cffi7mdap3jf96qwm1v6jcw53x5cikgmfxn4x"; }; + buildInputs = [ linuxHeaders ]; + meta = { description = "Utilities around FireWire devices connected to a Linux computer"; license = "GPLv2"; diff --git a/pkgs/os-specific/linux/kernel-headers/3.3.5.nix b/pkgs/os-specific/linux/kernel-headers/3.3.5.nix new file mode 100644 index 000000000000..f4dd28dab031 --- /dev/null +++ b/pkgs/os-specific/linux/kernel-headers/3.3.5.nix @@ -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 + ''; +} |