vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / os-specific / linux / rtl8852au / default.nix
blob97ac0c75b17e19ac685271f9ca8d7335b81485c9
1 { lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "rtl8852au";
5   version = "${kernel.version}-unstable-2024-05-06";
7   src = fetchFromGitHub {
8     owner = "lwfinger";
9     repo = "rtl8852au";
10     rev = "865ab0fa91471d595c283d2f3db323f7f15455f5";
11     hash = "sha256-c2dpnZS6a0waL1khB9ZEglTwJIBsyRebTMig1B4A0xU=";
12   };
14   nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
15   hardeningDisable = [ "pic" "format" ];
17   postPatch = ''
18     substituteInPlace ./Makefile \
19       --replace-fail /sbin/depmod \# \
20       --replace-fail '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" \
21       --replace-fail '/usr/lib/systemd/system-sleep' "$out/usr/lib/systemd/system-sleep"
22     substituteInPlace ./platform/i386_pc.mk \
23       --replace-fail /lib/modules "${kernel.dev}/lib/modules"
24   '';
26   makeFlags = [
27     "ARCH=${stdenv.hostPlatform.linuxArch}"
28     ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
29     ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
30   ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
31     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
32   ];
34   preInstall = ''
35     mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
36     mkdir -p "$out/usr/lib/systemd/system-sleep"
37   '';
39   postInstall = ''
40     nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
41   '';
43   enableParallelBuilding = true;
45   meta = with lib; {
46     description = "Driver for Realtek 802.11ac, rtl8852au, provides the 8852au mod";
47     homepage = "https://github.com/lwfinger/rtl8852au";
48     license = licenses.gpl2Only;
49     platforms = platforms.linux;
50     maintainers = with maintainers; [ lonyelon ];
51   };