nixpkgs/pkgs/os-specific/linux/rtl8812au/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
2015-09-03 09:52:17 +00:00
stdenv.mkDerivation {
2021-05-08 12:05:53 +00:00
pname = "rtl8812au";
version = "${kernel.version}-unstable-2023-07-22";
2015-09-03 09:52:17 +00:00
src = fetchFromGitHub {
owner = "morrownr";
repo = "8812au-20210629";
rev = "b5f4e6e894eca8fea38661e2fc22a2570e0274ad";
hash = "sha256-3uPowesJVh/cnagMz/Uadb+U5rDUAWfU39tZaDNCoqg=";
2015-09-03 09:52:17 +00:00
};
nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [ "pic" "format" ];
2016-08-13 11:20:12 +00:00
prePatch = ''
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
'';
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}"
];
2015-09-03 09:52:17 +00:00
preInstall = ''
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
postInstall = ''
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
homepage = "https://github.com/morrownr/8812au-20210629";
2021-05-08 12:05:53 +00:00
license = licenses.gpl2Only;
platforms = platforms.linux;
2023-11-17 10:03:27 +00:00
maintainers = with maintainers; [ moni ];
2015-09-03 09:52:17 +00:00
};
}