aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/claude-code/Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/claude-code/Makefile b/misc/claude-code/Makefile
index 827b652a5dd5..83e12ce4d0b4 100644
--- a/misc/claude-code/Makefile
+++ b/misc/claude-code/Makefile
@@ -1,5 +1,6 @@
PORTNAME= claude-code
DISTVERSION= 2.1.90
+PORTREVISION= 1
CATEGORIES= misc # machine-learning
MAINTAINER= yuri@FreeBSD.org
@@ -20,6 +21,8 @@ PACKAGE_NAME= @anthropic-ai/claude-code
FETCH_SCRIPT= ${PORTSDIR}/Tools/scripts/npmjs-fetch-with-dependencies.sh
+CLI_JS= ${WRKSRC}/node_modules/${PACKAGE_NAME}/cli.js
+
do-fetch:
@if ! [ -f ${DISTDIR}/${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} ]; then \
${SETENV} TMPDIR=${WRKDIR} LOCALBASE=${LOCALBASE} ${FETCH_SCRIPT} \
@@ -28,6 +31,14 @@ do-fetch:
${DISTDIR}/${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}; \
fi
+# Raise API and MCP transport timeouts to 24 hours for slow (e.g. CPU-based) servers
+post-extract:
+ ${REINPLACE_CMD} \
+ -e 's/var EP5=60000;/var EP5=86400000;/' \
+ -e 's/API_TIMEOUT_MS||String(600000)/API_TIMEOUT_MS||String(86400000)/' \
+ -e 's/DEFAULT_TIMEOUT=600000;/DEFAULT_TIMEOUT=86400000;/' \
+ ${CLI_JS}
+
do-install:
# install files
@${MKDIR} ${STAGEDIR}${PREFIX}/lib