Files
gentoo-zh/app-misc/codex-auth/codex-auth-0.4.0.ebuild
T
Zakk 03cb73c207 app-misc/codex-auth: add 0.4.0, drop 0.3.1
0.4.0 sets minimum_zig_version to 0.17.0, so ZIG_SLOT moves to 0.17.
Its build.zig now strips the binary by default, so -Dstrip=false keeps
that to Portage.

The tests moved from src/main.zig to the build test step, so src_test
runs it: the CLI tests need their helpers under -Dcli-prefix because
DESTDIR moves the copy they build themselves, NO_COLOR overrides the
CLICOLOR_FORCE that ezig sets, and stdout goes through a pipe because
writeAccountsTable truncates to the terminal width.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-11-13 01:42:24 +11:00

40 lines
964 B
Bash

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ZIG_SLOT="0.17"
inherit zig
DESCRIPTION="Command-line tool for switching Codex accounts"
HOMEPAGE="https://github.com/Loongphy/codex-auth"
SRC_URI="https://github.com/Loongphy/codex-auth/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
RDEPEND="
>=net-libs/nodejs-22
"
DOCS=( README.md docs )
src_configure() {
local my_zbs_args=(
-Dstrip=false
)
zig_src_configure
}
src_test() {
# cli_integration_test and tui_pty_test run the CLI and test helpers from
# -Dcli-prefix, while zig_src_test would move their own install under DESTDIR
zig_src_compile test-helpers
# ezig sets CLICOLOR_FORCE, which colours the warnings the tests compare
local -x NO_COLOR=1
# writeAccountsTable truncates to the terminal width when stdout is a tty
zig_src_test -Dcli-prefix="${BUILD_DIR}/usr" > >(cat)
}