Sync + Fix opencode pkg

This commit is contained in:
Ryan Hughes
2025-11-02 22:16:27 -05:00
parent bb2dbf1028
commit e86868c73f
3 changed files with 23 additions and 44 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
pkgbase = opencode
pkgdesc = The AI coding agent built for the terminal.
pkgver = 1.0.1
pkgver = 1.0.15
pkgrel = 1
url = https://github.com/sst/opencode
arch = aarch64
@@ -9,13 +9,14 @@ pkgbase = opencode
makedepends = git
makedepends = bun-bin
makedepends = go
makedepends = npm
depends = fzf
depends = ripgrep
provides = opencode
conflicts = opencode-bin
options = !debug
options = !strip
source = opencode-1.0.1.tar.gz::https://github.com/sst/opencode/archive/v1.0.1.tar.gz
source = opencode-1.0.15.tar.gz::https://github.com/sst/opencode/archive/v1.0.15.tar.gz
sha256sums = SKIP
pkgname = opencode
+20 -19
View File
@@ -2,7 +2,7 @@
# Maintainer: adam
pkgname='opencode'
pkgver=1.0.1
pkgver=1.0.15
_subver=
options=('!debug' '!strip')
pkgrel=1
@@ -13,33 +13,34 @@ license=('MIT')
provides=('opencode')
conflicts=('opencode-bin')
depends=('fzf' 'ripgrep')
makedepends=('git' 'bun-bin' 'go')
makedepends=('git' 'bun-bin' 'go' 'npm')
source=("opencode-${pkgver}.tar.gz::https://github.com/sst/opencode/archive/v${pkgver}${_subver}.tar.gz")
sha256sums=('SKIP')
build() {
cd "opencode-${pkgver}"
# Ensure npm is in PATH for bun's shell
export PATH="/usr/bin:$PATH"
bun install
# Fix for bun compile not finding platform-specific @parcel/watcher
# The compile step needs this to be explicitly installed
case "${CARCH}" in
x86_64)
bun add @parcel/watcher-linux-x64-glibc --optional
;;
aarch64)
bun add @parcel/watcher-linux-arm64-glibc --optional
;;
esac
cd packages/tui
CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${pkgver}" -o tui cmd/opencode/main.go
cd ../opencode
bun build --define OPENCODE_TUI_PATH="'$(realpath ../tui/tui)'" --define OPENCODE_VERSION="'${pkgver}'" --compile --target=bun-linux-x64 --outfile=opencode ./src/index.ts
cd ./packages/opencode
OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.15 bun run ./script/build.ts --single
}
package() {
cd "opencode-${pkgver}/packages/opencode"
install -Dm755 ./opencode "${pkgdir}/usr/bin/opencode"
# Determine architecture for the binary path
case "${CARCH}" in
x86_64)
_arch="x64"
;;
aarch64)
_arch="arm64"
;;
esac
install -Dm755 "./dist/opencode-linux-${_arch}/bin/opencode" "${pkgdir}/usr/bin/opencode"
}
@@ -1,23 +0,0 @@
diff --git a/PKGBUILD b/PKGBUILD
index a27b9e7..9e092f3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,6 +20,18 @@ sha256sums=('SKIP')
build() {
cd "opencode-${pkgver}"
bun install
+
+ # Fix for bun compile not finding platform-specific @parcel/watcher
+ # The compile step needs this to be explicitly installed
+ case "${CARCH}" in
+ x86_64)
+ bun add @parcel/watcher-linux-x64-glibc --optional
+ ;;
+ aarch64)
+ bun add @parcel/watcher-linux-arm64-glibc --optional
+ ;;
+ esac
+
cd packages/tui
CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${pkgver}" -o tui cmd/opencode/main.go
cd ../opencode