# Copyright 2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 inherit go systemd DESCRIPTION="A platform for building proxies to bypass network restrictions." HOMEPAGE="https://github.com/v2fly/v2ray-core" SRC_URI="https://github.com/v2fly/v2ray-core/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz https://github.com/bekcpear/gopkg-vendors/archive/refs/tags/vendor-${P}.tar.gz -> ${P}-vendor.tar.gz" LICENSE="Apache-2.0 BSD-2 BSD MIT" SLOT="0" KEYWORDS="~amd64 ~arm64 ~riscv ~x86 ~arm64-macos" REQUIRED_USE="arm64-macos? ( pie )" BDEPEND=" >dev-lang/go-1.20.9999:= <=dev-lang/go-1.22.9999:= " DEPEND="" RDEPEND=" dev-libs/v2ray-geoip-bin || ( dev-libs/v2ray-domain-list-community-bin dev-libs/v2ray-domain-list-community ) " GO_TARGET_PKGS="./main -> v2ray" src_prepare() { sed -i 's|/usr/local/bin|/usr/bin|;s|/usr/local/etc|/etc|' release/config/systemd/system/*.service || die sed -i '/^User=/s/nobody/v2ray/;/^User=/aDynamicUser=true' release/config/systemd/system/*.service || die default } src_install() { if use prefix; then exeinto "/usr/libexec" doexe "${T}/go-bin/v2ray" mkdir "${ED%/}/usr/bin" || die cat >"${ED%/}/usr/bin/v2ray" <