1 # Copyright 2021-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit systemd go-module
8 DESCRIPTION
="A platform for building proxies to bypass network restrictions."
9 HOMEPAGE
="https://www.v2fly.org/"
10 SRC_URI
="https://github.com/v2fly/v2ray-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
11 https://github.com/Puqns67/gentoo-deps/releases/download/${P}/${P}-vendor.tar.xz"
13 S
="${WORKDIR}/${PN}-core-${PV}"
17 KEYWORDS
="~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
21 DEPEND
="app-alternatives/v2ray-geoip
22 app-alternatives/v2ray-geosite"
25 BDEPEND
=">=dev-lang/go-1.21.4"
28 sed -i 's|/usr/local/bin|/usr/bin|;s|/usr/local/etc|/etc|' release
/config
/systemd
/system
/*.service || die
29 sed -i '/^User=/s/nobody/v2ray/;/^User=/aDynamicUser=true' release
/config
/systemd
/system
/*.service || die
34 ego build
-o v2ray
-trimpath -ldflags "-s -w -buildid=" .
/main
41 newins release
/config
/config.json config.json.example
43 newinitd
"${FILESDIR}/v2ray.initd-r1" v2ray
44 systemd_dounit release
/config
/systemd
/system
/v2ray
{,@
}.service