2021-05-21 00:33:08 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel }:
|
2020-05-28 17:33:25 +01:00
|
|
|
|
2021-05-21 00:33:08 +01:00
|
|
|
let
|
|
|
|
rev = "3a64331a1c809bbbc21eca63b825970f213ec5ac";
|
|
|
|
in
|
2020-05-28 17:33:25 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-21 00:33:08 +01:00
|
|
|
pname = "rtl88xxau-aircrack";
|
|
|
|
version = "${kernel.version}-${builtins.substring 0 6 rev}";
|
2020-05-28 17:33:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aircrack-ng";
|
|
|
|
repo = "rtl8812au";
|
|
|
|
inherit rev;
|
2021-05-21 00:33:08 +01:00
|
|
|
sha256 = "sha256-goaN80imfCeUwiHokJd10CFKskE3iL5BO/xOQk6PtHE=";
|
2020-05-28 17:33:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types";
|
|
|
|
|
2021-05-21 00:33:08 +01:00
|
|
|
# Fix build for 5.12 kernels
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aircrack-ng/rtl8812au/commit/9b4c60a89c2a55f36454b950a86246b6b86a9681.patch";
|
|
|
|
sha256 = "sha256-HPhTLstqAePF3H6WeM9Fu4/8UjNL+9xl4L8xq3NOWuM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-05-28 17:33:25 +01:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
|
|
|
|
--replace '$(shell uname -r)' "${kernel.modDirVersion}" \
|
|
|
|
--replace /sbin/depmod \# \
|
|
|
|
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-28 17:33:25 +01:00
|
|
|
description = "Aircrack-ng kernel module for Realtek 88XXau network cards\n(8811au, 8812au, 8814au and 8821au chipsets) with monitor mode and injection support.";
|
|
|
|
homepage = "https://github.com/aircrack-ng/rtl8812au";
|
2021-05-21 00:33:08 +01:00
|
|
|
license = licenses.gpl2Only;
|
2020-05-28 17:33:25 +01:00
|
|
|
maintainers = [ maintainers.jethro ];
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
};
|
|
|
|
}
|