summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ndiswrapper/default.nix
blob: c41649e0285bb43ad657117733c62a33f9243855 (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
39
40
{ stdenv, fetchurl, kernel, perl }:

stdenv.mkDerivation {
  name = "ndiswrapper-1.56-${kernel.version}";

  # need at least .config and include 
  inherit kernel;

  buildPhase = "
    echo make KBUILD=$(echo \$kernel/lib/modules/*/build);
    echo -n $kernel/lib/modules/*/build > kbuild_path
    make KBUILD=$(echo \$kernel/lib/modules/*/build);
  ";

  installPhase = ''
    make install KBUILD=$(cat kbuild_path) DESTDIR=$out
    mv $out/usr/sbin/* $out/sbin/
    mv $out/usr/share $out/
    rm -r $out/usr

    patchShebangs $out/sbin
  '';

  # should we use unstable? 
  src = fetchurl {
    url = http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.56.tar.gz;
    sha256 = "10yqg1a08v6z1qm1qr1v4rbhl35c90gzrazapr09vp372hky8f57";
  };

  buildInputs = [ kernel perl ];

  # this is a patch against svn head, not stable version
  patches = [./prefix.patch];

  meta = { 
    description = "Ndis driver wrapper for the Linux kernel";
    homepage = http://sourceforge.net/projects/ndiswrapper;
    license = "GPL";
  };
}