Install this version:
emerge -a =net-proxy/clash-verge-rev-bin-9999
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =net-proxy/clash-verge-rev-bin-9999
Or alternatively:
emerge --autounmask-write -a =net-proxy/clash-verge-rev-bin-9999
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit desktop systemd unpacker xdg
DESCRIPTION="(Continuation) of Clash Meta GUI based on Tauri"
HOMEPAGE="https://github.com/clash-verge-rev/clash-verge-rev"
if [[ ${PV} == 9999 ]]; then
PROPERTIES+=" live"
else
URL_PREFIX="https://github.com/clash-verge-rev/clash-verge-rev/releases/download/v${PV}/Clash.Verge_${PV}_"
SRC_URI="
amd64? ( ${URL_PREFIX}amd64.deb -> ${P}_amd64.deb )
arm64? ( ${URL_PREFIX}arm64.deb -> ${P}_arm64.deb )
"
KEYWORDS="~amd64 ~arm64"
fi
S="${WORKDIR}"
LICENSE="GPL-3"
SLOT="0"
[[ ${PV} == *9999* ]] && BDEPEND+=" net-misc/curl app-misc/jq"
DEPEND="
dev-libs/libayatana-appindicator
net-libs/webkit-gtk:4.1
"
RDEPEND="
${DEPEND}
dev-libs/glib:2
net-libs/libsoup:3.0
sys-apps/dbus
x11-libs/cairo
x11-libs/gdk-pixbuf:2
x11-libs/gtk+:3
"
RESTRICT="strip"
QA_PREBUILT="opt/clash-verge/bin/*"
src_unpack() {
if [[ ${PV} == 9999 ]]; then
local arch_suffix
case ${ARCH} in
amd64) arch_suffix="amd64" ;;
arm64) arch_suffix="arm64" ;;
*) die "Unsupported architecture: ${ARCH}" ;;
esac
einfo "Fetching latest autobuild version for ${ARCH}..."
# Get the latest version from latest.json
local version
local latest_url="https://github.com/clash-verge-rev/clash-verge-rev"
latest_url+="/releases/download/autobuild/latest.json"
version=$(curl -sL "${latest_url}" | jq -r '.version') || die "Failed to fetch latest version"
# URL encode the + sign in version
local encoded_version="${version//+/%2B}"
local filename="Clash.Verge_${version}_${arch_suffix}.deb"
local dl_url="https://github.com/clash-verge-rev/clash-verge-rev"
dl_url+="/releases/download/autobuild/Clash.Verge_${encoded_version}_${arch_suffix}.deb"
einfo "Downloading ${filename} (version ${version})..."
curl -L -o "${WORKDIR}/${filename}" "${dl_url}" || die "Failed to download ${filename}"
# Use Portage's unpack_deb function for proper extraction
cd "${WORKDIR}" || die
unpack_deb "./${filename}"
else
unpacker_src_unpack
fi
}
src_install() {
exeinto /opt/clash-verge/bin
doexe "${S}"/usr/bin/*
insinto /usr/lib/clash-verge
doins -r "${S}"/usr/lib/Clash\ Verge/resources
domenu "${FILESDIR}"/clash-verge.desktop
doicon -s 128 usr/share/icons/hicolor/128x128/apps/clash-verge.png
doicon -s 256 usr/share/icons/hicolor/256x256@2/apps/clash-verge.png
doicon -s 32 usr/share/icons/hicolor/32x32/apps/clash-verge.png
newinitd "${FILESDIR}"/clash-verge.initd clash-verge
}
pkg_postinst() {
xdg_pkg_postinst
if ! systemd_is_booted; then
elog "OpenRC 下暂不支持服务模式,因为上游的服务安装器只支持 systemd,修复服务会失败。"
elog "Service mode does not work on OpenRC yet, because upstream's installer only supports systemd."
elog "https://github.com/clash-verge-rev/clash-verge-service-ipc/pull/86"
fi
}
dev-libs/libayatana-appindicator net-libs/webkit-gtk:4.1
dev-libs/libayatana-appindicator net-libs/webkit-gtk:4.1 dev-libs/glib:2 net-libs/libsoup:3.0 sys-apps/dbus x11-libs/cairo x11-libs/gdk-pixbuf:2 x11-libs/gtk+:3