nixpkgs-suyu/pkgs/os-specific/linux/ndiswrapper/default.nix
Samuel Dionne-Riel d8cf1db93f linuxPackages.ndiswrapper: updated to fix build on recent kernels
While the upstream commit says 4.18, it builds for 4.19 and 4.20.
2018-12-26 11:03:10 +00:00

49 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitHub, kernel, perl, kmod, libelf }:
let
version = "1.62-pre";
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 = "
cd ndiswrapper
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
'';
# should we use unstable?
src = fetchFromGitHub {
owner = "pgiri";
repo = "ndiswrapper";
rev = "5e29f6a9d41df949b435066c173e3b1947f179d3";
sha256 = "0sprrmxxkf170bmh1nz9xw00gs89dddr84djlf666bn5bhy6jffi";
};
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" ];
};
}