1 # Copyright 2022-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit systemd go-module desktop xdg
8 DESCRIPTION="web GUI of Project V which supports V2Ray, Xray, SS, SSR, Trojan and Pingtunnel"
9 HOMEPAGE="https://v2raya.org/"
12 https://github.com/v2rayA/v2rayA/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
13 https://github.com/v2rayA/v2rayA/releases/download/v${PV}/web.tar.gz -> ${P}-web.tar.gz
15 # maintainer generated deps pack
16 # generated with liuyujielol/gentoo-go-deps/.github/workflows/generator.yml
18 https://github.com/liuyujielol/gentoo-go-deps/releases/download/${P}/${P}-deps.tar.xz
23 KEYWORDS="~amd64 ~loong"
29 >=net-proxy/v2ray-bin-5
31 xray? ( net-proxy/Xray )
38 mv -v "${WORKDIR}/web" "${S}/service/server/router/web" || die
40 cd "${S}/service" || die
41 ego build -tags "with_gvisor" \
42 -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=${PV} -s -w" \
47 dobin "${S}"/service/v2raya
48 # directory for runtime use
51 ./service/v2raya --report config | sed '1,6d' | fold -s -w 78 | sed -E 's/^([^#].+)/# \1/'\
52 >> "${S}"/install/universal/v2raya.default || die
54 # config /etc/default/v2raya
55 insinto "/etc/default"
56 newins "${S}"/install/universal/v2raya.default v2raya
58 systemd_dounit "${S}"/install/universal/v2raya.service
59 systemd_douserunit "${S}"/install/universal/v2raya-lite.service
61 #thanks to @Universebenzene
62 newinitd "${FILESDIR}/${PN}.initd-r1" v2raya
63 newinitd "${FILESDIR}/${PN}-user.initd" v2raya-user
64 newconfd "${FILESDIR}/${PN}.confd" v2raya
65 newconfd "${FILESDIR}/${PN}-user.confd" v2raya-user
67 doicon -s 512 "${S}"/install/universal/v2raya.png
68 domenu "${S}"/install/universal/v2raya.desktop
74 if has_version '<net-proxy/v2rayA-2.0.0' ; then
75 elog "Starting from net-proxy/v2rayA-2.0.0"
76 elog "Support for v2ray-4 has been dropped"
77 elog "A config migration may be required"