Sync + Fix opencode pkg
This commit is contained in:
3 files changed
+23
-44
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
pkgbase = opencode
|
pkgbase = opencode
|
||||||
pkgdesc = The AI coding agent built for the terminal.
|
pkgdesc = The AI coding agent built for the terminal.
|
||||||
pkgver = 1.0.1
|
pkgver = 1.0.15
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://github.com/sst/opencode
|
url = https://github.com/sst/opencode
|
||||||
arch = aarch64
|
arch = aarch64
|
||||||
@@ -9,13 +9,14 @@ pkgbase = opencode
|
|||||||
makedepends = git
|
makedepends = git
|
||||||
makedepends = bun-bin
|
makedepends = bun-bin
|
||||||
makedepends = go
|
makedepends = go
|
||||||
|
makedepends = npm
|
||||||
depends = fzf
|
depends = fzf
|
||||||
depends = ripgrep
|
depends = ripgrep
|
||||||
provides = opencode
|
provides = opencode
|
||||||
conflicts = opencode-bin
|
conflicts = opencode-bin
|
||||||
options = !debug
|
options = !debug
|
||||||
options = !strip
|
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
|
sha256sums = SKIP
|
||||||
|
|
||||||
pkgname = opencode
|
pkgname = opencode
|
||||||
+20
-19
@@ -2,7 +2,7 @@
|
|||||||
# Maintainer: adam
|
# Maintainer: adam
|
||||||
|
|
||||||
pkgname='opencode'
|
pkgname='opencode'
|
||||||
pkgver=1.0.1
|
pkgver=1.0.15
|
||||||
_subver=
|
_subver=
|
||||||
options=('!debug' '!strip')
|
options=('!debug' '!strip')
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
@@ -13,33 +13,34 @@ license=('MIT')
|
|||||||
provides=('opencode')
|
provides=('opencode')
|
||||||
conflicts=('opencode-bin')
|
conflicts=('opencode-bin')
|
||||||
depends=('fzf' 'ripgrep')
|
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")
|
source=("opencode-${pkgver}.tar.gz::https://github.com/sst/opencode/archive/v${pkgver}${_subver}.tar.gz")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "opencode-${pkgver}"
|
cd "opencode-${pkgver}"
|
||||||
|
|
||||||
|
# Ensure npm is in PATH for bun's shell
|
||||||
|
export PATH="/usr/bin:$PATH"
|
||||||
|
|
||||||
bun install
|
bun install
|
||||||
|
cd ./packages/opencode
|
||||||
# Fix for bun compile not finding platform-specific @parcel/watcher
|
OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.15 bun run ./script/build.ts --single
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "opencode-${pkgver}/packages/opencode"
|
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
|
|
||||||
Reference in new issue
Block a user