2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc }:
|
2020-06-04 15:47:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rtl8821cu-${kernel.version}-${version}";
|
2020-12-21 22:14:00 +00:00
|
|
|
version = "unstable-2020-12-21";
|
2020-06-04 15:47:20 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "brektrou";
|
|
|
|
repo = "rtl8821cu";
|
2020-12-21 22:14:00 +00:00
|
|
|
rev = "428a0820487418ec69c0edb91726d1cf19763b1e";
|
|
|
|
sha256 = "1ccl94727yq7gzn37ky91k0736cambgnkaa37r2f2hinpl9qdd8q";
|
2020-06-04 15:47:20 +01: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-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-04 15:47:20 +01:00
|
|
|
description = "Realtek rtl8821cu driver";
|
|
|
|
homepage = "https://github.com/brektrou/rtl8821CU";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.contrun ];
|
|
|
|
};
|
|
|
|
}
|