Files
gentoo-zh/app-misc/claude-code/claude-code-1.0.85.ebuild
T
2025-08-20 08:29:44 +08:00

46 lines
1.2 KiB
Bash

# Copyright 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/-/${P}.tgz
"
S="${WORKDIR}"/package
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
RESTRICT="bindist mirror strip"
RDEPEND="
!dev-util/claude-code
net-libs/nodejs
sys-apps/ripgrep
"
src_install() {
rm -r -f sdk* vendor package.json || die
# 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/' cli.js
dodoc README.md LICENSE.md
insinto /opt/${PN}
doins -r ./*
fperms a+x opt/claude-code/cli.js
dodir /opt/${PN}
dosym -r /opt/${PN}/cli.js /opt/bin/claude
insinto /etc/${PN}
doins "${FILESDIR}/managed-settings.json"
}