git: 327791f0f0a8 - main - misc/claude-code: update 2.1.224 → 2.1.225

Yuri Victorovich <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by yuri:

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

commit 327791f0f0a8a13f312dddca531864db479e0e43
Author:     Devin Teske <[email protected]>
AuthorDate: 2026-08-08 04:17:43 +0000
Commit:     Yuri Victorovich <[email protected]>
CommitDate: 2026-08-08 05:12:49 +0000

    misc/claude-code: update 2.1.224 → 2.1.225
    
    Also:
    * Replace the generated wrapper with files/claude.in: require linrdlnk on
      fdescfs, disable the binary's self-updater, and launch via bash
      --noprofile --norc so shell-detection does not drain stdin and collapse
      the TUI into --print mode.
    * add LICENSE (Proprietary)
    * add pkg-message
    
    Differential Revision:  https://reviews.freebsd.org/D58716
---
 misc/claude-code/Makefile        | 26 ++++++++++++-------------
 misc/claude-code/distinfo        | 10 +++++-----
 misc/claude-code/files/LICENSE   |  1 +
 misc/claude-code/files/claude.in | 41 ++++++++++++++++++++++++++++++++++++++++
 misc/claude-code/pkg-message     | 18 ++++++++++++++++++
 5 files changed, 78 insertions(+), 18 deletions(-)

diff --git a/misc/claude-code/Makefile b/misc/claude-code/Makefile
index 3c6e126c73b9..ac2063656036 100644
--- a/misc/claude-code/Makefile
+++ b/misc/claude-code/Makefile
@@ -1,26 +1,35 @@
 PORTNAME=	claude-code
-DISTVERSION=	2.1.224
+DISTVERSION=	2.1.225
 CATEGORIES=	misc # machine-learning
 MASTER_SITES=	https://downloads.claude.ai/claude-code-releases/${DISTVERSION}/:amd64 \
 		https://downloads.claude.ai/claude-code-releases/${DISTVERSION}/:aarch64
 DISTFILES=	linux-x64/claude:amd64 \
 		linux-arm64/claude:aarch64
 DIST_SUBDIR=	${PORTNAME}-${DISTVERSION}
+EXTRACT_ONLY=
 
 MAINTAINER=	[email protected]
 COMMENT=	Agentic coding tool from Anthropic that lives in your terminal
 WWW=		https://github.com/anthropics/claude-code
 
+LICENSE=	Proprietary
+LICENSE_NAME=	Anthropic Proprietary License
+LICENSE_FILE=	${FILESDIR}/LICENSE
+LICENSE_PERMS=	dist-mirror pkg-mirror auto-accept
+
 ONLY_FOR_ARCHS=		aarch64 amd64
 ONLY_FOR_ARCHS_REASON=	is a Linux binary with a limited platform support
 
+RUN_DEPENDS=	bash:shells/bash
+
 USES=		linux:rl9
 USE_LINUX=	base
 
+STRIP=		# elftoolchain strip fails on these Linux binaries
 NO_BUILD=	yes
+SUB_FILES=	claude
+
 NO_WRKSUBDIR=	yes
-EXTRACT_ONLY=
-STRIP=		# elftoolchain strip fails on these Linux binaries
 
 PLIST_FILES=	bin/claude \
 		libexec/claude
@@ -48,15 +57,6 @@ do-install:
 	${INSTALL_PROGRAM} \
 		${DISTDIR}/${DIST_SUBDIR}/${CC_PLATFORM}/claude \
 		${STAGEDIR}${PREFIX}/libexec/claude
