2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
|
2018-11-25 08:49:01 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-19 08:40:12 +00:00
|
|
|
pname = "rtl8821au";
|
2022-03-20 22:35:08 +00:00
|
|
|
version = "${kernel.version}-unstable-2022-03-08";
|
2018-11-25 08:49:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-19 08:40:12 +00:00
|
|
|
owner = "morrownr";
|
2021-11-06 11:36:26 +00:00
|
|
|
repo = "8821au-20210708";
|
2022-03-20 22:35:08 +00:00
|
|
|
rev = "2c0c6fef81c0c7dcf8fa06fc4ab72168abc4f7bb";
|
|
|
|
sha256 = "sha256-Hdzi3pGqH71O0Jenjd/myG4+rZDLC/CcWHkjDoXBxS0=";
|
2018-11-25 08:49:01 +00:00
|
|
|
};
|
|
|
|
|
2019-09-23 16:51:56 +00:00
|
|
|
nativeBuildInputs = [ bc nukeReferences ];
|
2018-11-25 08:49:01 +00:00
|
|
|
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/"
|
|
|
|
'';
|
|
|
|
|
2019-09-23 16:51:56 +00:00
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
2021-08-30 10:47:16 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-05-19 08:40:12 +00:00
|
|
|
description = "rtl8821AU and rtl8812AU chipset driver with firmware";
|
|
|
|
homepage = "https://github.com/morrownr/8821au";
|
|
|
|
license = licenses.gpl2Only;
|
2018-11-25 08:49:01 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
maintainers = with maintainers; [ plchldr ];
|
|
|
|
};
|
|
|
|
}
|