# Turn the llama.cpp ExternalProject download into a no-op.
#
# We prestage the pinned llama.cpp tarball and symlink it into
# _deps/llama_cpp-src in src_configure, so the sub-build must not clone it.
# Leaving the download disabled (rather than pointing FetchContent at our tree
# via FETCHCONTENT_SOURCE_DIR_LLAMA_CPP) keeps upstream's own compat-patch step
# (apply-patch.cmake over llama/compat/**) active, so we no longer re-apply
# that set by hand. Adopted from ::gentoo sci-ml/ollama (tupone@gentoo.org).

--- a/cmake/local.cmake.old	2026-07-04 11:21:56.571755428 +0200
+++ b/cmake/local.cmake	2026-07-04 11:22:30.948410723 +0200
@@ -124,7 +124,7 @@
     else()
         set(OLLAMA_LLAMA_CPP_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/llama_cpp-src")
         ExternalProject_Add(ollama-llama-cpp-source
-            GIT_REPOSITORY "https://github.com/ggml-org/llama.cpp.git"
+            DOWNLOAD_COMMAND true
             GIT_TAG ${OLLAMA_LLAMA_CPP_GIT_TAG}
             GIT_SHALLOW TRUE
             SOURCE_DIR ${OLLAMA_LLAMA_CPP_SOURCE_DIR}
