2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc }:
|
2021-05-19 06:50:13 +00:00
|
|
|
|
2020-06-04 14:47:20 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-19 06:50:13 +00:00
|
|
|
pname = "rtl8821cu";
|
2021-11-06 11:25:57 +00:00
|
|
|
version = "${kernel.version}-unstable-2021-10-21";
|
2020-06-04 14:47:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-19 06:50:13 +00:00
|
|
|
owner = "morrownr";
|
|
|
|
repo = "8821cu";
|
2021-11-06 11:25:57 +00:00
|
|
|
rev = "4e2d84c5e70245f850877f355e8bf293f252f61c";
|
|
|
|
sha256 = "1j32psvfgzfs5b1pdff6xk76iz7j8scakji6zm3vgqb2ssbxx1k1";
|
2020-06-04 14:47:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2022-02-10 02:55:00 +00:00
|
|
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags;
|
2020-06-04 14:47:20 +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-08-30 10:48:37 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-04 14:47:20 +00:00
|
|
|
description = "Realtek rtl8821cu driver";
|
2021-05-19 06:50:13 +00:00
|
|
|
homepage = "https://github.com/morrownr/8821cu";
|
|
|
|
license = licenses.gpl2Only;
|
2020-06-04 14:47:20 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.contrun ];
|
|
|
|
};
|
|
|
|
}
|