A second review pass found the PKGBUILD rewriting could still go wrong in ways the pattern matching did not anticipate: an array element carrying a ")" in a comment left the tail of the old array behind, and jq's "$" also matches before a trailing newline, so a pkgver of "1.0\n" passed validation and then broke sed after the checksum arrays had already been written. Rather than chase each shape, prove the result. Every edit now lands on a scratch copy that is parsed with bash -n and read back to confirm it holds the version and checksums we meant to write, and only then replaces the PKGBUILD in a single rename. Corruption that slips past the matching fails loudly with the original untouched instead of landing in a pull request. The validation anchors are \A and \z accordingly, empty checksum lists are rejected rather than written as '', and the hook picks the newest stanza with vercmp so it agrees with the comparator the updater uses. Also stop the launcher probing /.config when HOME and XDG_CONFIG_HOME are both unset, and require a regular file, so a directory at that path is skipped instead of crashing the app on startup. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
96 lines
2.6 KiB
Bash
96 lines
2.6 KiB
Bash
# Maintainer: David Heinemeier Hansson <david@hey.com>
|
|
|
|
# Omarchy tracks OpenAI's own Debian repository rather than the AUR, which lags
|
|
# behind releases that ship several times a week. .omarchy/upstream.sh rewrites
|
|
# the version and checksums below from that repository's package index.
|
|
|
|
pkgname=openai-codex-desktop
|
|
pkgver=26.810.52044
|
|
pkgrel=1
|
|
pkgdesc="Official ChatGPT desktop app with Codex"
|
|
arch=('x86_64' 'aarch64')
|
|
url="https://chatgpt.com/codex/"
|
|
license=('custom')
|
|
|
|
depends=(
|
|
'alsa-lib'
|
|
'at-spi2-core'
|
|
'bash'
|
|
'cairo'
|
|
'dbus'
|
|
'expat'
|
|
'gcc-libs'
|
|
'gdk-pixbuf2'
|
|
'glib2'
|
|
'glibc'
|
|
'gtk3'
|
|
'libcups'
|
|
'libdrm'
|
|
'libglvnd'
|
|
'libnotify'
|
|
'libusb'
|
|
'libx11'
|
|
'libxcb'
|
|
'libxcomposite'
|
|
'libxdamage'
|
|
'libxext'
|
|
'libxfixes'
|
|
'libxkbcommon'
|
|
'libxrandr'
|
|
'mesa'
|
|
'nspr'
|
|
'nss'
|
|
'openssl'
|
|
'pango'
|
|
'systemd-libs'
|
|
'xdg-utils'
|
|
'xz'
|
|
)
|
|
|
|
optdepends=(
|
|
'apparmor: load the bundled user-namespace profile on AppArmor systems'
|
|
'git: version control integration'
|
|
)
|
|
|
|
makedepends=('libarchive')
|
|
provides=('chatgpt')
|
|
conflicts=('chatgpt')
|
|
options=('!debug' '!strip')
|
|
|
|
# Omarchy: the build image compresses with zstd at its default level, which
|
|
# leaves this 1.3 GB Electron tree at 447 MB. Maximum zstd takes it to 322 MB
|
|
# for ~4 extra minutes of build time -- worth it for a package this large that
|
|
# every user re-downloads on each of OpenAI's frequent releases.
|
|
COMPRESSZST=(zstd -c -z -q --ultra -22 --threads=0 -)
|
|
|
|
_deb_x86_64="chatgpt_${pkgver}_amd64.deb"
|
|
_deb_aarch64="chatgpt_${pkgver}_arm64.deb"
|
|
source=('chatgpt-launcher.sh')
|
|
_pool="https://persistent.oaistatic.com/codex-app-prod/linux/deb/pool/main/c/chatgpt"
|
|
source_x86_64=("${_deb_x86_64}::${_pool}/${_deb_x86_64}")
|
|
source_aarch64=("${_deb_aarch64}::${_pool}/${_deb_aarch64}")
|
|
noextract=("${_deb_x86_64}" "${_deb_aarch64}")
|
|
sha256sums=('b3a4503b5931f102444bc7015c3cf4e40266cf034e0d682bd2a407dc5b3ee58c')
|
|
sha256sums_x86_64=('708a15a1bb76e2bb7f0e376e5145391fa277ad3a64057c1d32537bdc2a1b4e6e')
|
|
sha256sums_aarch64=('6ebea681b1e494d218a199f638b4bc886e94e1458dd61079b1e390a6fb98fdd2')
|
|
|
|
package() {
|
|
cd "${srcdir}"
|
|
|
|
local deb_var="_deb_${CARCH}"
|
|
local deb="${!deb_var}"
|
|
|
|
bsdtar -xOf "${deb}" data.tar.xz |
|
|
bsdtar --no-same-owner -xf - -C "${pkgdir}"
|
|
|
|
rm "${pkgdir}/usr/bin/chatgpt"
|
|
install -Dm755 chatgpt-launcher.sh "${pkgdir}/usr/bin/chatgpt"
|
|
ln -s chatgpt "${pkgdir}/usr/bin/codex-desktop"
|
|
|
|
install -Dm644 "${pkgdir}/usr/share/doc/chatgpt/copyright" \
|
|
"${pkgdir}/usr/share/licenses/${pkgname}/copyright"
|
|
|
|
# Debian package-policy files are not used on Arch Linux.
|
|
rm -rf "${pkgdir}/usr/share/doc" "${pkgdir}/usr/share/lintian"
|
|
}
|