2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc }:
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "rtl8821cu";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "${kernel.version}-unstable-2022-05-07";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-20 23:08:51 +00:00
|
|
|
owner = "morrownr";
|
2022-03-30 09:31:56 +00:00
|
|
|
repo = "8821cu-20210118";
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "14aac4269afe5d21d1cc0032bdc1426128f83734";
|
|
|
|
hash = "sha256-TLakNRhHvYAbK0slKsFgSjqJdxVStzZhi1EEajmr7hg=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
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/"
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Realtek rtl8821cu driver";
|
2021-05-20 23:08:51 +00:00
|
|
|
homepage = "https://github.com/morrownr/8821cu";
|
|
|
|
license = licenses.gpl2Only;
|
2020-09-25 04:45:31 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.contrun ];
|
|
|
|
};
|
|
|
|
}
|