-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: liuyujielol <[email protected]>
- Loading branch information
1 parent
3d94e33
commit 29cc2d5
Showing
4 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
DIST v2rayA-2.2.4.1-vendor.tar.xz 5460732 BLAKE2B 5f2b9893d11afafcf831fb23016b0a248c925ef5a9bd7701c2c31cbf45a893dcc4320d0df7d06d76166308e456600d904b83af908a8a1c89a448a7f7d0a9462f SHA512 e254e764f36305fc7ac7b6cf2074c07ccb7a0dd87d90742a2098bc1d7f879fbfc2023ff97e1861e3fcab6ad8df76dbf1df31aa3983ddf8cc151d9af807f5b4b7 | ||
DIST v2rayA-2.2.4.1-web.tar.gz 2798277 BLAKE2B d6ff6d5d61f38d9f322788ac4e84d29729148e3b6b335dc9762efcabdb6d3d92a0f9495ccce7958495a4387ae6f368dd57fe30a8c6bb8caf9c0c3f172ae985bf SHA512 722483a884570d8763502bc09e18a1e11a20f5fe1a1b2bc2c992b17e1ed156d2063e5ea18bb84b91d0603ee4d26cbf0125e367fa1e9670ddee1b35c8bc966763 | ||
DIST v2rayA-2.2.4.1.tar.gz 1037928 BLAKE2B 92bafa856f529d6c2910ccfb597d78f4011edf6582cc0a576946af4c30feb15a0fa6dd5da266051d617d11114eb1bf5c8fb9f5f95de86f2229b9777ae2966a39 SHA512 c203c45b01fe822d2b42b84e47b8206f7106bef3270a9658f946ad67f95747b910fe24211ff4cb113a3b8b61b592ddc88f63ee2be67a9fd1e0aa3ac55e0b0d6c | ||
DIST v2rayA-2.2.4.3-vendor.tar.xz 5459780 BLAKE2B 75ba6a7ca5972544727cfac5b116b8900fd550fb6639e42243a44ccace92f2d5a33669772fe970d9b5cac8cabe3ad48773029fb0039b069ee4f6ac2603df94ca SHA512 62c85ecc85852ee92d6aa4f9757e1d5cf28b14e26d555cdf6c50a671d8d47f5009bd000c360081e005e2894e2ddf318873652f9b43c4d97a98ba5eac480ae120 | ||
DIST v2rayA-2.2.4.3-web.tar.gz 2798282 BLAKE2B ab3731636a3314e2e113a96c8e664f6a48ac08db7ef19bafeffdfda49334d4c66e940a6eb1d67137c3ed6e953f9a1cadd354334fcaebf464f1edb2cb47beca87 SHA512 2862be8f0703d6f2557f961a8a355639c0aa0cfe7d82d5815bce48d7f5776036f6eba87676140e01c33592d86636ef9111d7c3e7db02a5ea1ec61c3aa84ef216 | ||
DIST v2rayA-2.2.4.3.tar.gz 1039280 BLAKE2B a3b64d8a1d184e6e40b77d152eb0be8c276137c779ab69e74529a3dd274128bd67beb1434777dffe9cdd480210d8e64876352471827529420197a38ec03b24d5 SHA512 6327970910a73413a210489a57afb3e0c4ff7700b67eabb9be2f68d72539a3f84cd39b56710b1cb9654eb934dfdaeea8eb1d70c2446f326fab13d7ce31b41710 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright 2022-2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
inherit systemd go-module desktop xdg | ||
|
||
DESCRIPTION="web GUI of Project V which supports V2Ray, Xray, SS, SSR, Trojan and Pingtunnel" | ||
HOMEPAGE="https://v2raya.org/" | ||
|
||
SRC_URI=" | ||
https://github.com/v2rayA/v2rayA/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz | ||
https://github.com/v2rayA/v2rayA/releases/download/v${PV}/web.tar.gz -> ${P}-web.tar.gz | ||
" | ||
# maintainer generated vendor | ||
# generated with liuyujielol/gentoo-go-deps/.github/workflows/generator.yml | ||
SRC_URI+=" | ||
https://github.com/liuyujielol/gentoo-go-deps/releases/download/${P}/${P}-vendor.tar.xz | ||
" | ||
|
||
LICENSE="AGPL-3" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
IUSE="xray" | ||
RESTRICT="mirror" | ||
|
||
RDEPEND=" | ||
|| ( | ||
>=net-proxy/v2ray-5 | ||
>=net-proxy/v2ray-bin-5 | ||
) | ||
xray? ( net-proxy/Xray ) | ||
" | ||
BDEPEND=" | ||
>=dev-lang/go-1.21:* | ||
" | ||
|
||
src_unpack() { | ||
default | ||
|
||
# go vendor | ||
mv -v "${WORKDIR}/vendor" "${S}/service" || die | ||
} | ||
|
||
src_compile() { | ||
mv -v "${WORKDIR}/web" "${S}/service/server/router/web" || die | ||
|
||
for file in $(find "${S}/service/server/router/web" |grep -v png |grep -v index.html|grep -v .gz) | ||
do | ||
if [ ! -d $file ];then | ||
einfo "compress $file" | ||
gzip -9 $file | ||
fi | ||
done | ||
|
||
cd "${S}/service" || die | ||
ego build -mod vendor -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=${PV} -s -w" -o v2raya | ||
} | ||
|
||
src_install() { | ||
dobin "${S}"/service/v2raya | ||
# directory for runtime use | ||
keepdir "/etc/v2raya" | ||
|
||
./service/v2raya --report config | sed '1,6d' | fold -s -w 78 | sed -E 's/^([^#].+)/# \1/'\ | ||
>> "${S}"/install/universal/v2raya.default || die | ||
|
||
# config /etc/default/v2raya | ||
insinto "/etc/default" | ||
newins "${S}"/install/universal/v2raya.default v2raya | ||
|
||
systemd_dounit "${S}"/install/universal/v2raya.service | ||
systemd_douserunit "${S}"/install/universal/v2raya-lite.service | ||
|
||
#thanks to @Universebenzene | ||
newinitd "${FILESDIR}/${PN}.initd" v2raya | ||
newinitd "${FILESDIR}/${PN}-user.initd" v2raya-user | ||
newconfd "${FILESDIR}/${PN}.confd" v2raya | ||
newconfd "${FILESDIR}/${PN}-user.confd" v2raya-user | ||
|
||
doicon -s 512 "${S}"/install/universal/v2raya.png | ||
domenu "${S}"/install/universal/v2raya.desktop | ||
} | ||
|
||
pkg_postinst() { | ||
xdg_pkg_postinst | ||
|
||
if has_version '<net-proxy/v2rayA-2.0.0' ; then | ||
elog "Starting from net-proxy/v2rayA-2.0.0" | ||
elog "Support for v2ray-4 has been dropped" | ||
elog "A config migration may be required" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters