From 5e5ded26715263e3eb4cac6f5b36ca476b953b4e Mon Sep 17 00:00:00 2001 From: Yao Zi Date: Mon, 9 Mar 2026 15:04:08 +0000 Subject: [PATCH] [openai-codex] 0.112.0-1: init package --- PKGBUILD | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 00000000..1a14fc63 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: Yao Zi + +pkgname=openai-codex +pkgver=0.112.0 +pkgrel=1 +pkgdesc='Lightweight coding agent that runs in your terminal' +url='https://openai.com/codex/' +arch=(x86_64 aarch64 riscv64 loongarch64) +license=(Apache-2.0) +depends=(musl libcap openssl llvm-libs zlib-ng zstd xz) +optdepends=( + 'git: For Git repository operations' + 'ripgrep: For accelarated searching' +) +makedepends=(rust linux-uapi-headers) +source=("https://github.com/openai/codex/archive/refs/tags/rust-v$pkgver.tar.gz") +sha256sums=('9bbfe41f1e86f125a23022b1c6481d4b1e6687fedac76275f1eaf1858b66fc9d') + +# TODO: +# Devendor sqlite from libsqlite3-sys +# Devendor bzip2 from libbzip2-sys +_featureenv=( + OPENSSL_NO_VENDOR=1 + ZSTD_SYS_USE_PKG_CONFIG=1 +) + +prepare() { + cd codex-rust-v$pkgver/codex-rs + # --locked isn't possible since during releasing, + # workspace.package.version is updated, while Cargo.lock is not. + # https://github.com/openai/codex/issues/14065 + # + # There are too many crates to update manually, fetch without --locked + # after this has been resolved in upstream. + env "${_featureenv[@]}" \ + cargo fetch --target "$RUSTHOST" +} + +build() { + cd codex-rust-v$pkgver/codex-rs + env "${_featureenv[@]}" \ + cargo build --frozen --release --all-features \ + --bin codex \ + --bin codex-responses-api-proxy +} + +package() { + cd codex-rust-v$pkgver + _install_license_ LICENSE + + cd codex-rs + install -Dm755 target/release/{codex,codex-responses-api-proxy} \ + -t "$pkgdir/usr/bin/" + + install -d \ + "$pkgdir"/usr/share/bash-completion/completions \ + "$pkgdir"/usr/share/zsh/site-functions \ + "$pkgdir"/usr/share/fish/vendor_completions.d + "$pkgdir"/usr/bin/codex completion bash > \ + "$pkgdir"/usr/share/bash-completion/completions/codex + "$pkgdir"/usr/bin/codex completion zsh > \ + "$pkgdir"/usr/share/zsh/site-functions/_codex +}