commit: 08a9fe7627ad11836d5fca1631d93dcd42f039f5 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me> AuthorDate: Mon Feb 2 21:58:07 2026 +0000 Commit: Alexander Tsoy <alexander <AT> tsoy <DOT> me> CommitDate: Mon Feb 2 22:06:47 2026 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=08a9fe76
net-proxy/xray-core: new package, add 26.2.2, 9999 Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me> net-proxy/xray-core/Manifest | 2 + net-proxy/xray-core/files/xray.service | 14 ++++++ net-proxy/xray-core/files/xray_at.service | 14 ++++++ net-proxy/xray-core/metadata.xml | 14 ++++++ net-proxy/xray-core/xray-core-26.2.2.ebuild | 78 +++++++++++++++++++++++++++++ net-proxy/xray-core/xray-core-9999.ebuild | 78 +++++++++++++++++++++++++++++ 6 files changed, 200 insertions(+) diff --git a/net-proxy/xray-core/Manifest b/net-proxy/xray-core/Manifest new file mode 100644 index 0000000000..0fa29b63d7 --- /dev/null +++ b/net-proxy/xray-core/Manifest @@ -0,0 +1,2 @@ +DIST Xray-core-26.2.2-vendor.tar.xz 3479180 BLAKE2B c7e0bcaec911a138d09ef7bb16ec8d532780d066a46c190cef3bbb643a7afbbeb12d6f03aa8affecea60d09a5432cfcdb39013db291bf9940a3aec4ad62b6605 SHA512 142a113580a5fa08d45f33d26198b4e5a57e33897f61ac72538e9d0f0969bf30c0984205c7e9d57c3e31cbd3444b9cb9b7e19f5b21cd37f3c3ac59f093a982e0 +DIST xray-core-26.2.2.tar.gz 801580 BLAKE2B 64f08a1531d2d926c66085192c3c6aa1620fec8f5dce306c105195b866be54ee1ce5ecd5ed845ac6358854c3dd6b94652e765759a66509f7823cc902f8a44587 SHA512 c621fa13c755b7ab9ed81ce3480db48142c1b76b1cd94c10efb78dd0e1f147d42f4ea0e222e743449f87abcd660557b90e26ea453c6d58d1355b6481f7e4241a diff --git a/net-proxy/xray-core/files/xray.service b/net-proxy/xray-core/files/xray.service new file mode 100644 index 0000000000..2c24daa71b --- /dev/null +++ b/net-proxy/xray-core/files/xray.service @@ -0,0 +1,14 @@ +[Unit] +Description=Xray Service +After=network.target nss-lookup.target + +[Service] +User=xray +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +NoNewPrivileges=true +ExecStart=/usr/bin/xray run -confdir /etc/xray/ +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/net-proxy/xray-core/files/xray_at.service b/net-proxy/xray-core/files/xray_at.service new file mode 100644 index 0000000000..145bdd9721 --- /dev/null +++ b/net-proxy/xray-core/files/xray_at.service @@ -0,0 +1,14 @@ +[Unit] +Description=Xray Service +After=network.target nss-lookup.target + +[Service] +User=xray +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +NoNewPrivileges=true +ExecStart=/usr/bin/xray run -config /etc/xray/%i.jsonc +Restart=on-abort + +[Install] +WantedBy=multi-user.target diff --git a/net-proxy/xray-core/metadata.xml b/net-proxy/xray-core/metadata.xml new file mode 100644 index 0000000000..acda1edaca --- /dev/null +++ b/net-proxy/xray-core/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Alexander Tsoy</name> + </maintainer> + <longdescription lang="en"> + Project X originates from XTLS protocol, providing a set of network tools such as Xray-core and REALITY. + </longdescription> + <upstream> + <remote-id type="github">XTLS/Xray-core</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-proxy/xray-core/xray-core-26.2.2.ebuild b/net-proxy/xray-core/xray-core-26.2.2.ebuild new file mode 100644 index 0000000000..21320d92a0 --- /dev/null +++ b/net-proxy/xray-core/xray-core-26.2.2.ebuild @@ -0,0 +1,78 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +DESCRIPTION="A unified platform for anti-censorship" +HOMEPAGE="https://github.com/XTLS/Xray-core/" + +if [[ "${PV}" == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/XTLS/Xray-core.git" +else + SRC_URI=" + https://github.com/XTLS/Xray-core/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/puleglot/Xray-core/releases/download/v${PV}/Xray-core-${PV}-vendor.tar.xz +" + KEYWORDS="~amd64" + S="${WORKDIR}/Xray-core-${PV}" +fi + +# main +LICENSE="MPL-2.0" +# deps +LICENSE+=" Apache-2.0 BSD BSD-2 ISC LGPL-3 MIT" +SLOT="0" + +RESTRICT="test" + +RDEPEND=" + acct-user/xray + acct-group/xray" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-lang/go-1.25.5:=" + +src_unpack() { + if [[ "${PV}" == 9999* ]]; then + git-r3_src_unpack + pushd "${S}" || die + # upstream bumped required go version to 1.25.6 for no particular reason + # gvisor.dev/gvisor requires 1.25.5 + sed -E -i'' 's/^go 1\.25\..*/go 1.25.5/' go.mod || die + ego mod tidy + popd || die + go-module_live_vendor + else + default + fi +} + +src_prepare() { + # upstream bumped required go version to 1.25.6 for no particular reason + # gvisor.dev/gvisor requires 1.25.5 + sed -E -i'' 's/^go 1\.25\..*/go 1.25.5/' go.mod || die + default +} + +src_compile() { + if [[ ${PV} == 9999* ]]; then + local CUSTOM_VER="$(git rev-parse --short HEAD)" + else + local CUSTOM_VER="${PV}" + fi + + CGO_ENABLED=0 ego build -ldflags="-X github.com/xtls/xray-core/core.build=${CUSTOM_VER}" \ + -trimpath -o xray -v ./main +} + +src_install() { + default + + dobin xray + systemd_dounit "${FILESDIR}"/xray.service + systemd_newunit "${FILESDIR}"/xray_at.service "[email protected]" + + keepdir /etc/xray +} diff --git a/net-proxy/xray-core/xray-core-9999.ebuild b/net-proxy/xray-core/xray-core-9999.ebuild new file mode 100644 index 0000000000..21320d92a0 --- /dev/null +++ b/net-proxy/xray-core/xray-core-9999.ebuild @@ -0,0 +1,78 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +DESCRIPTION="A unified platform for anti-censorship" +HOMEPAGE="https://github.com/XTLS/Xray-core/" + +if [[ "${PV}" == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/XTLS/Xray-core.git" +else + SRC_URI=" + https://github.com/XTLS/Xray-core/archive/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/puleglot/Xray-core/releases/download/v${PV}/Xray-core-${PV}-vendor.tar.xz +" + KEYWORDS="~amd64" + S="${WORKDIR}/Xray-core-${PV}" +fi + +# main +LICENSE="MPL-2.0" +# deps +LICENSE+=" Apache-2.0 BSD BSD-2 ISC LGPL-3 MIT" +SLOT="0" + +RESTRICT="test" + +RDEPEND=" + acct-user/xray + acct-group/xray" +DEPEND="${RDEPEND}" +BDEPEND=">=dev-lang/go-1.25.5:=" + +src_unpack() { + if [[ "${PV}" == 9999* ]]; then + git-r3_src_unpack + pushd "${S}" || die + # upstream bumped required go version to 1.25.6 for no particular reason + # gvisor.dev/gvisor requires 1.25.5 + sed -E -i'' 's/^go 1\.25\..*/go 1.25.5/' go.mod || die + ego mod tidy + popd || die + go-module_live_vendor + else + default + fi +} + +src_prepare() { + # upstream bumped required go version to 1.25.6 for no particular reason + # gvisor.dev/gvisor requires 1.25.5 + sed -E -i'' 's/^go 1\.25\..*/go 1.25.5/' go.mod || die + default +} + +src_compile() { + if [[ ${PV} == 9999* ]]; then + local CUSTOM_VER="$(git rev-parse --short HEAD)" + else + local CUSTOM_VER="${PV}" + fi + + CGO_ENABLED=0 ego build -ldflags="-X github.com/xtls/xray-core/core.build=${CUSTOM_VER}" \ + -trimpath -o xray -v ./main +} + +src_install() { + default + + dobin xray + systemd_dounit "${FILESDIR}"/xray.service + systemd_newunit "${FILESDIR}"/xray_at.service "[email protected]" + + keepdir /etc/xray +}
