mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
2a6b15d371
* Add aarch64-linux binary packages * add cross-compilation support to open-package Signed-off-by: Mika Tammi <mika.tammi@unikie.com>
47 lines
1.2 KiB
Nix
47 lines
1.2 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, kernel
|
|
, nvidia_x11
|
|
, hash
|
|
, broken ? false
|
|
}:
|
|
|
|
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;
|
|
};
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags ++ [
|
|
"SYSSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
|
|
"SYSOUT=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
"MODLIB=$(out)/lib/modules/${kernel.modDirVersion}"
|
|
{
|
|
aarch64-linux = "TARGET_ARCH=aarch64";
|
|
x86_64-linux = "TARGET_ARCH=x86_64";
|
|
}.${stdenv.hostPlatform.system}
|
|
];
|
|
|
|
installTargets = [ "modules_install" ];
|
|
enableParallelBuilding = true;
|
|
|
|
meta = with lib; {
|
|
description = "NVIDIA Linux Open GPU Kernel Module";
|
|
homepage = "https://github.com/NVIDIA/open-gpu-kernel-modules";
|
|
license = with licenses; [ gpl2Plus mit ];
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
maintainers = with maintainers; [ nickcao ];
|
|
inherit broken;
|
|
};
|
|
} // lib.optionalAttrs stdenv.hostPlatform.isAarch64 {
|
|
env.NIX_CFLAGS_COMPILE = "-fno-stack-protector";
|
|
})
|