From b713e291a47c68f478b84e4fd9324e3f4bf45d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 8 May 2012 16:38:21 +0000 Subject: [PATCH] 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 --- pkgs/os-specific/linux/jujuutils/default.nix | 4 +- .../linux/kernel-headers/3.3.5.nix | 62 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +- 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 pkgs/os-specific/linux/kernel-headers/3.3.5.nix 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 + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e47601f4a891..8c76fe49d0b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5539,7 +5539,9 @@ let 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 @@ let 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;