2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, kernel
|
|
|
|
, bc
|
|
|
|
}:
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "rtl8821ce";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "${kernel.version}-unstable-2023-01-01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tomaspinho";
|
|
|
|
repo = "rtl8821ce";
|
2023-02-09 11:40:11 +00:00
|
|
|
rev = "a3e2f7c1f91e92f2dc788e8fcd7f2986af3d19b6";
|
|
|
|
sha256 = "sha256-eR4iTkRMnhNEBrUEC+fKlwq3hezNC9mSAQ7D0Wwss/0=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
|
|
|
|
--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-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Realtek rtl8821ce driver";
|
|
|
|
homepage = "https://github.com/tomaspinho/rtl8821ce";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ hhm ivar ];
|
2022-09-09 14:08:57 +00:00
|
|
|
broken = stdenv.isAarch64 || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|