diff options
| -rw-r--r-- | .extras/nvchecker.toml | 4 | ||||
| -rw-r--r-- | opencode2-bin/README | 23 | ||||
| -rw-r--r-- | opencode2-bin/opencode2-bin.SlackBuild | 80 | ||||
| -rw-r--r-- | opencode2-bin/opencode2-bin.info | 10 | ||||
| -rw-r--r-- | opencode2-bin/slack-desc | 19 |
5 files changed, 136 insertions, 0 deletions
diff --git a/.extras/nvchecker.toml b/.extras/nvchecker.toml index ff07312..1dacc03 100644 --- a/.extras/nvchecker.toml +++ b/.extras/nvchecker.toml @@ -123,6 +123,10 @@ github = "anomalyco/opencode" use_latest_release = true prefix = "v" +[opencode2-bin] +source = "npm" +npm = "@opencode/cli" + [mutagen] source = "github" github = "quodlibet/mutagen" diff --git a/opencode2-bin/README b/opencode2-bin/README new file mode 100644 index 0000000..511792d --- /dev/null +++ b/opencode2-bin/README @@ -0,0 +1,23 @@ +opencode2-bin packages the OpenCode 2.0 release line, an open source AI +coding agent for the terminal. + +This package ships the self-contained binary built by upstream and +installs it as `opencode2`, so it can coexist with the v1 +`opencode-bin` package (which provides `opencode`). Upstream publishes +the 2.0 line only to the npm registry as `@opencode/cli-linux-x64`; +there is no GitHub release tarball for it, so this package repacks +that npm artifact. + +The binary is compiled with Bun and is self-contained (no runtime +dependencies). The default build targets glibc x86_64 with AVX2. On a +CPU without AVX2, use the `-baseline` variant instead. + +OpenCode v1 and v2 share the same configuration and state directories +(`~/.config/opencode`, `~/.local/share/opencode`). To test 2.0 without +touching the v1 state, run it with an isolated XDG environment, e.g.: + + XDG_CONFIG_HOME=~/.config/opencode2 \ + XDG_DATA_HOME=~/.local/share/opencode2 \ + opencode2 + +Homepage: https://opencode.ai diff --git a/opencode2-bin/opencode2-bin.SlackBuild b/opencode2-bin/opencode2-bin.SlackBuild new file mode 100644 index 0000000..53b65f6 --- /dev/null +++ b/opencode2-bin/opencode2-bin.SlackBuild @@ -0,0 +1,80 @@ +#!/bin/bash + +# Slackware build script for opencode2-bin + +# Copyright 2026 danix <danix@danix.xyz> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=opencode2-bin +VERSION=${VERSION:-2.0.28} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +ARCH=${ARCH:-x86_64} + +# Only x86_64 is supported (pre-built binary) +if [ "$ARCH" != "x86_64" ]; then + echo "ERROR: $PRGNAM is only available for x86_64." + exit 1 +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf package +tar xzf $CWD/cli-linux-x64-$VERSION.tgz + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# The npm tarball ships one self-contained bun-compiled binary under +# bin/opencode. Upstream exposes it as both the `opencode` and `opencode2` +# commands; this package ships it as `opencode2` so it can coexist with the +# v1 `opencode-bin` package. No stripping: the binary is bun-generated and +# stripping renders it unusable. +install -D -m 0755 package/bin/opencode $PKG/usr/bin/opencode2 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/opencode2-bin/opencode2-bin.info b/opencode2-bin/opencode2-bin.info new file mode 100644 index 0000000..adda5e8 --- /dev/null +++ b/opencode2-bin/opencode2-bin.info @@ -0,0 +1,10 @@ +PRGNAM="opencode2-bin" +VERSION="2.0.28" +HOMEPAGE="https://opencode.ai" +DOWNLOAD="UNSUPPORTED" +MD5SUM="" +DOWNLOAD_x86_64="https://registry.npmjs.org/@opencode/cli-linux-x64/-/cli-linux-x64-2.0.28.tgz" +MD5SUM_x86_64="8f67aedb6d390ec1eaf7840a1bd303ab" +REQUIRES="" +MAINTAINER="danix" +EMAIL="danix@danix.xyz" diff --git a/opencode2-bin/slack-desc b/opencode2-bin/slack-desc new file mode 100644 index 0000000..e9a2ba7 --- /dev/null +++ b/opencode2-bin/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one blank line after the base package name's header. + + |-----handy-ruler------------------------------------------------------| +opencode2-bin: opencode2-bin (open source AI coding agent, 2.0 release line) +opencode2-bin: +opencode2-bin: OpenCode 2.0 is the next release line of the terminal AI coding +opencode2-bin: agent, supporting 75+ LLM providers including Claude, OpenAI, +opencode2-bin: Gemini, GitHub Copilot, and local models via Ollama. +opencode2-bin: The binary is installed as `opencode2` and is bundled with Bun +opencode2-bin: as a self-contained executable, so it can coexist with the v1 +opencode2-bin: opencode-bin package. +opencode2-bin: +opencode2-bin: Homepage: https://opencode.ai +opencode2-bin: |
