2019-09-23 17:51:56 +01:00
|
|
|
{ stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
|
2015-09-03 10:52:17 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rtl8812au-${kernel.version}-${version}";
|
2019-09-10 15:12:35 +01:00
|
|
|
version = "5.2.20.2_28373.20190903";
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2015-09-03 10:52:17 +01:00
|
|
|
src = fetchFromGitHub {
|
2018-02-11 02:05:39 +00:00
|
|
|
owner = "zebulon2";
|
|
|
|
repo = "rtl8812au-driver-5.2.20";
|
2019-09-10 15:12:35 +01:00
|
|
|
rev = "30d47a0a3f43ccb19e8fd59fe93d74a955147bf2";
|
|
|
|
sha256 = "1fy0f8ihxd0i5kr8gmky8v8xl0ns6bhxfdn64c97c5irzdvg37sr";
|
2015-09-03 10:52:17 +01:00
|
|
|
};
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2019-09-23 17:51:56 +01:00
|
|
|
nativeBuildInputs = [ bc nukeReferences ];
|
2017-12-31 07:12:54 +00:00
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2018-02-11 02:05:39 +00:00
|
|
|
hardeningDisable = [ "pic" "format" ];
|
2016-08-13 12:20:12 +01:00
|
|
|
|
2017-08-10 03:47:53 +01:00
|
|
|
prePatch = ''
|
2015-09-03 10:52:17 +01:00
|
|
|
substituteInPlace ./Makefile --replace /lib/modules/ "${kernel.dev}/lib/modules/"
|
|
|
|
substituteInPlace ./Makefile --replace '$(shell uname -r)' "${kernel.modDirVersion}"
|
2017-08-12 04:31:08 +01:00
|
|
|
substituteInPlace ./Makefile --replace /sbin/depmod \#
|
2015-09-03 10:52:17 +01:00
|
|
|
substituteInPlace ./Makefile --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2020-01-05 03:48:37 +00:00
|
|
|
makeFlags = [
|
|
|
|
"ARCH=${stdenv.hostPlatform.platform.kernelArch}"
|
|
|
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
|
|
|
|
("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
|
|
|
|
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
];
|
|
|
|
|
2015-09-03 10:52:17 +01:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
2016-02-12 02:51:04 +00:00
|
|
|
|
2019-09-23 17:51:56 +01:00
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
2018-02-11 02:05:39 +00:00
|
|
|
meta = with stdenv.lib; {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
|
2018-02-11 02:05:39 +00:00
|
|
|
homepage = https://github.com/zebulon2/rtl8812au-driver-5.2.20;
|
|
|
|
license = licenses.gpl2;
|
2020-01-05 03:48:37 +00:00
|
|
|
platforms = platforms.linux;
|
2018-02-11 02:05:39 +00:00
|
|
|
maintainers = with maintainers; [ danielfullmer ];
|
2015-09-03 10:52:17 +01:00
|
|
|
};
|
2016-02-12 02:51:04 +00:00
|
|
|
}
|