Files
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

66 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
kernel,
bc,
nukeReferences,
}:
stdenv.mkDerivation {
pname = "rtl8812au";
version = "${kernel.version}-unstable-2024-06-13";
src = fetchFromGitHub {
owner = "morrownr";
repo = "8812au-20210820";
rev = "c0efee9cd121d9f0c815d9771475f76339a8f7d3";
hash = "sha256-ZS0iUb77XnXR5BUMeQ1EDuly7hStRt430ECueFW4v4w=";
};
nativeBuildInputs = [
bc
nukeReferences
]
++ kernel.moduleBuildDependencies;
hardeningDisable = [
"pic"
"format"
];
prePatch = ''
substituteInPlace ./Makefile \
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
--replace /sbin/depmod \# \
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
makeFlags = [
"ARCH=${stdenv.hostPlatform.linuxArch}"
("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"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
'';
enableParallelBuilding = true;
meta = {
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
homepage = "https://github.com/morrownr/8812au-20210820";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ moni ];
broken = kernel.kernelOlder "5.10" || kernel.kernelAtLeast "6.15";
};
}