53 lines
1.8 KiB
Bash
53 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
# shellcheck disable=SC2034
|
|
# Maintainer: Chmouel Boudjnah <chmouel@chmouel.com>
|
|
pkgname=openai-codex-bin
|
|
pkgver=0.105.0
|
|
pkgrel=3
|
|
pkgdesc="Arch Linux package for OpenAI's Codex CLI - Auto Updated"
|
|
arch=('x86_64' 'aarch64')
|
|
url="https://github.com/openai/codex"
|
|
license=('Apache')
|
|
provides=('openai-codex')
|
|
conflicts=('openai-codex' 'openai-codex-autoup-bin')
|
|
replaces=('openai-codex-autoup-bin')
|
|
optdepends=(
|
|
'git: for working with git repositories'
|
|
'ripgrep: accelerated large-repo search'
|
|
)
|
|
keywords=('codex' 'openai' 'cli' 'ai' 'machine-learning' 'chatgpt')
|
|
|
|
source_x86_64=(
|
|
"codex-${pkgver}-x86_64.tar.gz::https://github.com/openai/codex/releases/download/rust-v${pkgver}/codex-x86_64-unknown-linux-gnu.tar.gz"
|
|
)
|
|
sha256sums_x86_64=('30acba08753c2651bf99a7e98a526198f67a995e776bd4915939c8bcb4f6852d')
|
|
sha256sums_aarch64=('9d491a038b064285555d32d351c0d6d7c47840e727031512dcff71da5f738f0b')
|
|
|
|
source_aarch64=(
|
|
"codex-${pkgver}-aarch64.tar.gz::https://github.com/openai/codex/releases/download/rust-v${pkgver}/codex-aarch64-unknown-linux-gnu.tar.gz"
|
|
)
|
|
|
|
package() {
|
|
cd "$srcdir" || exit
|
|
|
|
if [[ "$CARCH" == "x86_64" ]]; then
|
|
install -Dm755 "codex-x86_64-unknown-linux-gnu" "$pkgdir/usr/bin/codex"
|
|
fi
|
|
|
|
if [[ "$CARCH" == "aarch64" ]]; then
|
|
install -Dm755 "codex-aarch64-unknown-linux-gnu" "$pkgdir/usr/bin/codex"
|
|
fi
|
|
|
|
# Install completions
|
|
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
|
|
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
|
|
|
|
# Generate completion scripts
|
|
"${pkgdir}/usr/bin/codex" completion bash >codex.bash
|
|
"${pkgdir}/usr/bin/codex" completion zsh >codex.zsh
|
|
|
|
# Install completion files
|
|
install -Dm644 "codex.bash" "${pkgdir}/usr/share/bash-completion/completions/codex"
|
|
install -Dm644 "codex.zsh" "${pkgdir}/usr/share/zsh/site-functions/_codex"
|
|
}
|