2022-01-25 03:21:06 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, kernel, bc, nukeReferences }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rtl8189es-${kernel.version}-${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "2021-10-01";
|
2022-01-25 03:21:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jwrdegoede";
|
|
|
|
repo = "rtl8189ES_linux";
|
2022-03-30 09:31:56 +00:00
|
|
|
rev = "be378f47055da1bae42ff6ec1d62f1a5052ef097";
|
|
|
|
sha256 = "sha256-+19q1Xux2BjquavY+s0UDzTubEt6BEUZ9XVDVmj36us=";
|
2022-01-25 03:21:06 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
|
2022-01-25 03:21:06 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "pic" "format" ];
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace ./Makefile --replace /lib/modules/ "${kernel.dev}/lib/modules/"
|
|
|
|
substituteInPlace ./Makefile --replace '$(shell uname -r)' "${kernel.modDirVersion}"
|
|
|
|
substituteInPlace ./Makefile --replace /sbin/depmod \#
|
|
|
|
substituteInPlace ./Makefile --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2022-01-25 03:21:06 +00:00
|
|
|
"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"))
|
|
|
|
];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Driver for Realtek rtl8189es";
|
|
|
|
homepage = "https://github.com/jwrdegoede/rtl8189ES_linux";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ danielfullmer lheckemann ];
|
2022-03-30 09:31:56 +00:00
|
|
|
broken = kernel.kernelAtLeast "5.17";
|
2022-01-25 03:21:06 +00:00
|
|
|
};
|
|
|
|
}
|