nixpkgs/pkgs/os-specific/linux/kqemu/default.nix
Eelco Dolstra b23126fcc3 * Include the kernel version in kernel-specific packages so that they
can be distinguished in nix-env -qa output.

svn path=/nixpkgs/trunk/; revision=32352
2012-02-17 14:32:28 +00:00

29 lines
876 B
Nix

{ stdenv, fetchurl, kernel, perl }:
stdenv.mkDerivation rec {
name = "kqemu-1.4.0pre1-${kernel.version}";
src = fetchurl {
url = "http://www.nongnu.org/qemu/${name}.tar.gz";
sha256 = "14dlmawn3gia1j401ag5si5k1a1vav7jpv86rl37p1hwmr7fihxs";
};
buildInputs = [ perl ];
configureFlags = [ ''--PREFIX=$out'' ''--kernel-path=$(ls -d ${kernel}/lib/modules/*/build)'' ];
preConfigure = ''
sed -e '/#include/i#include <linux/sched.h>' -i kqemu-linux.c
sed -e 's/memset/mymemset/g; s/memcpy/mymemcpy/g; s/void [*]my/static void *my/g' -i common/kernel.c
sed -e 's/`uname -r`/'"$(basename ${kernel}/lib/modules/*)"'/' -i install.sh
sed -e '/kernel_path=/akernel_path=$out$kernel_path' -i install.sh
sed -e '/depmod/d' -i install.sh
cat install.sh
'';
meta = {
description = "Kernel module for QEMU acceleration";
};
}