commit: 37a82f079673495978990b23dc721dd36fa0abb8 Author: Jay Faulkner <jayf <AT> gentoo <DOT> org> AuthorDate: Tue Aug 26 15:19:06 2025 +0000 Commit: Jay Faulkner <jayf <AT> gentoo <DOT> org> CommitDate: Tue Aug 26 15:20:15 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37a82f07
dev-util/claude-code: add 1.0.92 Fixes issue with claude being unable to find the gentoo-managed ripgrep. Bug: https://bugs.gentoo.org/962002 Signed-off-by: Jay Faulkner <jayf <AT> gentoo.org> dev-util/claude-code/Manifest | 1 + dev-util/claude-code/claude-code-1.0.92.ebuild | 75 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/dev-util/claude-code/Manifest b/dev-util/claude-code/Manifest index 57e556c4bb4c..3cb4bcb83f89 100644 --- a/dev-util/claude-code/Manifest +++ b/dev-util/claude-code/Manifest @@ -1 +1,2 @@ DIST claude-code-1.0.90.tgz 35984624 BLAKE2B f0261cf439f6ee1f1a596112cc4d863456b2bedc693cc68273fd4cee68db24eae2524f24b1f5b66fd767f2d1eddecd3fdbe0b83aa7467436776380faf8ee567e SHA512 c1a0bb182e1f9dfca21551534bb128e0c012fe2118a7233aec96455ebf81d3b6ce923058b41a9787befe67f6ed73223c371bd4b699c54b4479157914fed282c2 +DIST claude-code-1.0.92.tgz 35962494 BLAKE2B 2e1f8a8ab2c92213580a5248be7a6add7d2af3595fc9bed6fe9b0fdfbc823902f3f5e68a0d940785f255f77c66fd143dfeb6c3fa493402c029d7fdadddf88fb2 SHA512 fd7bb026a02f5f02067fd59e64ec4723aa90b001b3c61ad173787241dbf05ba714e62be24e6af159ab24b0f6c932f16de8a42801453a5c7b3bf17c98981a4e5d diff --git a/dev-util/claude-code/claude-code-1.0.92.ebuild b/dev-util/claude-code/claude-code-1.0.92.ebuild new file mode 100644 index 000000000000..27407ebe66d5 --- /dev/null +++ b/dev-util/claude-code/claude-code-1.0.92.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Claude Code - an agentic coding tool by Anthropic" +HOMEPAGE="https://www.anthropic.com/claude-code" +SRC_URI="https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${PV}.tgz" +S="${WORKDIR}/package" + +# NOTE(JayF): claude-code is only usable via paid subscription and has a +# clickthrough EULA-type license. Please see $HOMEPAGE for +# full details. +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="amd64" + +IUSE="jetbrains vscode" +RESTRICT="bindist strip" + +RDEPEND=" + >=net-libs/nodejs-18 + sys-apps/ripgrep +" + +src_compile() { + # Skip, nothing to compile here. + : +} + +src_install() { + dodoc README.md LICENSE.md + + # We are using a strategy of "install everything that's left" + # so removing these here will prevent duplicates in /opt/claude-code + rm -f README.md LICENSE.md package.json || die + # remove vendored ripgrep + rm -rf vendor/ripgrep || die + + # Install extentions these under /opt, and let users configure their + # IDEs appropriately if they have opted-into having them installed. + # Normally I wouldn't allow a few megs of data to be USE-flag-toggled, + # but removing these cuts the already-small package size in half, so + # it seems worth it. + use jetbrains || rm -r vendor/${PN}-jetbrains-plugin || die + use vscode || rm -r vendor/${PN}.vsix || die + + insinto /opt/${PN} + doins -r ./* + fperms a+x opt/claude-code/cli.js + + dodir /opt/bin + dosym -r /opt/${PN}/cli.js /opt/bin/claude + + # https://bugs.gentoo.org/962002 indicates that Claude doesn't use + # path to find the `rg` binary. Gross. So we symlink it into the place + # they expect it to be. Thanks to Leo Douglas for the patch. + if use amd64; then + dodir /opt/${PN}/vendor/ripgrep/x64-linux + dosym -r /usr/bin/rg /opt/${PN}/vendor/ripgrep/x64-linux/rg + elif use arm64; then + dodir /opt/{$PN}/vendor/ripgrep/arm64-linux + dosym -r /usr/bin/rg /opt/${PN}/vendor/ripgrep/arm64-linux/rg + fi + + insinto /etc/${PN} + doins "${FILESDIR}/policies.json" + + # nodejs defaults to disabling deprecation warnings when running code + # from any path containing a node_modules directory. Since we're installing + # outside of the realm of npm, explicitly pass an option to disable + # deprecation warnings so it behaves the same as it does if installed via + # npm. It's proprietary; not like Gentoo users can fix the warnings anyway. + sed -i 's/env node/env -S node --no-deprecation/' "${ED}/opt/claude-code/cli.js" +}
