2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
|
2015-09-03 09:52:17 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-08 12:05:53 +00:00
|
|
|
pname = "rtl8812au";
|
2023-05-19 21:33:30 +00:00
|
|
|
version = "${kernel.version}-unstable-2023-05-11";
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2015-09-03 09:52:17 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-07-20 06:04:30 +00:00
|
|
|
owner = "morrownr";
|
|
|
|
repo = "8812au-20210629";
|
2023-05-19 21:33:30 +00:00
|
|
|
rev = "765d4e4bd5970f4c1c79e63bbe301667e5e029c9";
|
|
|
|
hash = "sha256-FF2LVfOpITMJ5LiwsGAudrWStlkKsZUlHvzZs03gb9g=";
|
2015-09-03 09:52:17 +00:00
|
|
|
};
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2023-01-13 19:21:40 +00:00
|
|
|
nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
|
2018-02-11 02:05:39 +00:00
|
|
|
hardeningDisable = [ "pic" "format" ];
|
2016-08-13 11:20:12 +00:00
|
|
|
|
2017-08-10 02:47:53 +00:00
|
|
|
prePatch = ''
|
2021-05-20 06:24:11 +00:00
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
|
|
|
|
--replace /sbin/depmod \# \
|
|
|
|
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
2015-09-03 09:52:17 +00:00
|
|
|
'';
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2020-01-05 03:48:37 +00:00
|
|
|
makeFlags = [
|
2021-01-23 01:33:55 +00:00
|
|
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
2021-11-21 01:50:41 +00:00
|
|
|
("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
|
2022-07-30 16:18:27 +00:00
|
|
|
("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
|
2022-10-06 16:38:53 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2020-01-05 03:48:37 +00:00
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
];
|
|
|
|
|
2015-09-03 09:52:17 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2019-09-23 16:51:56 +00:00
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
2021-08-30 10:45:06 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
|
2022-07-20 06:04:30 +00:00
|
|
|
homepage = "https://github.com/morrownr/8812au-20210629";
|
2021-05-08 12:05:53 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-01-05 03:48:37 +00:00
|
|
|
platforms = platforms.linux;
|
2021-05-20 06:24:11 +00:00
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
2015-09-03 09:52:17 +00:00
|
|
|
};
|
2016-02-12 02:51:04 +00:00
|
|
|
}
|