repo/proj/guru:dev commit in: dev-util/codex/

"Rui Huang" <[email protected]>
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1786114083.77bc102dc57904f649df070451cbfc5149bdfdb7.vowstar@gentoo>
commit:     77bc102dc57904f649df070451cbfc5149bdfdb7
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Fri Aug  7 14:04:35 2026 +0000
Commit:     Rui Huang <vowstar <AT> gmail <DOT> com>
CommitDate: Fri Aug  7 14:48:03 2026 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=77bc102d

dev-util/codex: add 0.147.0

Signed-off-by: Huang Rui <vowstar <AT> gmail.com>

 dev-util/codex/Manifest             |   7 ++
 dev-util/codex/codex-0.147.0.ebuild | 147 ++++++++++++++++++++++++++++++++++++
 2 files changed, 154 insertions(+)

diff --git a/dev-util/codex/Manifest b/dev-util/codex/Manifest
index c842be10f7..a7ac06e3cc 100644
--- a/dev-util/codex/Manifest
+++ b/dev-util/codex/Manifest
@@ -1,8 +1,11 @@
 DIST codex-0.146.0.tar.gz 10291800 BLAKE2B e623b295e9b46302b5d6ae6f61737347d2fcf493db927ef53d183d4b7e469bb0beb390b378f5c6e704a1266798c0c05cc98cddb91e6d2eb0635501e5079c715c SHA512 47e56e17206b7ab40cbedf621b2f520c7535076281d97b4965d015aa7b18735b1ffdc53bed8236d63cedbbf0eb7db9b600700f85a8939c7f05e4d5e52f927c25
 DIST codex-0.146.1.tar.gz 10295330 BLAKE2B 38b8ec4fd4717bf408ae087be1c6da2d5834c5ecaa4d4116779d33cf009c846643238fa03629370a6a7bd112e12b87ffe74771596c77a055a5b580f2a7f0dcc5 SHA512 9e641991273249398a410c4941777f4eb0b96a1d50bd9dbae3a274aa852484a272df06aded15b3fe51831a1e4a313144e0985ddc0c2588b2c66d81f18f7f885d
+DIST codex-0.147.0.tar.gz 11175207 BLAKE2B 2ee63de67a78c48c00290e98391dab8f51e8a491b2d368762e1ddd1c26c5fea959d3c64301edd1cab0052c2ef4e2c2300b50c66b5672eb79d4d4ccc536b78522 SHA512 b7056515bf6d41c6059793f34ca259688a6db1d059e7a38b3a495e040188f5a9adccfc50a3e2fc42a6e3ba7428253de4aae496d55435020340f63e7bcbe2db0f
 DIST codex-rust-v0.146.0-crates.tar.xz 113136620 BLAKE2B 3a12e21d953c223cbb2115b42d04102a8f81c961b49c7be4ece584eacb38132b1094b36156b056ceecc48326683ab390167748991f06fccf010e8717f0bcff3b SHA512 a17cc1ff51c7e74bc7cfa73ad61e98550e5f6d5c055c33539d89ef683b0919c69b4f7e2f11138587af6b2d5df6d7ecbcf0b97ed8cb9606be52e638367e92cfce
 DIST codex-rust-v0.146.1-crates.tar.xz 113136620 BLAKE2B 3a12e21d953c223cbb2115b42d04102a8f81c961b49c7be4ece584eacb38132b1094b36156b056ceecc48326683ab390167748991f06fccf010e8717f0bcff3b SHA512 a17cc1ff51c7e74bc7cfa73ad61e98550e5f6d5c055c33539d89ef683b0919c69b4f7e2f11138587af6b2d5df6d7ecbcf0b97ed8cb9606be52e638367e92cfce
