Update opencode
This commit is contained in:
1 parent
ed997f1754
commit
eea95db276
1 file changed
+26
-4
@@ -13,19 +13,41 @@ 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"
|
||||||
|
|
||||||
|
# Install workspace dependencies from root
|
||||||
bun install
|
bun install
|
||||||
cd ./packages/opencode
|
|
||||||
OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.57 bun run ./script/build.ts --single
|
# 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
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "opencode-${pkgver}/packages/opencode"
|
cd "opencode-${pkgver}/packages/opencode"
|
||||||
install -Dm755 $(find dist/*/bin/opencode) "${pkgdir}/usr/bin/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)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
install -Dm755 "${binary}" "${pkgdir}/usr/bin/opencode"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user