1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit go-module systemd
7 DESCRIPTION="Another Clash Kernel, formerly Clash.Meta"
9 https://wiki.metacubex.one/
10 https://github.com/MetaCubeX/mihomo/
13 https://github.com/MetaCubeX/mihomo/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
16 https://github.com/peeweep/gentoo-go-deps/releases/download/${P}/${P}-deps.tar.xz
30 sys-apps/openrc[caps(+)]
37 BDEPEND=">=dev-lang/go-1.20.4"
41 KEYWORDS="~amd64 ~arm64"
42 IUSE="+gvisor systemd caps"
45 local BUILDTIME=$(LC_ALL=C date -u || die)
50 ego build -tags "${MY_TAGS}" -trimpath -ldflags "
51 -linkmode external -extldflags \"${LDFLAGS}\" \
52 -X \"github.com/metacubex/mihomo/constant.Version=${PV}\" \
53 -X \"github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}\" \
60 dosym -r "/usr/bin/mihomo" "/usr/bin/clash-meta"
61 systemd_dounit "${FILESDIR}/mihomo.service"
62 newinitd "${FILESDIR}"/mihomo.initd mihomo