+DIST codex-rust-v0.147.0-crates.tar.xz 115996984 BLAKE2B 0be4094db9b10e7e6405fb1d18db7018a2124983fcdba35b5095a9a6a81580efe256bae2d0a2abfaee3806ac9db00837b68d353b8daf96a6be2c04a5f0ff3b57 SHA512 f6805526775bed8783437fc8d1ffee8cc3ba8820926788a4405816efe19ad4576e47c8b19052b4c792d560487bc5b1f4b0149861547e5fdd077cfd27c6fb4937
 DIST crossterm-87db8bfa6dc99427fd3b071681b07fc31c6ce995.gh.tar.gz 129254 BLAKE2B 414dacc3a682c7a6dc5c9e43f185966255205d18f0522ee7eae73b5f113b4c3ea9b132e6dee81783d4ce160e4bf95aab784cf3601d666265bef4f889d5e46e68 SHA512 9dc7247d081a25d18776c9c0fd7fe3373f372950728b7fcf5ff43aaa6f7d69f11e1dbd91f92991cbe73007eb9e78c9a901b2388c27ddd6898553fdcef7fdaf44
+DIST crossterm-f69a4a0499f2fdc7d5d222df32373ffffe9ba3f5.gh.tar.gz 135086 BLAKE2B a9a4ec3b3702f42f838b60a83f204f0b136fbf0c8edd3648cb42c70d09a33fb431395e7739fca0af06a7d1091d41cc261ce3e14a159cbd2ec6e5688463c2df5d SHA512 223bb495075668436414530209400033cde83b059212edada6c0a17d0d84d43d180a077b4f75a2fdd98f7287c8a532bbb1fb8982b3f5a7385179cc6cf7e3eee9
 DIST nucleo-4253de9faabb4e5c6d81d946a5e35a90f87347ee.gh.tar.gz 86782 BLAKE2B a812a2d2f08df818ac7b13b800f51c4229ea1f968668b1224fbc1fd82fb4e045f6b2c536ec6d2647a579097efbddaf041f4b7b356107679156aaa3ca5a9d4068 SHA512 354061278efce55defb30b9ee2ef5cdab745ab56d7d113f6f47a8ac174b4215ec6efe15c15bef0e3d907350182c0d189071e9d7d17d40e807d4db5361682f4e0
 DIST ratatui-9b2ad1298408c45918ee9f8241a6f95498cdbed2.gh.tar.gz 566574 BLAKE2B 97f09fda6a798afb00067debab30b89d35aa00bfd284d2ef95fd6176aaa680121a8eee9b8dbe605e6230a6e72ead7b5d4e57ddf4892bcfe93f2fcbbafaba88d2 SHA512 b2ab8bcf19cfd649b8fbbc6752b628f69e79b09e8f8258ea9112ce4348dee512d9e718b5310fc73de65239b51b2b1b593942974f9698bd080616ab389093f4ef
 DIST rules_rust-b56cbaa8465e74127f1ea216f813cd377295ad81.gh.tar.gz 3951333 BLAKE2B e369b7ccc25326726340fced4c8f8f9181f02f45be9d5f24d00201999a2b11c42d010e7623429b1910db7fdfdf4c202e061a5ba5db722d3126ee26d9597d7e0d SHA512 3f2ef3d7940096fa34b85ee0d9979085fe99c7d2ae8c5ed9399bd5cf8370a31fa93d16c752f22166b42d30c2b7f9f921f7a963928519592e3ffd588644d3b1c7
@@ -10,5 +13,9 @@ DIST rusty_v8_149.2.0_librusty_v8_release_aarch64-unknown-linux-musl.a.gz 281845
 DIST rusty_v8_149.2.0_librusty_v8_release_x86_64-unknown-linux-musl.a.gz 28806120 BLAKE2B a936b6c48f88e6d4773d9ed260a84b5165c68115fb295839fe13b5f5b32863d5f3e4cc9e2879ef27aa1aae1f5a4ff9755a0c47c9ff3de319dbb90e53b15f3c45 SHA512 68252ebb12e2b1699936c959ed1117d6dafaf9e00236fc3da87e650020448e245b8d87e6b6bf7c45de4cd7a938e15c19e2399e6461aef49299cceed55366e3de
 DIST rusty_v8_149.2.0_src_binding_release_aarch64-unknown-linux-musl.rs 39884 BLAKE2B 537e542d62d52145ad527d6d926c54a1bb789d504518bf5dd43430ad4dd481bbbe618533292b1c3d49484248424d5e86a7598958c6173cf97950eee59ddeb3e7 SHA512 4c41941b37ca1644fa8960c90db581a9c624865708b9a943369da56d80a7986e0f3c18c10b67129e65a19e4de7e707397d658b4a2cb259fb93d7788dfcafa7f8
 DIST rusty_v8_149.2.0_src_binding_release_x86_64-unknown-linux-musl.rs 39884 BLAKE2B 537e542d62d52145ad527d6d926c54a1bb789d504518bf5dd43430ad4dd481bbbe618533292b1c3d49484248424d5e86a7598958c6173cf97950eee59ddeb3e7 SHA512 4c41941b37ca1644fa8960c90db581a9c624865708b9a943369da56d80a7986e0f3c18c10b67129e65a19e4de7e707397d658b4a2cb259fb93d7788dfcafa7f8
