depot/third_party/nixpkgs/pkgs/os-specific/linux/rtl8821au/default.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

46 lines
1.4 KiB
Nix

{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
stdenv.mkDerivation rec {
pname = "rtl8821au";
version = "${kernel.version}-unstable-2022-03-08";
src = fetchFromGitHub {
owner = "morrownr";
repo = "8821au-20210708";
rev = "2c0c6fef81c0c7dcf8fa06fc4ab72168abc4f7bb";
sha256 = "sha256-Hdzi3pGqH71O0Jenjd/myG4+rZDLC/CcWHkjDoXBxS0=";
};
nativeBuildInputs = [ bc nukeReferences ];
buildInputs = kernel.moduleBuildDependencies;
hardeningDisable = [ "pic" "format" ];
NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types";
prePatch = ''
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/"
'';
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 = "rtl8821AU and rtl8812AU chipset driver with firmware";
homepage = "https://github.com/morrownr/8821au";
license = licenses.gpl2Only;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = with maintainers; [ plchldr ];
};
}