depot/third_party/nixpkgs/pkgs/os-specific/linux/rtl8723ds/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

46 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub, kernel, bc }:
stdenv.mkDerivation {
pname = "rtl8723ds";
version = "${kernel.version}-unstable-2022-10-20";
src = fetchFromGitHub {
owner = "lwfinger";
repo = "rtl8723ds";
rev = "912fdb30531bc8c071267a047e7df16feae7a865";
sha256 = "sha256-HhoCKrrRg1Q995sekQvzhaiqANeTP8pANItj2vLV+Cw=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = [ bc ];
buildInputs = kernel.moduleBuildDependencies;
makeFlags = [
"ARCH=${stdenv.hostPlatform.linuxArch}"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
postPatch = ''
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 = {
description = "Linux driver for RTL8723DS.";
homepage = "https://github.com/lwfinger/rtl8723ds";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ chuangzhu ];
};
}