diff --git a/dev-util/opencode-bin/Manifest b/dev-util/opencode-bin/Manifest new file mode 100644 index 0000000..5c045b5 --- /dev/null +++ b/dev-util/opencode-bin/Manifest @@ -0,0 +1,6 @@ +DIST opencode-bin-1.14.22-amd64-baseline-musl.tar.gz 49734995 BLAKE2B 1d366313fa4db4eb6fcde191922d2cc651418aa0dc144af3a5fa5296dae49a4560b704ecd7b469e1718c4789bb938da59835d1c663cbd7b4ebf3d1d8b844739a SHA512 77e01a1ad306a599ea51c94da21a9c16ade704cdee9ce409ce39d4f491363ae2e2e75ff238fabc1bebde740878ae1e2bf3c20172c7b90c1c5f64446ca02e6b2a +DIST opencode-bin-1.14.22-amd64-baseline.tar.gz 51564378 BLAKE2B eb2f73b4a09a3c1f91da4f939ad7ad012cc3b3f28963c51c25fa569526b0519e81dca0f564419ceb8ea279d0569c2b25d5b4c698bb47200872245449e1a38b5d SHA512 569177b6b2f70abbac55cfaca322888d9ac9e691e4edb7919b329c7cc5d2370a1a951afb47c787c85b3fedc41c28b2b5bf48b4b6e67d874905e286cd715d0cfc +DIST opencode-bin-1.14.22-amd64-musl.tar.gz 49734995 BLAKE2B 1d366313fa4db4eb6fcde191922d2cc651418aa0dc144af3a5fa5296dae49a4560b704ecd7b469e1718c4789bb938da59835d1c663cbd7b4ebf3d1d8b844739a SHA512 77e01a1ad306a599ea51c94da21a9c16ade704cdee9ce409ce39d4f491363ae2e2e75ff238fabc1bebde740878ae1e2bf3c20172c7b90c1c5f64446ca02e6b2a +DIST opencode-bin-1.14.22-amd64.tar.gz 51564378 BLAKE2B 6b7ed9b100c61f4e9301c1c4daccaed5d4976b5adbe9c3fc56fe64e5b6609cd9bc3a3d2ba188a95e29e55ead6a3ecb13ebf151f9792ec0f0ec31feb65e9fc1b7 SHA512 d7043248fc83b877ea49b07842918715dde1fa83c11b72a7b314b4d3a509bad058a66a913d6fc2ccb2a3469532761d33d4dfd2301255750a4eafb6ad7d5baa9f +DIST opencode-bin-1.14.22-arm64-musl.tar.gz 49605909 BLAKE2B 7bfa4fb2bdf2d0e80de58589cedf0e48f60632a612c76f78b33ab2c047abee0ca9f57e13cd109de65e00225f9ccc8b5f552a99ff7b2f5a92df43a7e331408ec4 SHA512 de84f9bb4d0e8c6baa073a0085f94f12debb2495c9a3661a3b5ffa950ec4f91485fa16b02fec4356510cbafe8716c1370cc77c2cfef74420d60805fd906cfdf1 +DIST opencode-bin-1.14.22-arm64.tar.gz 51493447 BLAKE2B ce457140cce648b14602b3ccc5a5adbe50588cdd9d17b2236a12416137d9c41fdb86a8a6afb2988d7b3208a260cfc06f6918ec6fd9160a39307c5d5c8eb6ce40 SHA512 690e18fab6a76a78a83f5775eba114da3799ed65b8d85e1257fb8db6e25128cd45de3f8e31b39451533e70ef9497862eba4933ae90a5c505ff2d9480b8402e2a diff --git a/dev-util/opencode-bin/metadata.xml b/dev-util/opencode-bin/metadata.xml new file mode 100644 index 0000000..ec8e7b1 --- /dev/null +++ b/dev-util/opencode-bin/metadata.xml @@ -0,0 +1,11 @@ + + + + + xiangzhedev@gmail.com + xz-dev + + + anomalyco/opencode + + diff --git a/dev-util/opencode-bin/opencode-bin-1.14.22.ebuild b/dev-util/opencode-bin/opencode-bin-1.14.22.ebuild new file mode 100644 index 0000000..afd2272 --- /dev/null +++ b/dev-util/opencode-bin/opencode-bin-1.14.22.ebuild @@ -0,0 +1,66 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="The open source AI coding agent" +HOMEPAGE="https://opencode.ai https://github.com/anomalyco/opencode" + +GITHUB_BASE="https://github.com/anomalyco/opencode/releases/download/v${PV}" +if [[ ${PV} == 9999 ]]; then + PROPERTIES+=" live" + GITHUB_BASE="https://github.com/anomalyco/opencode/releases/latest/download" +else + SRC_URI=" + amd64? ( + cpu_flags_x86_avx2? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-x64.tar.gz -> ${P}-amd64.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-x64-musl.tar.gz -> ${P}-amd64-musl.tar.gz ) + ) + !cpu_flags_x86_avx2? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-x64-baseline.tar.gz -> ${P}-amd64-baseline.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-x64-baseline-musl.tar.gz -> ${P}-amd64-baseline-musl.tar.gz ) + ) + ) + arm64? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-arm64.tar.gz -> ${P}-arm64.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-arm64-musl.tar.gz -> ${P}-arm64-musl.tar.gz ) + ) + " + KEYWORDS="~amd64 ~arm64" +fi + +S="${WORKDIR}" +LICENSE="MIT" +SLOT="0" +IUSE="cpu_flags_x86_avx2" +RESTRICT="mirror strip" + +[[ ${PV} == 9999 ]] && BDEPEND+=" net-misc/curl" + +QA_PREBUILT="usr/bin/opencode" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + local arch suffix="" + case ${ARCH} in + amd64) arch="x64" ;; + arm64) arch="arm64" ;; + *) die "Unsupported architecture: ${ARCH}" ;; + esac + [[ ${ARCH} == amd64 ]] && ! use cpu_flags_x86_avx2 && suffix+="-baseline" + use elibc_musl && suffix+="-musl" + + local filename="opencode-linux-${arch}${suffix}.tar.gz" + einfo "Downloading opencode latest release: ${filename}" + curl -L -o "${WORKDIR}/${filename}" "${GITHUB_BASE}/${filename}" || die "Failed to download" + cd "${WORKDIR}" || die + tar -xzf "${filename}" || die "Failed to extract" + else + default_src_unpack + fi +} + +src_install() { + dobin opencode +} diff --git a/dev-util/opencode-bin/opencode-bin-9999.ebuild b/dev-util/opencode-bin/opencode-bin-9999.ebuild new file mode 100644 index 0000000..afd2272 --- /dev/null +++ b/dev-util/opencode-bin/opencode-bin-9999.ebuild @@ -0,0 +1,66 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="The open source AI coding agent" +HOMEPAGE="https://opencode.ai https://github.com/anomalyco/opencode" + +GITHUB_BASE="https://github.com/anomalyco/opencode/releases/download/v${PV}" +if [[ ${PV} == 9999 ]]; then + PROPERTIES+=" live" + GITHUB_BASE="https://github.com/anomalyco/opencode/releases/latest/download" +else + SRC_URI=" + amd64? ( + cpu_flags_x86_avx2? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-x64.tar.gz -> ${P}-amd64.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-x64-musl.tar.gz -> ${P}-amd64-musl.tar.gz ) + ) + !cpu_flags_x86_avx2? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-x64-baseline.tar.gz -> ${P}-amd64-baseline.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-x64-baseline-musl.tar.gz -> ${P}-amd64-baseline-musl.tar.gz ) + ) + ) + arm64? ( + elibc_glibc? ( ${GITHUB_BASE}/opencode-linux-arm64.tar.gz -> ${P}-arm64.tar.gz ) + elibc_musl? ( ${GITHUB_BASE}/opencode-linux-arm64-musl.tar.gz -> ${P}-arm64-musl.tar.gz ) + ) + " + KEYWORDS="~amd64 ~arm64" +fi + +S="${WORKDIR}" +LICENSE="MIT" +SLOT="0" +IUSE="cpu_flags_x86_avx2" +RESTRICT="mirror strip" + +[[ ${PV} == 9999 ]] && BDEPEND+=" net-misc/curl" + +QA_PREBUILT="usr/bin/opencode" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + local arch suffix="" + case ${ARCH} in + amd64) arch="x64" ;; + arm64) arch="arm64" ;; + *) die "Unsupported architecture: ${ARCH}" ;; + esac + [[ ${ARCH} == amd64 ]] && ! use cpu_flags_x86_avx2 && suffix+="-baseline" + use elibc_musl && suffix+="-musl" + + local filename="opencode-linux-${arch}${suffix}.tar.gz" + einfo "Downloading opencode latest release: ${filename}" + curl -L -o "${WORKDIR}/${filename}" "${GITHUB_BASE}/${filename}" || die "Failed to download" + cd "${WORKDIR}" || die + tar -xzf "${filename}" || die "Failed to extract" + else + default_src_unpack + fi +} + +src_install() { + dobin opencode +} diff --git a/metadata/md5-cache/dev-util/opencode-bin-1.14.22 b/metadata/md5-cache/dev-util/opencode-bin-1.14.22 new file mode 100644 index 0000000..766df8b --- /dev/null +++ b/metadata/md5-cache/dev-util/opencode-bin-1.14.22 @@ -0,0 +1,11 @@ +DEFINED_PHASES=install unpack +DESCRIPTION=The open source AI coding agent +EAPI=8 +HOMEPAGE=https://opencode.ai https://github.com/anomalyco/opencode +IUSE=cpu_flags_x86_avx2 +KEYWORDS=~amd64 ~arm64 +LICENSE=MIT +RESTRICT=mirror strip +SLOT=0 +SRC_URI=amd64? ( cpu_flags_x86_avx2? ( elibc_glibc? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-x64.tar.gz -> opencode-bin-1.14.22-amd64.tar.gz ) elibc_musl? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-x64-musl.tar.gz -> opencode-bin-1.14.22-amd64-musl.tar.gz ) ) !cpu_flags_x86_avx2? ( elibc_glibc? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-x64-baseline.tar.gz -> opencode-bin-1.14.22-amd64-baseline.tar.gz ) elibc_musl? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-x64-baseline-musl.tar.gz -> opencode-bin-1.14.22-amd64-baseline-musl.tar.gz ) ) ) arm64? ( elibc_glibc? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-arm64.tar.gz -> opencode-bin-1.14.22-arm64.tar.gz ) elibc_musl? ( https://github.com/anomalyco/opencode/releases/download/v1.14.22/opencode-linux-arm64-musl.tar.gz -> opencode-bin-1.14.22-arm64-musl.tar.gz ) ) +_md5_=434316464e64cd5e37fd4034ea9393f4 diff --git a/metadata/md5-cache/dev-util/opencode-bin-9999 b/metadata/md5-cache/dev-util/opencode-bin-9999 new file mode 100644 index 0000000..6cb40e2 --- /dev/null +++ b/metadata/md5-cache/dev-util/opencode-bin-9999 @@ -0,0 +1,11 @@ +BDEPEND=net-misc/curl +DEFINED_PHASES=install unpack +DESCRIPTION=The open source AI coding agent +EAPI=8 +HOMEPAGE=https://opencode.ai https://github.com/anomalyco/opencode +IUSE=cpu_flags_x86_avx2 +LICENSE=MIT +PROPERTIES=live +RESTRICT=mirror strip +SLOT=0 +_md5_=434316464e64cd5e37fd4034ea9393f4