whisper-cpp: Ensure that backend dir is set

If this field is not set, then the backend search path consists of the
executable directory, and the current working directory. This works fine
for executables that are bundled with whisper-cpp, but fails for
anything that links against the library, e.g. ffmpeg.

If there are no backends available other than CPU, this causes a crash.

Implementation of the search path behaviour is here https://github.com/ggml-org/whisper.cpp/blob/d9b7613b34a343848af572cc14467fc5e82fc788/ggml/src/ggml-backend-reg.cpp#L522-L531
This commit is contained in:
Tim Quelch
2025-11-14 23:50:57 +11:00
parent 53005e4181
commit 11a096e967
+1
View File
@@ -125,6 +125,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
++ optionals (effectiveStdenv.hostPlatform.isx86 && !effectiveStdenv.hostPlatform.isStatic) [
(cmakeBool "GGML_BACKEND_DL" true)
(cmakeBool "GGML_CPU_ALL_VARIANTS" true)
(cmakeFeature "GGML_BACKEND_DIR" "${placeholder "out"}/lib")
]
++ optionals cudaSupport [
(cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)