local-ai: use makeLibraryPath for LD_LIBRARY_PATH

This commit is contained in:
Christian Kögler 2024-04-07 21:52:54 +02:00
parent c354244181
commit 28358e396b

View File

@ -1,6 +1,7 @@
{ config { config
, stdenv , stdenv
, lib , lib
, addDriverRunpath
, fetchpatch , fetchpatch
, fetchFromGitHub , fetchFromGitHub
, protobuf , protobuf
@ -472,19 +473,19 @@ let
# patching rpath with patchelf doens't work. The execuable # patching rpath with patchelf doens't work. The execuable
# raises an segmentation fault # raises an segmentation fault
postFixup = '' postFixup =
wrapProgram $out/bin/${pname} \ let
'' + lib.optionalString with_cublas '' LD_LIBRARY_PATH = [ ]
--prefix LD_LIBRARY_PATH : "${lib.getLib libcublas}/lib:${cuda_cudart}/lib:/run/opengl-driver/lib" \ ++ lib.optionals with_cublas [ (lib.getLib libcublas) cuda_cudart addDriverRunpath.driverLink ]
'' + lib.optionalString with_clblas '' ++ lib.optionals with_clblas [ clblast ocl-icd ]
--prefix LD_LIBRARY_PATH : "${clblast}/lib:${ocl-icd}/lib" \ ++ lib.optionals with_openblas [ openblas ]
'' + lib.optionalString with_openblas '' ++ lib.optionals with_tts [ piper-phonemize ];
--prefix LD_LIBRARY_PATH : "${openblas}/lib" \ in
'' + lib.optionalString with_tts '' ''
--prefix LD_LIBRARY_PATH : "${piper-phonemize}/lib" \ wrapProgram $out/bin/${pname} \
'' + '' --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath LD_LIBRARY_PATH}" \
--prefix PATH : "${ffmpeg}/bin" --prefix PATH : "${ffmpeg}/bin"
''; '';
passthru.local-packages = { passthru.local-packages = {
inherit inherit