nixpkgs/pkgs/os-specific/linux/rtl8821ce/default.nix
Ivar Scholten 2cf54b92dd linuxPackages.rtl8821ce: unstable-2021-11-19 -> unstable-2022-06-01
This unbreaks the build for kernel 5.18
2022-06-27 22:54:33 +02:00

47 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, kernel
, bc
}:
stdenv.mkDerivation rec {
pname = "rtl8821ce";
version = "${kernel.version}-unstable-2022-06-01";
src = fetchFromGitHub {
owner = "tomaspinho";
repo = "rtl8821ce";
rev = "be733dc86781c68571650b395dd0fa6b53c0a039";
sha256 = "sha256-4PgISOjCSSGymz96VwE4jzcUiOEO+Ocuk2kJVIA+TQM=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags;
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/"
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Realtek rtl8821ce driver";
homepage = "https://github.com/tomaspinho/rtl8821ce";
license = licenses.gpl2Only;
platforms = platforms.linux;
broken = stdenv.isAarch64;
maintainers = with maintainers; [ hhm ivar ];
};
}