Sync opencode

This commit is contained in:
Ryan Hughes committed 2025-11-21 12:09:43 -05:00
1 parent c5c01499cd
commit ee702e158b
3 files changed
+34 -29

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ claude-code
lmstudio lmstudio
crush-bin crush-bin
bun-bin # for opencode bun-bin # for opencode
# opencode opencode
minecraft-launcher minecraft-launcher
sublime-text-4 sublime-text-4
symfony-cli symfony-cli
+2 -2
View File
@@ -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.57 pkgver = 1.0.85
pkgrel = 1 pkgrel = 1
url = https://github.com/sst/opencode url = https://github.com/sst/opencode
arch = aarch64 arch = aarch64
@@ -15,7 +15,7 @@ pkgbase = opencode
conflicts = opencode-bin conflicts = opencode-bin
options = !debug options = !debug
options = !strip options = !strip
source = opencode-1.0.57.tar.gz::https://github.com/sst/opencode/archive/v1.0.57.tar.gz source = opencode-1.0.85.tar.gz::https://github.com/sst/opencode/archive/v1.0.85.tar.gz
sha256sums = SKIP sha256sums = SKIP
pkgname = opencode pkgname = opencode
+31 -26
View File
@@ -2,7 +2,7 @@
# Maintainer: adam # Maintainer: adam
pkgname='opencode' pkgname='opencode'
pkgver=1.0.57 pkgver=1.0.85
_subver= _subver=
options=('!debug' '!strip') options=('!debug' '!strip')
pkgrel=1 pkgrel=1
@@ -13,41 +13,46 @@ license=('MIT')
provides=('opencode') provides=('opencode')
conflicts=('opencode-bin') conflicts=('opencode-bin')
depends=('fzf' 'ripgrep') depends=('fzf' 'ripgrep')
makedepends=('git' 'bun-bin' 'go' 'npm') makedepends=('git' 'bun-bin' 'go')
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"
# Install workspace dependencies from root
bun install bun install
cd ./packages/opencode
# The build script uses relative imports like ../node_modules/... OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.85 bun run ./script/build.ts --single
# Create symlink so packages/opencode/node_modules points to root node_modules
cd packages/opencode
ln -sf ../../node_modules node_modules
# Build the binary
OPENCODE_CHANNEL=latest OPENCODE_VERSION=${pkgver} bun run build --single
} }
package() { package() {
cd "opencode-${pkgver}/packages/opencode" cd "opencode-${pkgver}/packages/opencode"
mkdir -p "${pkgdir}/usr/bin"
# Find the appropriate binary for this architecture target_arch="x64"
case "${CARCH}" in case "$CARCH" in
x86_64) x86_64) target_arch="x64" ;;
binary=$(find dist/opencode-linux-x64*/bin/opencode -type f | head -1) aarch64) target_arch="arm64" ;;
;; *) printf "unsupported architecture: %s\n" "$CARCH" >&2 ; return 1 ;;
aarch64)
binary=$(find dist/opencode-linux-arm64*/bin/opencode -type f | head -1)
;;
esac esac
libc=""
install -Dm755 "${binary}" "${pkgdir}/usr/bin/opencode" if command -v ldd >/dev/null 2>&1; then
if ldd --version 2>&1 | grep -qi musl; then
libc="-musl"
fi
fi
if [ -z "$libc" ] && ls /lib/ld-musl-* >/dev/null 2>&1; then
libc="-musl"
fi
base=""
if [ "$target_arch" = "x64" ]; then
if ! grep -qi avx2 /proc/cpuinfo 2>/dev/null; then
base="-baseline"
fi
fi
bin="dist/opencode-linux-${target_arch}${base}${libc}/bin/opencode"
if [ ! -f "$bin" ]; then
printf "unable to find binary for %s%s%s\n" "$target_arch" "$base" "$libc" >&2
return 1
fi
install -Dm755 "$bin" "${pkgdir}/usr/bin/opencode"
} }