2022-08-18 18:11:42 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, fetchpatch }:
|
2021-05-23 11:15:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "rtl8188eus-aircrack";
|
2022-08-18 18:11:42 +00:00
|
|
|
version = "${kernel.version}-unstable-2022-03-19";
|
2021-05-23 11:15:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aircrack-ng";
|
|
|
|
repo = "rtl8188eus";
|
2022-08-18 18:11:42 +00:00
|
|
|
rev = "0958f294f90b49d6bad4972b14f90676e5d858d3";
|
|
|
|
sha256 = "sha256-dkCcwvOLxqU1IZ/OXTp67akjWgsaH1Cq4N8d9slMRI8=";
|
2021-05-23 11:15:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
|
|
|
|
--replace /sbin/depmod \# \
|
|
|
|
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
2022-08-18 18:11:42 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aircrack-ng/rtl8188eus/commit/daa3a2e12290050be3af956915939a55aed50d5f.patch";
|
|
|
|
hash = "sha256-VsvaAhO74LzqUxbmdDT9qwVl6Y9lXfGfrHHK3SbnOVA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-01-13 19:21:40 +00:00
|
|
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
2022-08-18 18:11:42 +00:00
|
|
|
|
2021-05-23 11:15:37 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RealTek RTL8188eus WiFi driver with monitor mode & frame injection support";
|
|
|
|
homepage = "https://github.com/aircrack-ng/rtl8188eus";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
2022-08-18 18:11:42 +00:00
|
|
|
broken = (lib.versionAtLeast kernel.version "5.17") || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
|
2021-05-23 11:15:37 +00:00
|
|
|
};
|
|
|
|
}
|