new ebuild: dev-util/opencode-desktop-bin
opencode-desktop-bin / check-and-update (push) Successful in 28s
yandex-music / check-and-update (push) Successful in 2m17s

This commit is contained in:
2026-11-26 00:43:43 +03:00
parent 75ba9acd03
commit b68cbaf649
9 changed files with 478 additions and 10 deletions
@@ -0,0 +1,121 @@
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CHROMIUM_LANGS="
af am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fil fi fr gu he hi
hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw
ta te th tr uk ur vi zh-CN zh-TW
"
inherit chromium-2 pax-utils unpacker wrapper xdg
DESCRIPTION="Open source AI coding agent (desktop application)"
HOMEPAGE="
https://opencode.ai/
https://github.com/anomalyco/opencode
"
SRC_URI="
amd64? (
https://github.com/anomalyco/opencode/releases/download/v${PV}/opencode-desktop-linux-amd64.deb
-> ${P}-amd64.deb
)
"
S="${WORKDIR}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="-* ~amd64"
RESTRICT="mirror strip"
QA_PREBUILT="*"
RDEPEND="
app-accessibility/at-spi2-core:2
app-crypt/libsecret
dev-libs/expat
dev-libs/glib:2
dev-libs/nspr
dev-libs/nss
dev-libs/wayland
media-libs/alsa-lib
media-libs/mesa[opengl]
net-print/cups
sys-apps/dbus
sys-apps/util-linux
virtual/udev
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3
x11-libs/libnotify
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrandr
x11-libs/libXScrnSaver
x11-libs/libXtst
x11-libs/libxkbcommon
x11-libs/pango
x11-misc/xdg-utils
"
pkg_setup() {
chromium_suid_sandbox_check_kernel_config
}
src_unpack() {
unpack_deb ${A}
}
src_prepare() {
default
# Let portage manage updates instead of Electron's bundled updater.
rm -f "${S}/opt/OpenCode/resources/app-update.yml" || die
# The FPM-generated changelog is not useful and is already compressed.
rm -rf "${S}/usr/share/doc" || die
# Launch through the wrapper in /usr/bin.
sed -i -e 's|^Exec=/opt/OpenCode/ai.opencode|Exec=opencode-desktop|' \
"${S}"/usr/share/applications/*.desktop || die
pushd "${S}/opt/OpenCode/locales" > /dev/null || die
chromium_remove_language_paks
popd > /dev/null || die
}
src_install() {
insinto /opt
doins -r opt/OpenCode
insinto /usr
doins -r usr/*
fowners root:root /opt/OpenCode/chrome-sandbox
fperms 4711 /opt/OpenCode/chrome-sandbox
fperms 0755 /opt/OpenCode/ai.opencode \
/opt/OpenCode/chrome_crashpad_handler \
/opt/OpenCode/resources/opencode-cli
pax-mark m "${ED}/opt/OpenCode/ai.opencode" \
"${ED}/opt/OpenCode/chrome-sandbox" \
"${ED}/opt/OpenCode/resources/opencode-cli"
make_wrapper opencode-desktop "/opt/OpenCode/ai.opencode" "" "/opt/OpenCode"
}
pkg_postinst() {
xdg_desktop_database_update
xdg_icon_cache_update
elog "The bundled Electron auto-updater has been disabled."
elog "Updates are managed by portage; use emerge to update this package."
}
pkg_postrm() {
xdg_desktop_database_update
xdg_icon_cache_update
}