nixpkgs/pkgs/tools/misc/ollama/remove-git.patch
abysssol 828b4dc30e ollama: 0.1.17 -> 0.1.24
Remove outdated patches and substitution of llama.cpp server.

Patch source build script to remove git.
Ollama's `go generate` script assumes the source is an
initialized git repository, which it is not in nix.
So, remove usage of `git` and replace it with `patch`.
Also replace call to `g++` with `$CXX`.

Run `go generate` to build dependencies using
ollama's custom build script.
2024-02-16 16:23:25 -05:00

21 lines
681 B
Diff

--- a/llm/generate/gen_common.sh
+++ b/llm/generate/gen_common.sh
@@ -60,6 +60,9 @@
}
apply_patches() {
+ patch -i '@cmakeIncludePatch@' "${LLAMACPP_DIR}/examples/server/CMakeLists.txt"
+ return
+
# Wire up our CMakefile
if ! grep ollama ${LLAMACPP_DIR}/examples/server/CMakeLists.txt; then
echo 'include (../../../ext_server/CMakeLists.txt) # ollama' >>${LLAMACPP_DIR}/examples/server/CMakeLists.txt
@@ -113,6 +116,8 @@
# Keep the local tree clean after we're done with the build
cleanup() {
+ return
+
(cd ${LLAMACPP_DIR}/examples/server/ && git checkout CMakeLists.txt server.cpp)
if [ -n "$(ls -A ../patches/*.diff)" ]; then