Files
gentoo-zh/app-misc/qwen-code/qwen-code-0.29.4.ebuild
Zakk 8fbf0a5d24 app-misc/qwen-code: add 0.29.4, drop 0.29.3
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Zakk <zakk@gentoozh.org>
2026-12-05 22:23:36 +11:00

47 lines
1.5 KiB
Bash

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=9
DESCRIPTION="An open-source AI agent that lives in your terminal"
HOMEPAGE="https://github.com/QwenLM/qwen-code"
SRC_URI="https://registry.npmjs.org/@qwen-code/${PN}/-/${P}.tgz"
S="${WORKDIR}/package"
LICENSE="Apache-2.0 BSD ISC MIT || ( Apache-2.0 MPL-2.0 ) || ( MIT Unlicense )"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
QA_PREBUILT="
usr/lib*/node_modules/@qwen-code/${PN}/vendor/ripgrep/*-linux/rg
usr/lib*/node_modules/@qwen-code/${PN}/vendor/landlock-run/*-linux/qwen-landlock-run
usr/lib*/node_modules/@qwen-code/${PN}/vendor/session-scan/*-linux/qwen-session-scan
usr/lib*/node_modules/@qwen-code/${PN}/opentui-assets/@opentui/core-linux-*/libopentui.so
"
RDEPEND="
>=net-libs/nodejs-22
amd64? ( >=sys-libs/glibc-2.32 )
arm64? ( >=sys-libs/glibc-2.34 )
"
src_prepare() {
default
local other=arm64
use arm64 && other=x64
rm -r vendor/ripgrep/*-{darwin,win32} vendor/session-scan/*-darwin \
vendor/{ripgrep,landlock-run,session-scan}/${other}-linux \
opentui-assets/@opentui/core-{darwin-*,linux-${other}} || die
}
src_install() {
local dir=/usr/$(get_libdir)/node_modules/@qwen-code/${PN}
local arch=x64
use arm64 && arch=arm64
insinto "${dir}"
doins -r .
fperms +x "${dir}"/{cli-entry.js,vendor/{ripgrep/${arch}-linux/rg,landlock-run/${arch}-linux/qwen-landlock-run,session-scan/${arch}-linux/qwen-session-scan}}
dosym -r "${dir}/cli-entry.js" /usr/bin/qwen
}