2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
|
2015-09-03 11:52:17 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rtl8812au-${kernel.version}-${version}";
|
2020-10-05 21:38:16 +02:00
|
|
|
version = "5.6.4.2_35491.20200702";
|
2016-02-12 03:51:04 +01:00
|
|
|
|
2015-09-03 11:52:17 +02:00
|
|
|
src = fetchFromGitHub {
|
2020-04-21 20:06:25 +02:00
|
|
|
owner = "gordboy";
|
|
|
|
repo = "rtl8812au-5.6.4.2";
|
2020-10-05 21:38:16 +02:00
|
|
|
rev = "3110ad65d0f03532bd97b1017cae67ca86dd34f6";
|
|
|
|
sha256 = "0p0cv67dfr41npxn0c1frr0k9wiv0pdbvlzlmclgixn39xc6n5qz";
|
2015-09-03 11:52:17 +02:00
|
|
|
};
|
2016-02-12 03:51:04 +01:00
|
|
|
|
2019-09-23 18:51:56 +02:00
|
|
|
nativeBuildInputs = [ bc nukeReferences ];
|
2017-12-31 08:12:54 +01:00
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2018-02-11 03:05:39 +01:00
|
|
|
hardeningDisable = [ "pic" "format" ];
|
2016-08-13 13:20:12 +02:00
|
|
|
|
2017-08-10 04:47:53 +02:00
|
|
|
prePatch = ''
|
2015-09-03 11:52:17 +02:00
|
|
|
substituteInPlace ./Makefile --replace /lib/modules/ "${kernel.dev}/lib/modules/"
|
|
|
|
substituteInPlace ./Makefile --replace '$(shell uname -r)' "${kernel.modDirVersion}"
|
2017-08-12 05:31:08 +02:00
|
|
|
substituteInPlace ./Makefile --replace /sbin/depmod \#
|
2015-09-03 11:52:17 +02:00
|
|
|
substituteInPlace ./Makefile --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
2016-02-12 03:51:04 +01:00
|
|
|
|
2020-01-05 04:48:37 +01: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"))
|
2021-01-15 15:45:37 +01:00
|
|
|
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
|
2020-01-05 04:48:37 +01:00
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
];
|
|
|
|
|
2015-09-03 11:52:17 +02:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
2016-02-12 03:51:04 +01:00
|
|
|
|
2019-09-23 18:51:56 +02:00
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-02-27 18:24:00 +01:00
|
|
|
description = "Driver for Realtek 802.11ac, rtl8812au, provides the 8812au mod";
|
2020-10-05 21:38:16 +02:00
|
|
|
homepage = "https://github.com/gordboy/rtl8812au-5.6.4.2";
|
2018-02-11 03:05:39 +01:00
|
|
|
license = licenses.gpl2;
|
2020-01-05 04:48:37 +01:00
|
|
|
platforms = platforms.linux;
|
2018-02-11 03:05:39 +01:00
|
|
|
maintainers = with maintainers; [ danielfullmer ];
|
2015-09-03 11:52:17 +02:00
|
|
|
};
|
2016-02-12 03:51:04 +01:00
|
|
|
}
|