Sync opencode
This commit is contained in:
@@ -46,7 +46,7 @@ claude-code
|
||||
lmstudio
|
||||
crush-bin
|
||||
bun-bin # for opencode
|
||||
# opencode
|
||||
opencode
|
||||
minecraft-launcher
|
||||
sublime-text-4
|
||||
symfony-cli
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pkgbase = opencode
|
||||
pkgdesc = The AI coding agent built for the terminal.
|
||||
pkgver = 1.0.57
|
||||
pkgver = 1.0.85
|
||||
pkgrel = 1
|
||||
url = https://github.com/sst/opencode
|
||||
arch = aarch64
|
||||
@@ -15,7 +15,7 @@ pkgbase = opencode
|
||||
conflicts = opencode-bin
|
||||
options = !debug
|
||||
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
|
||||
|
||||
pkgname = opencode
|
||||
|
||||
+31
-26
@@ -2,7 +2,7 @@
|
||||
# Maintainer: adam
|
||||
|
||||
pkgname='opencode'
|
||||
pkgver=1.0.57
|
||||
pkgver=1.0.85
|
||||
_subver=
|
||||
options=('!debug' '!strip')
|
||||
pkgrel=1
|
||||
@@ -13,41 +13,46 @@ license=('MIT')
|
||||
provides=('opencode')
|
||||
conflicts=('opencode-bin')
|
||||
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")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
build() {
|
||||
cd "opencode-${pkgver}"
|
||||
|
||||
# Ensure npm is in PATH for bun's shell
|
||||
export PATH="/usr/bin:$PATH"
|
||||
|
||||
# Install workspace dependencies from root
|
||||
bun install
|
||||
|
||||
# The build script uses relative imports like ../node_modules/...
|
||||
# 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
|
||||
cd ./packages/opencode
|
||||
OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.85 bun run ./script/build.ts --single
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "opencode-${pkgver}/packages/opencode"
|
||||
|
||||
# Find the appropriate binary for this architecture
|
||||
case "${CARCH}" in
|
||||
x86_64)
|
||||
binary=$(find dist/opencode-linux-x64*/bin/opencode -type f | head -1)
|
||||
;;
|
||||
aarch64)
|
||||
binary=$(find dist/opencode-linux-arm64*/bin/opencode -type f | head -1)
|
||||
;;
|
||||
mkdir -p "${pkgdir}/usr/bin"
|
||||
target_arch="x64"
|
||||
case "$CARCH" in
|
||||
x86_64) target_arch="x64" ;;
|
||||
aarch64) target_arch="arm64" ;;
|
||||
*) printf "unsupported architecture: %s\n" "$CARCH" >&2 ; return 1 ;;
|
||||
esac
|
||||
|
||||
install -Dm755 "${binary}" "${pkgdir}/usr/bin/opencode"
|
||||
libc=""
|
||||
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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user