git: 5aa0e65825d7 - main - misc/ollama: update 0.17.7 → 0.18.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 14 Mar 2026 07:37:38 UTC
The branch main has been updated by yuri:
URL: https://cgit.FreeBSD.org/ports/commit/?id=5aa0e65825d78eff5754f8da1d87def867a878d9
commit 5aa0e65825d78eff5754f8da1d87def867a878d9
Author: Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-03-14 05:14:58 +0000
Commit: Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-03-14 07:37:32 +0000
misc/ollama: update 0.17.7 → 0.18.0
---
misc/ollama/Makefile | 39 +++++++++++++++++++++++++++++++++++----
misc/ollama/distinfo | 10 +++++-----
2 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/misc/ollama/Makefile b/misc/ollama/Makefile
index 92ccee958795..a2ac9b7b35e8 100644
--- a/misc/ollama/Makefile
+++ b/misc/ollama/Makefile
@@ -1,6 +1,6 @@
PORTNAME= ollama
DISTVERSIONPREFIX= v
-DISTVERSION= 0.17.7
+DISTVERSION= 0.18.0
CATEGORIES= misc # machine-learning
MAINTAINER= yuri@FreeBSD.org
@@ -22,11 +22,17 @@ GO_MODULE= github.com/yurivict/${PORTNAME} # fork with FreeBSD patches
GO_TARGET= .
GO_ENV+= CGO_CXXFLAGS="${CXXFLAGS}"
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MMLX}
+GO_BUILDFLAGS+= -tags mlx
+.endif
+
PLIST_FILES= bin/${PORTNAME} \
bin/ollama-limit-gpu-layers
OPTIONS_GROUP= BACKENDS
-OPTIONS_GROUP_BACKENDS= CPU VULKAN
+OPTIONS_GROUP_BACKENDS= CPU VULKAN MLX
OPTIONS_DEFAULT= CPU VULKAN
CPU_DESC= Build CPU backend shared libraries
@@ -45,7 +51,10 @@ VULKAN_BUILD_DEPENDS= glslc:graphics/shaderc \
VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader
VULKAN_PLIST_FILES= lib/ollama/libggml-vulkan.so
-.include <bsd.port.options.mk>
+MLX_DESC= Build MLX backend for image generation (CPU)
+MLX_PLIST_FILES= lib/ollama/libmlx.so \
+ lib/ollama/libmlxc.so
+MLX_CMAKE_ON= -DMLX_ENGINE:BOOL=ON
_CMAKE_FLAGS= -DCMAKE_BUILD_TYPE=Release -DGGML_BACKEND_DL=ON -DGGML_BACKEND_DIR=${PREFIX}/lib/ollama
@@ -64,7 +73,7 @@ pre-build-CPU-on:
${MAKE_CMD} ggml-cpu
pre-build-VULKAN-on:
-.if !${PORT_OPTIONS:MCPU}
+.if !${PORT_OPTIONS:MCPU} && !${PORT_OPTIONS:MMLX}
@${MKDIR} ${WRKSRC}/build && \
cd ${WRKSRC}/build && \
${CMAKE_BIN} ${_CMAKE_FLAGS} ..
@@ -72,6 +81,21 @@ pre-build-VULKAN-on:
@cd ${WRKSRC}/build && \
${MAKE_CMD} ggml-vulkan
+pre-build-MLX-on:
+.if !${PORT_OPTIONS:MCPU} && !${PORT_OPTIONS:MVULKAN}
+ @${MKDIR} ${WRKSRC}/build && \
+ cd ${WRKSRC}/build && \
+ ${CMAKE_BIN} ${_CMAKE_FLAGS} -DMLX_ENGINE:BOOL=ON ..
+.endif
+ # Patch MLX after it's fetched by CMake (FreeBSD compatibility fix)
+ @if [ -f ${WRKSRC}/build/_deps/mlx-src/mlx/distributed/ring/ring.cpp ]; then \
+ ${REINPLACE_CMD} -i '' -e '/^#include <fcntl.h>/a\\
+#include <netinet/in.h>' \
+ ${WRKSRC}/build/_deps/mlx-src/mlx/distributed/ring/ring.cpp; \
+ fi
+ @cd ${WRKSRC}/build && \
+ ${MAKE_CMD} mlx mlxc
+
post-install: # pending https://github.com/ollama/ollama/issues/6407
${INSTALL_SCRIPT} ${FILESDIR}/ollama-limit-gpu-layers ${STAGEDIR}${PREFIX}/bin
@@ -88,6 +112,13 @@ post-install-VULKAN-on:
${INSTALL_LIB} ${WRKSRC}/build/lib/ollama/libggml-vulkan.so \
${STAGEDIR}${PREFIX}/lib/ollama/
+post-install-MLX-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/ollama
+ ${INSTALL_LIB} ${WRKSRC}/build/lib/ollama/libmlx.so \
+ ${STAGEDIR}${PREFIX}/lib/ollama/
+ ${INSTALL_LIB} ${WRKSRC}/build/lib/ollama/libmlxc.so \
+ ${STAGEDIR}${PREFIX}/lib/ollama/
+
do-test:
@cd ${WRKSRC} && \
${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} test ./...
diff --git a/misc/ollama/distinfo b/misc/ollama/distinfo
index a9cb3d9ef11b..fd2e6f5f81c2 100644
--- a/misc/ollama/distinfo
+++ b/misc/ollama/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1773220298
-SHA256 (go/misc_ollama/ollama-v0.17.7/v0.17.7.mod) = e660ffa37ad33611a4c1248967204e578f07ada9941e63ffe6a6fe3e95ac5039
-SIZE (go/misc_ollama/ollama-v0.17.7/v0.17.7.mod) = 4757
-SHA256 (go/misc_ollama/ollama-v0.17.7/v0.17.7.zip) = 7af9768594e0428adc2d7169fc42a034c1388ed1ae2a0d4f6f4f940dd0620476
-SIZE (go/misc_ollama/ollama-v0.17.7/v0.17.7.zip) = 23379864
+TIMESTAMP = 1773459514
+SHA256 (go/misc_ollama/ollama-v0.18.0/v0.18.0.mod) = e660ffa37ad33611a4c1248967204e578f07ada9941e63ffe6a6fe3e95ac5039
+SIZE (go/misc_ollama/ollama-v0.18.0/v0.18.0.mod) = 4757
+SHA256 (go/misc_ollama/ollama-v0.18.0/v0.18.0.zip) = 87dcd0b0ed4f8e3a73b31a7853edb2bc8e27acbbaf5a1456f8fc59538ae2edf4
+SIZE (go/misc_ollama/ollama-v0.18.0/v0.18.0.zip) = 23447832