linuxPackages.*: Drop unneeded NIX_CFLAGS_COMPILE usage (#484933)

This commit is contained in:
Alyssa Ross
2026-01-29 14:37:29 +00:00
committed by GitHub
4 changed files with 41 additions and 53 deletions
@@ -22,9 +22,6 @@ stdenv.mkDerivation {
sed 's/depmod /true /' -i Makefile
'';
# Fix build on Linux kernel >= 5.18
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-fallthrough" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernelModuleMakeFlags ++ [
@@ -21,8 +21,6 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "pic" ];
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
makeFlags = kernelModuleMakeFlags ++ [
"KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"INSTALL_MOD_PATH=${placeholder "out"}"
+41 -46
View File
@@ -10,55 +10,50 @@
broken ? false,
}:
stdenv.mkDerivation (
{
pname = "nvidia-open";
version = "${kernel.version}-${nvidia_x11.version}";
stdenv.mkDerivation {
pname = "nvidia-open";
version = "${kernel.version}-${nvidia_x11.version}";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "open-gpu-kernel-modules";
rev = nvidia_x11.version;
inherit hash;
};
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "open-gpu-kernel-modules";
rev = nvidia_x11.version;
inherit hash;
};
inherit patches;
inherit patches;
nativeBuildInputs = kernel.moduleBuildDependencies;
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags =
kernelModuleMakeFlags
++ [
"IGNORE_PREEMPT_RT_PRESENCE=1"
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
"DATE="
"TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
]
++ lib.optionals stdenv.cc.isClang [
"C_INCLUDE_PATH=${lib.getLib stdenv.cc.cc}/lib/clang/${lib.versions.major stdenv.cc.cc.version}/include"
];
makeFlags =
kernelModuleMakeFlags
++ [
"IGNORE_PREEMPT_RT_PRESENCE=1"
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
"MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
"DATE="
"TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
]
++ lib.optionals stdenv.cc.isClang [
"C_INCLUDE_PATH=${lib.getLib stdenv.cc.cc}/lib/clang/${lib.versions.major stdenv.cc.cc.version}/include"
];
installTargets = [ "modules_install" ];
enableParallelBuilding = true;
installTargets = [ "modules_install" ];
enableParallelBuilding = true;
meta = {
description = "NVIDIA Linux Open GPU Kernel Module";
homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules";
license = with lib.licenses; [
gpl2Plus
mit
];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with lib.maintainers; [ nickcao ];
inherit broken;
};
}
// lib.optionalAttrs stdenv.hostPlatform.isAarch64 {
env.NIX_CFLAGS_COMPILE = "-fno-stack-protector";
}
)
meta = {
description = "NVIDIA Linux Open GPU Kernel Module";
homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules";
license = with lib.licenses; [
gpl2Plus
mit
];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with lib.maintainers; [ nickcao ];
inherit broken;
};
}
@@ -22,8 +22,6 @@ stdenv.mkDerivation {
hardeningDisable = [ "pic" ];
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
prePatch = ''
substituteInPlace ./Makefile \
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \