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:
Ryan Burns 2021-09-26 12:48:56 -07:00
parent 90ce428218
commit b5e86fa700

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; {