2009-11-23 12:21:34 +00:00
|
|
|
{ stdenv, fetchurl, kernel, perl, fullDepEntry, ... }:
|
2009-11-18 09:39:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "kqemu-1.4.0pre1";
|
|
|
|
|
2008-11-02 15:54:44 +00:00
|
|
|
src = fetchurl {
|
2009-11-18 09:39:59 +00:00
|
|
|
url = "http://www.nongnu.org/qemu/${name}.tar.gz";
|
2008-11-02 15:54:44 +00:00
|
|
|
sha256 = "14dlmawn3gia1j401ag5si5k1a1vav7jpv86rl37p1hwmr7fihxs";
|
|
|
|
};
|
|
|
|
|
2009-09-12 07:11:21 +01:00
|
|
|
buildInputs = [perl];
|
2009-11-18 09:39:59 +00:00
|
|
|
|
2009-11-23 12:21:34 +00:00
|
|
|
configureFlags = [''--PREFIX=$out'' ''--kernel-path=$(ls -d ${kernel}/lib/modules/*/build)''];
|
2009-11-18 09:39:59 +00:00
|
|
|
|
2009-11-23 12:21:34 +00:00
|
|
|
preConfigure = fullDepEntry (''
|
2009-11-18 09:39:59 +00:00
|
|
|
sed -e '/#include/i#include <linux/sched.h>' -i kqemu-linux.c
|
|
|
|
|
2009-11-23 12:21:34 +00:00
|
|
|
sed -e 's/memset/mymemset/g; s/memcpy/mymemcpy/g; s/void [*]my/static void *my/g' -i common/kernel.c
|
2008-11-02 15:54:44 +00:00
|
|
|
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
|
2009-11-23 12:21:34 +00:00
|
|
|
'') ["minInit" "doUnpack"];
|
|
|
|
|
|
|
|
phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];
|
2009-11-18 09:39:59 +00:00
|
|
|
|
2008-11-02 15:54:44 +00:00
|
|
|
meta = {
|
2009-11-18 09:39:59 +00:00
|
|
|
description = "Kernel module for Qemu acceleration";
|
2008-11-02 15:54:44 +00:00
|
|
|
};
|
|
|
|
}
|