2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "rtl8812au";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "${kernel.version}-unstable-2022-08-22";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-09-09 14:08:57 +00:00
|
|
|
owner = "morrownr";
|
|
|
|
repo = "8812au-20210629";
|
|
|
|
rev = "7aa0e0c74551b4e4f319f4b54e00ccbfe588b7ce";
|
|
|
|
sha256 = "sha256-BHC1DpWHv/1UvSfj6S5fo/ODZ1VDgLQO2A9EC+BR1JE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bc nukeReferences ];
|
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
hardeningDisable = [ "pic" "format" ];
|
|
|
|
|
|
|
|
prePatch = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
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/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"ARCH=${stdenv.hostPlatform.linuxArch}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
2021-12-06 16:07:01 +00:00
|
|
|
("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
|
2022-08-12 12:06:08 +00:00
|
|
|
("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2020-04-24 23:36:52 +00:00
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://github.com/morrownr/8812au-20210629";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|