-	# create a wrapper script in the bin directory to check that /compat/linux/proc is mounted and then call the binary in libexec
-	( \
-		${ECHO}	"#!/bin/sh"; \
-		${ECHO}	"if [ ! -d /compat/linux/proc ]; then"; \
-		${ECHO}	"  echo 'Error: /compat/linux/proc is not mounted. Please run \"sudo mount -t linprocfs linprocfs /compat/linux/proc\" to mount it.'"; \
-		${ECHO}	"  exit 1"; \
-		${ECHO}	"fi"; \
-		${ECHO}	"exec ${PREFIX}/libexec/claude \"\$$@\"" \
-	) > ${STAGEDIR}${PREFIX}/bin/claude
-	${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/claude
+	${INSTALL_SCRIPT} ${WRKDIR}/claude ${STAGEDIR}${PREFIX}/bin/claude
 
 .include <bsd.port.post.mk>
diff --git a/misc/claude-code/distinfo b/misc/claude-code/distinfo
index 35905d779098..d009ac3ef0db 100644
--- a/misc/claude-code/distinfo
+++ b/misc/claude-code/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1786085613
-SHA256 (claude-code-2.1.224/linux-x64/claude) = a2b5add7dc4bcd8eaa029f4e8bdac4df7769b4073698db7989d206baf9419c2d
-SIZE (claude-code-2.1.224/linux-x64/claude) = 295676936
-SHA256 (claude-code-2.1.224/linux-arm64/claude) = 3e50836e227868746273653e0f8115cf5fc9cb34a081847c6040c81d80812c33
-SIZE (claude-code-2.1.224/linux-arm64/claude) = 292404152
+TIMESTAMP = 1786162396
+SHA256 (claude-code-2.1.225/linux-x64/claude) = 0a3be8d18cb0f5357d38ce2d588601753a60b44cc9c622579ed8b8405dee231e
+SIZE (claude-code-2.1.225/linux-x64/claude) = 297831432
+SHA256 (claude-code-2.1.225/linux-arm64/claude) = 209d4279c0a3dbb48bee6017d99430269ec6aba59cd8735b1fda0f9664139a45
+SIZE (claude-code-2.1.225/linux-arm64/claude) = 294566840
diff --git a/misc/claude-code/files/LICENSE b/misc/claude-code/files/LICENSE
new file mode 100644
index 000000000000..645a5d67c6d1
--- /dev/null
+++ b/misc/claude-code/files/LICENSE
@@ -0,0 +1 @@
+© Anthropic PBC. All rights reserved. Use is subject to Anthropic's [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms).
diff --git a/misc/claude-code/files/claude.in b/misc/claude-code/files/claude.in
new file mode 100644
index 000000000000..43a942e006b5
--- /dev/null
+++ b/misc/claude-code/files/claude.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# FreeBSD ports wrapper for Anthropic Claude Code (Linux ELF via Linuxulator)
+#
+
+export DISABLE_AUTOUPDATER=1
+export DISABLE_UPDATES=1
+
+#
+# Required Linuxulator mounts. Without linrdlnk on fdescfs, Bun resolves cwd
+# via open(path, O_PATH) + readlink("/dev/fd/N"), gets EINVAL, and hangs.
+# service linux start mounts these correctly; hand-rolled fstab often does not.
+#
+if [ ! -e /compat/linux/proc/version ]; then
+	echo "claude: error: linprocfs is not mounted on /compat/linux/proc" >&2
+	echo "claude: enable with: sysrc linux_enable=YES && service linux start" >&2
+	exit 1
+fi
+if [ ! -d /compat/linux/dev/fd ]; then
+	echo "claude: error: fdescfs is not mounted on /compat/linux/dev/fd" >&2
+	echo "claude: enable with: sysrc linux_enable=YES && service linux start" >&2
+	exit 1
+fi
+if ! [ -L /compat/linux/dev/fd/2 ]; then
+	echo "claude: error: fdescfs must be mounted with linrdlnk (claude will hang otherwise)" >&2
+	echo "claude: /etc/fstab: fdescfs /compat/linux/dev/fd fdescfs rw,linrdlnk 0 0" >&2
+	echo "claude: then: umount /compat/linux/dev/fd && mount /compat/linux/dev/fd" >&2
+	echo "claude: (or: sysrc linux_enable=YES && service linux start)" >&2
+	exit 1
+fi
+
+#
+# Bake-in of:
+#   alias claude='SHELL=/usr/local/bin/bash bash --noprofile --norc -c claude'
+#
+# Claude's shell-detection child inherits stdin; bash startup files that read
+# fd 0 make the TUI fall through to --print mode (anthropics/claude-code#12507).
+# Launch from a clean bash; keep SHELL=bash for the tool runner.
+#
+export SHELL=%%LOCALBASE%%/bin/bash
+exec %%LOCALBASE%%/bin/bash --noprofile --norc -c 'exec "$@"' bash %%PREFIX%%/libexec/claude "$@"
diff --git a/misc/claude-code/pkg-message b/misc/claude-code/pkg-message
new file mode 100644
index 000000000000..8be99501b098
--- /dev/null
+++ b/misc/claude-code/pkg-message
@@ -0,0 +1,18 @@
+[
+{ type: install
+  message: <<EOM
+claude is a closed-source Linux binary that runs under the Linuxulator.
+
+One-time host setup:
+
+  # pkg install linux_base-rl9
+  # sysrc linux_enable=YES
+  # service linux start
+
+service linux mounts the required filesystems, including fdescfs with
+linrdlnk. Without linrdlnk, claude hangs silently at startup.
+
+Self-update is disabled (DISABLE_AUTOUPDATER); upgrade via ports/pkg.
+EOM
+}
+]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.