commit:     4c15d8ccb15dbf406efdfda4048901c4e687d8c1
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Mon Apr  7 18:09:33 2025 +0000
Commit:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
CommitDate: Mon Apr  7 18:12:53 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4c15d8cc

sci-ml/ollama: filter flags in go file comments

Closes: https://bugs.gentoo.org/953049
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>

 sci-ml/ollama/ollama-0.6.3.ebuild | 4 ++++
 sci-ml/ollama/ollama-9999.ebuild  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/sci-ml/ollama/ollama-0.6.3.ebuild 
b/sci-ml/ollama/ollama-0.6.3.ebuild
index 9f07083dd..cf664c756 100644
--- a/sci-ml/ollama/ollama-0.6.3.ebuild
+++ b/sci-ml/ollama/ollama-0.6.3.ebuild
@@ -93,6 +93,10 @@ src_prepare() {
                -e "/PRE_INCLUDE_REGEXES.*hip/d" \
                -i CMakeLists.txt || die sed
 
+       sed \
+               -e "s/-O3/${CFLAGS}/g" \
+               -i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
+
        if use amd64; then
                if ! use cpu_flags_x86_avx; then
                        sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# 
/g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die

diff --git a/sci-ml/ollama/ollama-9999.ebuild b/sci-ml/ollama/ollama-9999.ebuild
index 7147e4cc8..6726a5970 100644
--- a/sci-ml/ollama/ollama-9999.ebuild
+++ b/sci-ml/ollama/ollama-9999.ebuild
@@ -93,6 +93,10 @@ src_prepare() {
                -e "/PRE_INCLUDE_REGEXES.*hip/d" \
                -i CMakeLists.txt || die sed
 
+       sed \
+               -e "s/-O3/${CFLAGS}/g" \
+               -i ml/backend/ggml/ggml/src/ggml-cpu/cpu.go || die sed
+
        if use amd64; then
                if ! use cpu_flags_x86_avx; then
                        sed -e "/ggml_add_cpu_backend_variant(sandybridge/s/^/# 
/g" -i ml/backend/ggml/ggml/src/CMakeLists.txt || die

Reply via email to