firestarter: don't reference nvidia_x11 directly
It should instead be picked up at runtime from /run/opengl-driver/lib, via addOpenGLRunpath
This commit is contained in:
parent
90ce428218
commit
b5e86fa700
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