2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc }:
|
2021-05-19 08:50:13 +02:00
|
|
|
|
2020-06-04 16:47:20 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-19 08:50:13 +02:00
|
|
|
pname = "rtl8821cu";
|
|
|
|
version = "${kernel.version}-unstable-2021-05-19";
|
2020-06-04 16:47:20 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-19 08:50:13 +02:00
|
|
|
owner = "morrownr";
|
|
|
|
repo = "8821cu";
|
|
|
|
rev = "2430c354c9b15fa6193a263c99ce57211d50c66f";
|
|
|
|
sha256 = "sha256-PkrpwebZYh/hBukqDQf6pxfbkVyA+CpYtte5pmzgLtw=";
|
2020-06-04 16:47:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bc ];
|
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
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 12:48:37 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-06-04 16:47:20 +02:00
|
|
|
description = "Realtek rtl8821cu driver";
|
2021-05-19 08:50:13 +02:00
|
|
|
homepage = "https://github.com/morrownr/8821cu";
|
|
|
|
license = licenses.gpl2Only;
|
2020-06-04 16:47:20 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.contrun ];
|
|
|
|
};
|
|
|
|
}
|