git: 5d6220269250 - main - misc/ollama: update 0.30.0 → 0.30.4
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 04 Jun 2026 08:42:17 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=5d6220269250fa28f2f9af1398c50485650df931
commit 5d6220269250fa28f2f9af1398c50485650df931
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-06-04 06:43:14 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-06-04 08:41:59 +0000
misc/ollama: update 0.30.0 → 0.30.4
---
misc/ollama/Makefile | 10 +-
misc/ollama/distinfo | 26 ++---
misc/ollama/files/llm_freebsd.go | 5 +
misc/ollama/files/patch-discover_cpu__freebsd.go | 136 ++++++++++++-----------
misc/ollama/files/update-port.sh | 4 +-
5 files changed, 98 insertions(+), 83 deletions(-)
diff --git a/misc/ollama/Makefile b/misc/ollama/Makefile
index 5f6d6beb902d..f5233c2a4630 100644
--- a/misc/ollama/Makefile
+++ b/misc/ollama/Makefile
@@ -1,7 +1,6 @@
PORTNAME= ollama
DISTVERSIONPREFIX= v
-DISTVERSION= 0.30.0
-PORTREVISION= 1
+DISTVERSION= 0.30.4
CATEGORIES= misc # machine-learning
MAINTAINER= yuri@FreeBSD.org
@@ -28,7 +27,7 @@ GO_MODULE= github.com/yurivict/${PORTNAME} # fork with FreeBSD patches
GO_TARGET= .
GO_ENV+= CGO_CXXFLAGS="${CXXFLAGS}"
-LLAMA_CPP_VERSION= b9452
+LLAMA_CPP_VERSION= b9493
GGML_SO_VERSION= 0.13.1 # tied to LLAMA_CPP_VERSION; update when llama.cpp changes
MLX_CORE_VERSION= 0.31.2
MLX_C_VERSION= fba4470b89073180056c9ea46c443051375f7399
@@ -121,6 +120,11 @@ post-patch:
# Apply llama.cpp compat hooks patch so the llama-server build has Ollama hooks
@${PATCH} -d ${WRKDIR}/llama.cpp-${LLAMA_CPP_VERSION} -p1 \
< ${WRKSRC}/llama/compat/llama-cpp-hooks.patch
+ # Apply llama.cpp laguna model patch (adds llama_model_laguna class)
+ @${PATCH} -d ${WRKDIR}/llama.cpp-${LLAMA_CPP_VERSION} -p1 \
+ < ${WRKSRC}/llama/compat/models/llama-cpp-laguna.patch
+ # FreeBSD: copy llm/llm_freebsd.go for LlamaServerSysProcAttr
+ @${CP} ${FILESDIR}/llm_freebsd.go ${WRKSRC}/llm/
# update version in version.go
@${REINPLACE_CMD} -e 's|var Version string = "0.0.0"|var Version string = "${PORTVERSION}"|g' \
${WRKSRC}/version/version.go
diff --git a/misc/ollama/distinfo b/misc/ollama/distinfo
index 8168065c92e3..3a35ffbe81cc 100644
--- a/misc/ollama/distinfo
+++ b/misc/ollama/distinfo
@@ -1,13 +1,13 @@
-TIMESTAMP = 1780435135
-SHA256 (go/misc_ollama/ollama-v0.30.0/b9452.tar.gz) = 43830a2cb08975d732e3538fa2130105dd528cf929387cc82b2526acdf4c689b
-SIZE (go/misc_ollama/ollama-v0.30.0/b9452.tar.gz) = 33997105
-SHA256 (go/misc_ollama/ollama-v0.30.0/v0.31.2.tar.gz) = bdb9b619f80962dd00c0bffb65e59c53f565c2b550f189a1467f8bc6089401ab
-SIZE (go/misc_ollama/ollama-v0.30.0/v0.31.2.tar.gz) = 4251596
-SHA256 (go/misc_ollama/ollama-v0.30.0/fba4470b89073180056c9ea46c443051375f7399.tar.gz) = 398d3d4c6458679dfc9061a3ba56101358279790bc038f60d1f534eac420d552
-SIZE (go/misc_ollama/ollama-v0.30.0/fba4470b89073180056c9ea46c443051375f7399.tar.gz) = 174039
-SHA256 (go/misc_ollama/ollama-v0.30.0/json.tar.xz) = d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d
-SIZE (go/misc_ollama/ollama-v0.30.0/json.tar.xz) = 110988
-SHA256 (go/misc_ollama/ollama-v0.30.0/v0.30.0.mod) = 1ae536080fb858f852587eb80ce6444999da8700d05736083d4a5d689ce25861
-SIZE (go/misc_ollama/ollama-v0.30.0/v0.30.0.mod) = 4735
-SHA256 (go/misc_ollama/ollama-v0.30.0/v0.30.0.zip) = dda68a74098bb98351bc02ba5a2d9945dc5947de2becf73acf7975a4c4542156
-SIZE (go/misc_ollama/ollama-v0.30.0/v0.30.0.zip) = 28395257
+TIMESTAMP = 1780542796
+SHA256 (go/misc_ollama/ollama-v0.30.4/b9493.tar.gz) = d8992bab7a2b6f73132c5edc332b3cd3d0b49ea9b3c85cede4c55f7439f422ff
+SIZE (go/misc_ollama/ollama-v0.30.4/b9493.tar.gz) = 34051227
+SHA256 (go/misc_ollama/ollama-v0.30.4/v0.31.2.tar.gz) = bdb9b619f80962dd00c0bffb65e59c53f565c2b550f189a1467f8bc6089401ab
+SIZE (go/misc_ollama/ollama-v0.30.4/v0.31.2.tar.gz) = 4251596
+SHA256 (go/misc_ollama/ollama-v0.30.4/fba4470b89073180056c9ea46c443051375f7399.tar.gz) = 398d3d4c6458679dfc9061a3ba56101358279790bc038f60d1f534eac420d552
+SIZE (go/misc_ollama/ollama-v0.30.4/fba4470b89073180056c9ea46c443051375f7399.tar.gz) = 174039
+SHA256 (go/misc_ollama/ollama-v0.30.4/json.tar.xz) = d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d
+SIZE (go/misc_ollama/ollama-v0.30.4/json.tar.xz) = 110988
+SHA256 (go/misc_ollama/ollama-v0.30.4/v0.30.4.mod) = 8af0b8b8e4961b46dfef05b055207b1ab7e7831368c1704a5a5bfb4626d6895d
+SIZE (go/misc_ollama/ollama-v0.30.4/v0.30.4.mod) = 4650
+SHA256 (go/misc_ollama/ollama-v0.30.4/v0.30.4.zip) = 7a18320a92212be01a378408733313d8949292cb80d0b2131f34c12fd4fbb52d
+SIZE (go/misc_ollama/ollama-v0.30.4/v0.30.4.zip) = 28422656
diff --git a/misc/ollama/files/llm_freebsd.go b/misc/ollama/files/llm_freebsd.go
new file mode 100644
index 000000000000..de3c5bdf479c
--- /dev/null
+++ b/misc/ollama/files/llm_freebsd.go
@@ -0,0 +1,5 @@
+package llm
+
+import "syscall"
+
+var LlamaServerSysProcAttr = &syscall.SysProcAttr{}
diff --git a/misc/ollama/files/patch-discover_cpu__freebsd.go b/misc/ollama/files/patch-discover_cpu__freebsd.go
index d898b22e0538..5726f0068a5d 100644
--- a/misc/ollama/files/patch-discover_cpu__freebsd.go
+++ b/misc/ollama/files/patch-discover_cpu__freebsd.go
@@ -1,69 +1,75 @@
-- Remove GetCPUDetails() which references an undefined CPU struct type, and
-- the unused "strings" import. GetCPUDetails() is not called anywhere in the
-- codebase and the CPU type does not exist in 0.30.0.
---- discover/cpu_freebsd.go.orig 2026-06-02 21:48:58 UTC
+--- discover/cpu_freebsd.go.orig 2026-06-04 02:55:00 UTC
+++ discover/cpu_freebsd.go
-@@ -9,7 +9,6 @@ import (
-
- import (
- "log/slog"
-- "strings"
- "syscall"
- "unsafe"
- )
-@@ -68,55 +67,3 @@ func GetCPUMem() (memInfo, error) {
- return mem, nil
- }
-
--func GetCPUDetails() []CPU {
-- var cpus []CPU
--
-- // Get CPU model name - this is a string
-- modelName, err := syscall.Sysctl("hw.model")
-- if err != nil {
-- slog.Warn("failed to get CPU model", "error", err)
-- modelName = "Unknown"
-- }
--
-- // Get number of physical cores - this is a 32-bit integer
-- cores32, err := syscall.SysctlUint32("kern.smp.cores")
-- if err != nil {
-- slog.Warn("failed to get CPU cores", "error", err)
-- return nil
-- }
-- cores := int(cores32)
--
-- // Get number of logical CPUs (threads) - this is a 32-bit integer
-- threads32, err := syscall.SysctlUint32("hw.ncpu")
-- if err != nil {
-- slog.Warn("failed to get CPU threads", "error", err)
-- return nil
-- }
-- threads := int(threads32)
--
-- // Extract vendor ID from model name if possible
-- vendorID := ""
-- modelNameLower := strings.ToLower(modelName)
-- if strings.Contains(modelNameLower, "intel") {
-- vendorID = "GenuineIntel"
-- } else if strings.Contains(modelNameLower, "amd") {
-- vendorID = "AuthenticAMD"
-- }
--
-- // For FreeBSD, we assume a single socket for now
-- // In the future, this could be enhanced to detect multi-socket systems
-- cpu := CPU{
-- ID: "0",
-- VendorID: vendorID,
-- ModelName: strings.TrimSpace(modelName),
-- CoreCount: cores,
-- EfficiencyCoreCount: 0, // FreeBSD doesn't distinguish efficiency cores
-- ThreadCount: threads,
-- }
--
-- cpus = append(cpus, cpu)
--
-- slog.Debug("GetCPUDetails", "cpus", cpus)
--
-- return cpus
--}
+@@ -0,0 +1,69 @@
++package discover
++
++/*
++#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/sysctl.h>
++*/
++import "C"
++
++import (
++ "log/slog"
++ "syscall"
++ "unsafe"
++)
++
++func sysctlUint64(name string) (uint64, error) {
++ cname := C.CString(name)
++ defer C.free(unsafe.Pointer(cname))
++
++ var value C.uint64_t
++ size := C.size_t(unsafe.Sizeof(value))
++
++ ret := C.sysctlbyname(cname, unsafe.Pointer(&value), &size, nil, 0)
++ if ret != 0 {
++ return 0, syscall.Errno(ret)
++ }
++
++ return uint64(value), nil
++}
++
++func GetCPUMem() (memInfo, error) {
++ var mem memInfo
++
++ // Get page size - this is a 32-bit value
++ pageSize32, err := syscall.SysctlUint32("vm.stats.vm.v_page_size")
++ if err != nil {
++ return mem, err
++ }
++ pageSize := uint64(pageSize32)
++
++ // Get physical memory - use sysctlUint64
++ physmem, err := sysctlUint64("hw.physmem")
++ if err != nil {
++ return mem, err
++ }
++
++ // Get free page count - this is also a 32-bit value
++ freeCount32, err := syscall.SysctlUint32("vm.stats.vm.v_free_count")
++ if err != nil {
++ return mem, err
++ }
++ freeCount := uint64(freeCount32)
++
++ // Get swap total - use sysctlUint64
++ swapTotal, err := sysctlUint64("vm.swap_total")
++ if err != nil {
++ // Swap may not be configured, default to 0
++ swapTotal = 0
++ }
++
++ mem.TotalMemory = physmem
++ mem.FreeMemory = freeCount * pageSize
++ mem.FreeSwap = swapTotal
++
++ slog.Debug("GetCPUMem", "total_memory", mem.TotalMemory, "free_memory", mem.FreeMemory, "free_swap", mem.FreeSwap)
++
++ return mem, nil
++}
++
diff --git a/misc/ollama/files/update-port.sh b/misc/ollama/files/update-port.sh
index 49e8b41863a5..08167ba85954 100755
--- a/misc/ollama/files/update-port.sh
+++ b/misc/ollama/files/update-port.sh
@@ -49,8 +49,8 @@ cp -r \
../$GH_ACCOUNT_ORIG-$GH_PROJECT.repo/.golangci.yaml \
.
-# apply freebsd compatibility patch
-(patch-no-backup-1 < ../files/freebsd-compatibility.patch) || { echo "error: failed to apply freebsd compatibility patch"; exit 1; }
+## apply freebsd compatibility patch
+#(patch-no-backup-1 < ../files/freebsd-compatibility.patch) || { echo "error: failed to apply freebsd compatibility patch"; exit 1; }
# change import path to the fork
grep -rl ollama/ollama | xargs sed -i '' -e 's|ollama/ollama|yurivict/ollama|g'