+DIST rusty_v8_150.4.0_librusty_v8_release_aarch64-unknown-linux-musl.a.gz 28348988 BLAKE2B 4455aeb32626cc64967b79e2f2dac615023f019da23c75b853a24092a38d08222318ca27f6eed33d3485ef71f85823b08bb3d3bd288cf6cee5a2bf4447325cfe SHA512 085c5d4cd8b80f1b3aeb33769f046430652dddf549a880851958ffc36856b74aeca09ab02a2901856fc0e2e69d51f094309115d6760cb1f99ca519870d9d2379
+DIST rusty_v8_150.4.0_librusty_v8_release_x86_64-unknown-linux-musl.a.gz 29008976 BLAKE2B 7580c68e400e8b274c95173841806bf925efc788effe9420d159beff20a763f91d265b8764610e4f720a91a17b5d4c1ced39efb33142807e31dd75a570295666 SHA512 59253ce1fc3a628d0ec1d7e9f34b2a17aaf5661685502a2d664e3f39e4c2ba3bb5f29aeea9909e6c7f13398b795a37091e0ee3db344578dfa2fccb9524950e36
+DIST rusty_v8_150.4.0_src_binding_release_aarch64-unknown-linux-musl.rs 39884 BLAKE2B b21381b7f09d0205455ba541b2a38ff79b9535c4b8436b309f39f4b40d819e604b3689298ae81deb00c07a12a21ef0fd1bd0bbddb196d63f24d8621ace7165c1 SHA512 4ebc8dfb8b87fb6e1b39a67582e4690278ebcadf8a18314f642fd6658e2b5706a7acbbd52ab1899d985700a8e886dda6a601a29d977bdfcc9da46209b1a90571
+DIST rusty_v8_150.4.0_src_binding_release_x86_64-unknown-linux-musl.rs 39884 BLAKE2B b21381b7f09d0205455ba541b2a38ff79b9535c4b8436b309f39f4b40d819e604b3689298ae81deb00c07a12a21ef0fd1bd0bbddb196d63f24d8621ace7165c1 SHA512 4ebc8dfb8b87fb6e1b39a67582e4690278ebcadf8a18314f642fd6658e2b5706a7acbbd52ab1899d985700a8e886dda6a601a29d977bdfcc9da46209b1a90571
 DIST tokio-tungstenite-0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186.gh.tar.gz 33055 BLAKE2B a96f699095016a8f081dfb4dd14156b475886f9f81bf80566589385039cd9a5032717544ccb3ab026834089e5c0896778852e406c85bb43bd829d6272a8031b5 SHA512 e7f40cb92abe472f764d73884c520657cb6ea1f8fff710af3d888852a51f3b38ac9ab21d2631ab026508ce58b569bfe8d9bd3bce600d16e1cdd91f5d43f334e6
 DIST tungstenite-rs-4fffad30fe373adbdcffab9545e9e9bf4f2fc19f.gh.tar.gz 293806 BLAKE2B 01fd438230d5a6d2f47d340df64d25c7d47652fbc81d02269adfdc3cf6fc1ed9e252a385b31aca17e10b9059bfd936921bd34222951b656b400ef7e2eb5d7859 SHA512 da8ce98168bcc20e97a5a88df3dbc550302f1040681a76529b58a2d2a610c2db15d5a4e384423ed983ac70e43d352b87efdb684df1e153809bb812b47d4a5651

