git: bf82d1732770 - main - misc/grok-build: New port: CLI for xAI Grok AI platform

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 24 Jun 2026 16:57:07 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bf82d17327704ee02bb1c91859d85c65eae42465

commit bf82d17327704ee02bb1c91859d85c65eae42465
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-06-24 16:56:52 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-06-24 16:57:04 +0000

    misc/grok-build: New port: CLI for xAI Grok AI platform
---
 misc/Makefile               |  1 +
 misc/grok-build/Makefile    | 54 +++++++++++++++++++++++++++++++++++++++++++++
 misc/grok-build/distinfo    |  5 +++++
 misc/grok-build/pkg-descr   |  4 ++++
 misc/grok-build/pkg-message | 14 ++++++++++++
 5 files changed, 78 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index ea9f3e9a970a..2c27fbe05739 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -200,6 +200,7 @@
     SUBDIR += granulate
     SUBDIR += grc
     SUBDIR += grizzly
+    SUBDIR += grok-build
     SUBDIR += grok-cli
     SUBDIR += gwhich
     SUBDIR += hashcards
diff --git a/misc/grok-build/Makefile b/misc/grok-build/Makefile
new file mode 100644
index 000000000000..d402033c350d
--- /dev/null
+++ b/misc/grok-build/Makefile
@@ -0,0 +1,54 @@
+PORTNAME=	grok-build
+DISTVERSION=	0.2.64
+CATEGORIES=	misc # machine-learning
+MASTER_SITES=	${GROK_URL_BASE:S|$|:amd64|} \
+		${GROK_URL_BASE:S|$|:aarch64|}
+DISTFILES=	grok-${DISTVERSION}-linux-x86_64:amd64 \
+		grok-${DISTVERSION}-linux-aarch64:aarch64
+DIST_SUBDIR=	${PORTNAME}-${DISTVERSION}
+EXTRACT_ONLY=
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	CLI for xAI Grok AI platform
+WWW=		https://x.ai/
+
+ONLY_FOR_ARCHS=		aarch64 amd64
+ONLY_FOR_ARCHS_REASON=	is a Linux binary with a limited platform support
+
+USES=		linux:rl9
+USE_LINUX=	base
+
+GROK_URL_BASE=	https://x.ai/cli/ \
+		https://storage.googleapis.com/grok-build-public-artifacts/cli/
+
+NO_BUILD=	yes
+NO_WRKSUBDIR=	yes
+
+PLIST_FILES=	bin/agent \
+		bin/grok
+
+find-new-version:
+	@TAB=$$(printf '\t'); \
+	new_ver=$$(fetch -q -o - https://x.ai/cli/stable 2>/dev/null || \
+		fetch -q -o - https://storage.googleapis.com/grok-build-public-artifacts/cli/stable); \
+	current_ver=$$(make -V DISTVERSION); \
+	if [ "$$new_ver" != "$$current_ver" ] && [ -n "$$new_ver" ]; then \
+		${SED} -i '' "s/^DISTVERSION=.*/DISTVERSION=$${TAB}$$new_ver/" ${.CURDIR}/Makefile; \
+		echo "=> New version available: $$current_ver -> $$new_ver"; \
+	else \
+		echo "=> No new version available (current: $$current_ver)"; \
+	fi
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == aarch64
+GROK_DISTFILE=	grok-${DISTVERSION}-linux-aarch64
+.else
+GROK_DISTFILE=	grok-${DISTVERSION}-linux-x86_64
+.endif
+
+do-install:
+	${INSTALL_PROGRAM} ${DISTDIR}/${DIST_SUBDIR}/${GROK_DISTFILE} ${STAGEDIR}${PREFIX}/bin/grok
+	${LN} -s grok ${STAGEDIR}${PREFIX}/bin/agent
+
+.include <bsd.port.post.mk>
diff --git a/misc/grok-build/distinfo b/misc/grok-build/distinfo
new file mode 100644
index 000000000000..fab3ff4dc86d
--- /dev/null
+++ b/misc/grok-build/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1782312824
+SHA256 (grok-build-0.2.64/grok-0.2.64-linux-x86_64) = c72dc9e43c5021ed7bba0816051b55d0acb83e5a54a3c95732f9e38fdc8f53e6
+SIZE (grok-build-0.2.64/grok-0.2.64-linux-x86_64) = 151810216
+SHA256 (grok-build-0.2.64/grok-0.2.64-linux-aarch64) = 68f5cf337a4994ac4ff759b0e2c2923043c0584ad5fdf20411c05717b65eee25
+SIZE (grok-build-0.2.64/grok-0.2.64-linux-aarch64) = 124197936
diff --git a/misc/grok-build/pkg-descr b/misc/grok-build/pkg-descr
new file mode 100644
index 000000000000..71133e98d05d
--- /dev/null
+++ b/misc/grok-build/pkg-descr
@@ -0,0 +1,4 @@
+Grok Build CLI is a command-line tool 'grok' (also symlinked as 'agent') for
+interacting with the xAI Grok AI platform.
+
+grok is a closed source Linux binary working through Linuxlator.
diff --git a/misc/grok-build/pkg-message b/misc/grok-build/pkg-message
new file mode 100644
index 000000000000..66133e4f2f60
--- /dev/null
+++ b/misc/grok-build/pkg-message
@@ -0,0 +1,14 @@
+[
+{ type: install
+  message: <<EOM
+You installed Grok Build CLI: xAI's Grok CLI.
+
+The binary 'grok' (and its symlink 'agent') can be used to interact
+with the xAI Grok AI platform.
+
+Run 'grok login' to authenticate, or set GROK_DEPLOYMENT_KEY in your
+environment for deployment key authentication.
+
+EOM
+}
+]