diff options
| author | happysalada <raphael@megzari.com> | 2024-01-19 08:42:56 -0500 |
|---|---|---|
| committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2024-02-12 05:49:07 +0100 |
| commit | 9368c936f7a73e1591a846e533faab610ba94e45 (patch) | |
| tree | 1e8af756d10712eac9db2b12224ba6d539e18723 | |
| parent | llama-cpp: 1742 -> 1848 (diff) | |
| download | nixpkgs-9368c936f7a73e1591a846e533faab610ba94e45.tar.gz | |
llama-cpp: 1848->1892; add static build mode
(cherry picked from commit aaa2d4b7387c3965d2a8c9060257a51ef13da163)
| -rw-r--r-- | pkgs/by-name/ll/llama-cpp/package.nix | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix index 379673740aee..637fbc3435cc 100644 --- a/pkgs/by-name/ll/llama-cpp/package.nix +++ b/pkgs/by-name/ll/llama-cpp/package.nix @@ -19,6 +19,8 @@ , openblas , pkg-config , metalSupport ? stdenv.isDarwin && stdenv.isAarch64 && !openclSupport +, patchelf +, static ? true # if false will build the shared objects as well }: let @@ -29,13 +31,13 @@ let in effectiveStdenv.mkDerivation (finalAttrs: { pname = "llama-cpp"; - version = "1848"; + version = "1892"; src = fetchFromGitHub { owner = "ggerganov"; repo = "llama.cpp"; rev = "refs/tags/b${finalAttrs.version}"; - hash = "sha256-KuomiKU9c06Ux/ZcqctFdPQykGtjDzArN+tElPJVQ60="; + hash = "sha256-FNyl8bR0rg6cixcqidqzk9rG62+CI/0BNvzHuUkBq1E="; }; postPatch = '' @@ -105,15 +107,26 @@ effectiveStdenv.mkDerivation (finalAttrs: { ++ lib.optionals blasSupport [ "-DLLAMA_BLAS=ON" "-DLLAMA_BLAS_VENDOR=OpenBLAS" + ] + ++ lib.optionals (!static) [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) ]; installPhase = '' runHook preInstall mkdir -p $out/bin + ${lib.optionalString (!static) '' + mkdir $out/lib + cp libggml_shared.so $out/lib + cp libllama.so $out/lib + ''} for f in bin/*; do test -x "$f" || continue + ${lib.optionalString (!static) '' + ${patchelf}/bin/patchelf "$f" --set-rpath "$out/lib" + ''} cp "$f" $out/bin/llama-cpp-"$(basename "$f")" done |
