Merge pull request #139564 from r-burns/firestarter
firestarter: don't reference nvidia_x11 directly
This commit is contained in:
commit
93c2859bfc
1 changed files with 19 additions and 3 deletions
|
@ -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; {
|
||||
|
|
Loading…
Reference in a new issue