diff --git a/pkgbuilds/opencode/.SRCINFO b/pkgbuilds/opencode/.SRCINFO index 92c1ce1..57dfe0d 100644 --- a/pkgbuilds/opencode/.SRCINFO +++ b/pkgbuilds/opencode/.SRCINFO @@ -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 diff --git a/pkgbuilds/opencode/PKGBUILD b/pkgbuilds/opencode/PKGBUILD index f6d66fb..c0ff8ea 100644 --- a/pkgbuilds/opencode/PKGBUILD +++ b/pkgbuilds/opencode/PKGBUILD @@ -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" } diff --git a/pkgbuilds/opencode/patches/fix-parcel-watcher.patch b/pkgbuilds/opencode/patches/fix-parcel-watcher.patch deleted file mode 100644 index 3d9f201..0000000 --- a/pkgbuilds/opencode/patches/fix-parcel-watcher.patch +++ /dev/null @@ -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