2024-02-29 20:09:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, fetchpatch }:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "rtl8188eus-aircrack";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "${kernel.version}-unstable-2023-09-21";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aircrack-ng";
|
|
|
|
repo = "rtl8188eus";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "3fae7237ba121f1169e9a2ea55040dc123697d3b";
|
|
|
|
sha256 = "sha256-ILSMEt9nMdg1ZbFeatWm8Yxf6a/E7Vm7KtKhN933KTc=";
|
2021-06-28 23:13:55 +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/"
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
# until https://github.com/aircrack-ng/rtl8188eus/pull/275 get merged using patches to fix and add newer kernel 6.7 support
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aircrack-ng/rtl8188eus/commit/dcf602320ce0cfa316c990ce067317954d75edae.patch";
|
|
|
|
hash = "sha256-AkrqqWv5TPHBfQ7FhS0urXnUw5QHQUrbvEb+NkLxpJA=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aircrack-ng/rtl8188eus/commit/c5647f440a38e72c97054b949760ac14faf22b6c.patch";
|
|
|
|
hash = "sha256-0W0o68V0GkN+pJsI18ZMM8nyQre6FbOPpspegOOMioM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2021-06-28 23:13:55 +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;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ moni ];
|
2024-02-29 20:09:43 +00:00
|
|
|
broken = (lib.versionAtLeast kernel.version "6.8") || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|