llama-cpp: 3887 -> 4154

This commit is contained in:
Lan Tian 2024-11-24 23:42:23 -08:00
parent 0f9abba69d
commit f0d9bf64cd
No known key found for this signature in database
GPG Key ID: 04E66B6B25A0862B

View File

@ -69,13 +69,13 @@ let
in
effectiveStdenv.mkDerivation (finalAttrs: {
pname = "llama-cpp";
version = "3887";
version = "4154";
src = fetchFromGitHub {
owner = "ggerganov";
repo = "llama.cpp";
rev = "refs/tags/b${finalAttrs.version}";
hash = "sha256-uyZ/uyuLzXAeZ8TQK8e6+zf+ZTFRSJJ1Doqw8Cd10+A=";
hash = "sha256-rttgk8mF9s3R53+TN5+PdDtkTG5cohn/9wz9Z5gRpdM=";
leaveDotGit = true;
postFetch = ''
git -C "$out" rev-parse --short HEAD > $out/COMMIT
@ -84,8 +84,16 @@ effectiveStdenv.mkDerivation (finalAttrs: {
};
postPatch = ''
substituteInPlace ./ggml/src/ggml-metal.m \
--replace-fail '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
# Workaround for local-ai package which overrides this package to an older llama-cpp
if [ -f ./ggml/src/ggml-metal.m ]; then
substituteInPlace ./ggml/src/ggml-metal.m \
--replace-fail '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
fi
if [ -f ./ggml/src/ggml-metal/ggml-metal.m ]; then
substituteInPlace ./ggml/src/ggml-metal/ggml-metal.m \
--replace-fail '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";"
fi
substituteInPlace ./scripts/build-info.sh \
--replace-fail 'build_number="0"' 'build_number="${finalAttrs.version}"' \
@ -160,7 +168,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
homepage = "https://github.com/ggerganov/llama.cpp/";
license = licenses.mit;
mainProgram = "llama";
maintainers = with maintainers; [ dit7ya elohmeier philiptaron ];
maintainers = with maintainers; [ dit7ya elohmeier philiptaron xddxdd ];
platforms = platforms.unix;
badPlatforms = optionals (cudaSupport || openclSupport) lib.platforms.darwin;
broken = (metalSupport && !effectiveStdenv.hostPlatform.isDarwin);