improve dependencies on app-alternatives/v2ray-geo{ip,site}
[gentoo-zh.git] / net-proxy / Xray / Xray-1.8.11.ebuild
blob7f96e9a7296baf2c211c143e77bc41398821823b
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit go-module systemd
8 DESCRIPTION="Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support."
9 HOMEPAGE="https://xtls.github.io/ https://github.com/XTLS/Xray-core"
10 SRC_URI="https://github.com/XTLS/Xray-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}"
15 LICENSE="MPL-2.0"
16 SLOT="0"
17 KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~x86"
19 RESTRICT="mirror"
21 DEPEND="app-alternatives/v2ray-geoip
22 app-alternatives/v2ray-geosite"
23 RDEPEND="${DEPEND}"
24 BDEPEND=">=dev-lang/go-1.22"
26 src_compile() {
27 ego build -o xray -trimpath -ldflags "-w -s -X 'github.com/XTLS/Xray-core/core.build=${PV}' -buildid=" ./main
30 src_install() {
31 dobin xray
32 newinitd "${FILESDIR}/xray.initd" xray
33 systemd_dounit "${FILESDIR}/xray.service"
34 systemd_newunit "${FILESDIR}/xray_at.service" xray@.service
35 dosym -r /usr/share/v2ray/geosite.dat /usr/share/xray/geosite.dat
36 dosym -r /usr/share/v2ray/geoip.dat /usr/share/xray/geoip.dat
37 keepdir /etc/xray