From 65d12287540c68db1c87a6bdc442735277299752 Mon Sep 17 00:00:00 2001 From: Puqns67 Date: Mon, 29 Apr 2024 14:47:47 +0800 Subject: [PATCH] net-proxy/sing-box: new package, add 1.9.0_rc13 --- net-proxy/sing-box/Manifest | 2 + net-proxy/sing-box/metadata.xml | 27 ++++++++++ net-proxy/sing-box/sing-box-1.9.0_rc13.ebuild | 54 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 net-proxy/sing-box/Manifest create mode 100644 net-proxy/sing-box/metadata.xml create mode 100644 net-proxy/sing-box/sing-box-1.9.0_rc13.ebuild diff --git a/net-proxy/sing-box/Manifest b/net-proxy/sing-box/Manifest new file mode 100644 index 0000000..1a85241 --- /dev/null +++ b/net-proxy/sing-box/Manifest @@ -0,0 +1,2 @@ +DIST sing-box-1.9.0_rc13-vendor.tar.xz 5227952 BLAKE2B 415f328b6146a2bdd7845c3460b3252a1448f47898b1e856b00a8dbd868a8370d596f1243578441c1a07c2a8dc3f78b6ea344cd1d767c06db3b2e32256c9af13 SHA512 79c401bb787864c9d5406efd12ff31fe115db2fb92d127e6038d146a11c1b328797180fadc5e4e0e0e53907394070024832d290834460b7ae31c6e7aa2b12a69 +DIST sing-box-1.9.0_rc13.tar.gz 365341 BLAKE2B 6f9c4a876032309f71b65a4bc594bd42f6f187025c4a882e2ff1b60907867892a50e78843bb1b430818f6213c51e0b9dc7e89c095386ea7e1e86b0671d0e9702 SHA512 882fc25e1079cd6bef61370b6fafeb9fcf2a3664bc0d2a40f2ba0da26a5581e19f0603d8ee6b4e3f9de8ac90e70399dbea0bda521ba7cb8206c3e38caaf41350 diff --git a/net-proxy/sing-box/metadata.xml b/net-proxy/sing-box/metadata.xml new file mode 100644 index 0000000..e0a071a --- /dev/null +++ b/net-proxy/sing-box/metadata.xml @@ -0,0 +1,27 @@ + + + + + me@puqns67.icu + Puqns67 + + + https://sing-box.sagernet.org/ + https://github.com/SagerNet/sing-box/issues + SagerNet/sing-box + + + Build with QUIC support + Build with standard gRPC support + Build with DHCP support + Build with WireGuard support + Build with TLS ECH extension support for TLS outbound + Build with uTLS support for TLS outbound + Build with reality TLS server support + Build with ACME TLS certificate issuer support + Build with Clash API support + Build with V2Ray API support + Build with gVisor support + Build with embedded Tor support + + diff --git a/net-proxy/sing-box/sing-box-1.9.0_rc13.ebuild b/net-proxy/sing-box/sing-box-1.9.0_rc13.ebuild new file mode 100644 index 0000000..776b3fd --- /dev/null +++ b/net-proxy/sing-box/sing-box-1.9.0_rc13.ebuild @@ -0,0 +1,54 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +_PV="${PV/_/-}" +_PV="${_PV/alpha/alpha.}" +_PV="${_PV/beta/beta.}" +_PV="${_PV/rc/rc.}" + +DESCRIPTION="The universal proxy platform." +HOMEPAGE="https://sing-box.sagernet.org/ https://github.com/SagerNet/sing-box" +SRC_URI="https://github.com/SagerNet/sing-box/archive/refs/tags/v${_PV}.tar.gz -> ${P}.tar.gz + https://github.com/Puqns67/gentoo-deps/releases/download/${P}/${P}-vendor.tar.xz" + +S="${WORKDIR}/${PN}-${_PV}" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~riscv" + +IUSE="+quic grpc +dhcp +wireguard +ech +utls +reality +acme +clash-api v2ray-api +gvisor tor" + +RESTRICT="mirror" + +src_compile() { + TAGS="" + if use quic; then TAGS+="with_quic,"; fi + if use grpc; then TAGS+="with_grpc,"; fi + if use dhcp; then TAGS+="with_dhcp,"; fi + if use wireguard; then TAGS+="with_wireguard,"; fi + if use ech; then TAGS+="with_ech,"; fi + if use utls; then TAGS+="with_utls,"; fi + if use reality; then TAGS+="with_reality_server,"; fi + if use acme; then TAGS+="with_acme,"; fi + if use clash-api; then TAGS+="with_clash_api,"; fi + if use v2ray-api; then TAGS+="with_v2ray_api,"; fi + if use gvisor; then TAGS+="with_gvisor,"; fi + if use tor; then TAGS+="with_embedded_tor,"; fi + TAGS="${TAGS%,}" + + ego build -o sing-box -trimpath -tags "${TAGS}" \ + -ldflags "-s -w -X 'github.com/sagernet/sing-box/constant.Version=${PV}' -buildid=" \ + ./cmd/sing-box +} + +src_install() { + dobin sing-box + insinto /etc/sing-box + doins release/config/config.json config.json.example + systemd_dounit release/config/sing-box{,@}.service +}