diff --git a/dev-util/codex/codex-0.147.0.ebuild b/dev-util/codex/codex-0.147.0.ebuild
new file mode 100644
index 0000000000..9047414e20
--- /dev/null
+++ b/dev-util/codex/codex-0.147.0.ebuild
@@ -0,0 +1,147 @@
+# Copyright 2025-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# NOTE: This package uses a pre-built crate tarball instead of listing individual
+# crates in CRATES="". This approach is required because:
+# 1. Codex has 800+ crate dependencies, which triggers Portage QA warnings:
+#    "QA Notice: This package uses a very large number of CRATES. Please provide
+#    a crate tarball instead and fetch it via SRC_URI."
+# 2. Stricter ebuild QA checks (e.g., in CI pipelines) fail with too many crates.
+#
+# The crate tarball is auto-generated by GitHub Actions at:
+#   https://github.com/gentoo-zh-drafts/codex/
+# Workflow source code for auditing:
+#   https://github.com/gentoo-zh-drafts/codex/blob/crate-dist/.github/workflows/crates.yml
+# This allows anyone to review and verify the crate packaging process.
+
+CRATES="
+"
+
+declare -A GIT_CRATES=(
+	[crossterm]='https://github.com/openai-oss-forks/crossterm;f69a4a0499f2fdc7d5d222df32373ffffe9ba3f5;crossterm-%commit%'
+	[nucleo-matcher]='https://github.com/helix-editor/nucleo;4253de9faabb4e5c6d81d946a5e35a90f87347ee;nucleo-%commit%/matcher'
+	[nucleo]='https://github.com/helix-editor/nucleo;4253de9faabb4e5c6d81d946a5e35a90f87347ee;nucleo-%commit%'
+	[runfiles]='https://github.com/dzbarsky/rules_rust;b56cbaa8465e74127f1ea216f813cd377295ad81;rules_rust-%commit%/rust/runfiles'
+	[tokio-tungstenite]='https://github.com/openai-oss-forks/tokio-tungstenite;0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186;tokio-tungstenite-%commit%'
+	[tungstenite]='https://github.com/openai-oss-forks/tungstenite-rs;4fffad30fe373adbdcffab9545e9e9bf4f2fc19f;tungstenite-rs-%commit%'
+)
+
+RUST_MIN_VER="1.95.0"
+
+# python3 .github/scripts/rusty_v8_bazel.py resolved-v8-crate-version
+RUSTY_V8_TAG="150.4.0"
+
+inherit cargo check-reqs toolchain-funcs
+
+CHECKREQS_MEMORY="15G"
+CHECKREQS_DISK_BUILD="20G"
+
+DESCRIPTION="Codex CLI - OpenAI's AI-powered coding agent"
+HOMEPAGE="https://github.com/openai/codex"
+
+# The crate tarball URL uses ${PV} so it auto-updates when bumping versions.
+# This tarball is generated by: https://github.com/gentoo-zh-drafts/codex/
+# See .github/workflows/crates.yml for the generation process.
+SRC_URI="
+	https://github.com/openai/${PN}/archive/rust-v${PV}.tar.gz -> ${P}.tar.gz
+	https://github.com/gentoo-zh-drafts/codex/releases/download/rust-v${PV}/codex-rust-v${PV}-crates.tar.xz
+	amd64? (
+		https://github.com/openai/codex/releases/download/rusty-v8-v${RUSTY_V8_TAG}/librusty_v8_release_x86_64-unknown-linux-musl.a.gz
+			-> rusty_v8_${RUSTY_V8_TAG}_librusty_v8_release_x86_64-unknown-linux-musl.a.gz
+		https://github.com/openai/codex/releases/download/rusty-v8-v${RUSTY_V8_TAG}/src_binding_release_x86_64-unknown-linux-musl.rs
+			-> rusty_v8_${RUSTY_V8_TAG}_src_binding_release_x86_64-unknown-linux-musl.rs
+	)
+	arm64? (
+		https://github.com/openai/codex/releases/download/rusty-v8-v${RUSTY_V8_TAG}/librusty_v8_release_aarch64-unknown-linux-musl.a.gz
+			-> rusty_v8_${RUSTY_V8_TAG}_librusty_v8_release_aarch64-unknown-linux-musl.a.gz
+		https://github.com/openai/codex/releases/download/rusty-v8-v${RUSTY_V8_TAG}/src_binding_release_aarch64-unknown-linux-musl.rs
+			-> rusty_v8_${RUSTY_V8_TAG}_src_binding_release_aarch64-unknown-linux-musl.rs
+	)
+	${CARGO_CRATE_URIS}
+"
+
+S="${WORKDIR}/${PN}-rust-v${PV}/codex-rs"
+
+LICENSE="Apache-2.0"
+# Dependent crate licenses
+LICENSE+="
+	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0
+	CC0-1.0 CDLA-Permissive-2.0 ISC MIT MPL-2.0 Unicode-3.0 ZLIB
+"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~arm64"
+# Tests fail due to ring crate conflicts with system OpenSSL
+RESTRICT="test"
+
+DEPEND="
+	dev-libs/openssl:=
+	sys-apps/dbus
+"
+RDEPEND="${DEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+# rust does not use *FLAGS from make.conf, silence portage warning
+QA_FLAGS_IGNORED="usr/bin/${PN}"
+
+pkg_pretend() {
+	check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+	check-reqs_pkg_setup
+	rust_pkg_setup
+	if tc-is-lto; then
+		export CARGO_PROFILE_RELEASE_LTO=thin
+	else
+		export CARGO_PROFILE_RELEASE_LTO=false
+	fi
+}
+
+gen_git_crate_dir() {
+	# https://github.com/gentoo/gentoo/blob/b09dd88412fe2d5eee5a8891e08bfa2d67848da3/eclass/cargo.eclass#L442
+	IFS=';' read -r crate_uri commit crate_dir <<<"${GIT_CRATES[$1]}"
+	echo "${WORKDIR}/${crate_dir//%commit%/${commit}}"
+}
+
+src_prepare() {
+	default
+
+	# Fix tokio-tungstenite's git dependency on tungstenite
+	sed -i '/^\[dependencies\.tungstenite\]/,/^$/{
+		s|git = "https://github.com/openai-oss-forks/tungstenite-rs"|path = "'"$(gen_git_crate_dir tungstenite)"'"|
+		/^rev = /d
+	}' "$(gen_git_crate_dir tokio-tungstenite)/Cargo.toml" || die
+
+	# Remove the [patch.crates-io] section and add path-based patches
+	sed -i '/^\[patch\.crates-io\]/,/^$/d' "${S}/Cargo.toml" || die
+	sed -i '/^\[patch\."ssh:\/\/git@github\.com/,/^$/d' "${S}/Cargo.toml" || die
+
+	# Add new patch section with local paths
+	cat >> "${S}/Cargo.toml" <<-EOF || die
+
+	[patch.crates-io]
+	crossterm = { path = "$(gen_git_crate_dir crossterm)" }
+	tokio-tungstenite = { path = "$(gen_git_crate_dir tokio-tungstenite)" }
+	tungstenite = { path = "$(gen_git_crate_dir tungstenite)" }
+	EOF
+}
+
+src_compile() {
+	local rusty_v8_triple
+	use amd64 && rusty_v8_triple=x86_64-unknown-linux-musl
+	use arm64 && rusty_v8_triple=aarch64-unknown-linux-musl
+
+	# codex-core trait resolution overflows rustc's default 8MiB stack
+	export RUST_MIN_STACK=16777216
+
+	RUSTY_V8_ARCHIVE="${DISTDIR}/rusty_v8_${RUSTY_V8_TAG}_librusty_v8_release_${rusty_v8_triple}.a.gz" \
+	RUSTY_V8_SRC_BINDING_PATH="${DISTDIR}/rusty_v8_${RUSTY_V8_TAG}_src_binding_release_${rusty_v8_triple}.rs" \
+		cargo_src_compile --package codex-cli
+}
+
+src_install() {
+	dobin "$(cargo_target_dir)/codex"
+	einstalldocs
+}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.