Merge pull request #139564 from r-burns/firestarter

firestarter: don't reference nvidia_x11 directly
This commit is contained in:
Ryan Burns 2021-09-27 19:09:25 -07:00 committed by GitHub
commit 93c2859bfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, lib
, fetchFromGitHub
, fetchzip
, addOpenGLRunpath
, cmake
, glibc_multi
, glibc
@ -9,7 +10,6 @@
, pkg-config
, cudatoolkit
, withCuda ? false
, linuxPackages
}:
let
@ -60,13 +60,23 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake git pkg-config ];
nativeBuildInputs = [
cmake
git
pkg-config
] ++ lib.optionals withCuda [
addOpenGLRunpath
];
buildInputs = [ hwloc ] ++ (if withCuda then
[ glibc_multi cudatoolkit linuxPackages.nvidia_x11 ]
[ glibc_multi cudatoolkit ]
else
[ glibc.static ]);
NIX_LDFLAGS = lib.optionals withCuda [
"-L${cudatoolkit}/lib/stubs"
];
cmakeFlags = [
"-DFIRESTARTER_BUILD_HWLOC=OFF"
"-DCMAKE_C_COMPILER_WORKS=1"
@ -76,8 +86,14 @@ stdenv.mkDerivation rec {
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp src/FIRESTARTER${lib.optionalString withCuda "_CUDA"} $out/bin/
runHook postInstall
'';
postFixup = lib.optionalString withCuda ''
addOpenGLRunpath $out/bin/FIRESTARTER_CUDA
'';
meta = with lib; {