summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kqemu/1.3.0pre11.nix
blob: f3bfe1a5c7bb40aaa8e345d96aa291d48dad7c66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
args : with args;
rec {
  name = "kqemu-"+version;
  src = fetchurl {
    url = http://www.nongnu.org/qemu/kqemu-1.3.0pre11.tar.gz;
    sha256 = "03svg2x52ziglf9r9irf6ziiz8iwa731fk1mdskwdip5jxbyy6jl";
  };

  buildInputs = [];
  configureFlags = [''--PREFIx=$out'' ''--kernel-path=$(ls -d ${kernel}/lib/modules/*/build)''];
  debugStep = FullDepEntry (''
  	cat config-host.mak
  '') ["minInit"];
  preConfigure = FullDepEntry ('' 
    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
    sed -e '/linux\/ioctl.h/a#include <linux\/sched.h>' -i kqemu-linux.c
  '') ["minInit" "doUnpack"];
  fixInc = {
    text = ''
      sed -e '/#include/i#include <linux/sched.h>' -i kqemu-linux.c
    '';
    deps = ["minInit" "doUnpack"];
  };
  fixMemFunc = {
    text=''
      sed -e 's/memset/mymemset/g; s/memcpy/mymemcpy/g; s/void [*]my/static void *my/g' -i common/kernel.c
    '';
    deps = ["minInit" "doUnpack"];
  };
  phaseNames = ["fixInc" "fixMemFunc" "preConfigure" "doConfigure" "debugStep" "doMakeInstall"];

  meta = {
    description = "Kernel module for Qemu acceleration";
  }; 
}