2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, kernel, perl, kmod, libelf }:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2020-11-19 00:13:47 +00:00
|
|
|
version = "1.63";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ndiswrapper-${version}-${kernel.version}";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
patches = [ ./no-sbin.patch ];
|
|
|
|
|
|
|
|
# need at least .config and include
|
|
|
|
kernel = kernel.dev;
|
|
|
|
|
|
|
|
buildPhase = "
|
|
|
|
echo make KBUILD=$(echo \$kernel/lib/modules/*/build);
|
|
|
|
echo -n $kernel/lib/modules/*/build > kbuild_path
|
|
|
|
export PATH=${kmod}/sbin:$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
|
|
|
|
'';
|
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ndiswrapper/files/stable/ndiswrapper-${version}.tar.gz";
|
|
|
|
sha256 = "1v6b66jhisl110jfl00hm43lmnrav32vs39d85gcbxrjqnmcx08g";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl libelf ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Ndis driver wrapper for the Linux kernel";
|
|
|
|
homepage = "https://sourceforge.net/projects/ndiswrapper";
|
|
|
|
license = "GPL";
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
broken = lib.versionAtLeast kernel.version "5.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|