From: ziggylee0 <ziggylee0@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: xray-1.8.11
Date: Sat, 04 May 2024 14:53:26 +0200 [thread overview]
Message-ID: <20240504125326.7EC6F21286@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-50185@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
There is an updated pull request by ziggylee0 against master on the void-packages repository
https://github.com/ziggylee0/void-packages master
https://github.com/void-linux/void-packages/pull/50185
New package: xray-1.8.11
#### Testing the changes
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- i686
A patch file from https://github.com/void-linux/void-packages/pull/50185.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-50185.patch --]
[-- Type: text/x-diff, Size: 4813 bytes --]
From f3f76bfee7019f17e94ba51941c7cb36892f70a1 Mon Sep 17 00:00:00 2001
From: ziggylee0 <zgglee@proton.me>
Date: Sat, 4 May 2024 09:53:36 +0800
Subject: [PATCH] New package: xray-1.8.11
---
srcpkgs/xray/files/config.json | 18 +++++++++++
srcpkgs/xray/files/xray/run | 4 +++
srcpkgs/xray/patches/update-gvisor.diff | 43 +++++++++++++++++++++++++
srcpkgs/xray/template | 38 ++++++++++++++++++++++
4 files changed, 103 insertions(+)
create mode 100644 srcpkgs/xray/files/config.json
create mode 100644 srcpkgs/xray/files/xray/run
create mode 100644 srcpkgs/xray/patches/update-gvisor.diff
create mode 100644 srcpkgs/xray/template
diff --git a/srcpkgs/xray/files/config.json b/srcpkgs/xray/files/config.json
new file mode 100644
index 00000000000000..30209ffaad8ed9
--- /dev/null
+++ b/srcpkgs/xray/files/config.json
@@ -0,0 +1,18 @@
+{
+ "inbounds": [{
+ "port": 9000,
+ "protocol": "vmess",
+ "settings": {
+ "clients": [
+ {
+ "id": "1eb6e917-774b-4a84-aff6-b058577c60a5",
+ "level": 1
+ }
+ ]
+ }
+ }],
+ "outbounds": [{
+ "protocol": "freedom",
+ "settings": {}
+ }]
+}
diff --git a/srcpkgs/xray/files/xray/run b/srcpkgs/xray/files/xray/run
new file mode 100644
index 00000000000000..1598e03bd2610f
--- /dev/null
+++ b/srcpkgs/xray/files/xray/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+exec 2>&1
+
+exec chpst -u _xray xray -c /etc/xray.json 2>&1
diff --git a/srcpkgs/xray/patches/update-gvisor.diff b/srcpkgs/xray/patches/update-gvisor.diff
new file mode 100644
index 00000000000000..07277629aa712a
--- /dev/null
+++ b/srcpkgs/xray/patches/update-gvisor.diff
@@ -0,0 +1,43 @@
+"gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489" can only get from proxy.golang.org by archive now, it's not in git anymore.
+so update it to fit any other proxy servers.
+
+
+diff --git a/go.mod b/go.mod
+index 91c1ef0..e55675d 100644
+--- a/go.mod
++++ b/go.mod
+@@ -29,7 +29,7 @@ require (
+ golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
+ google.golang.org/grpc v1.63.2
+ google.golang.org/protobuf v1.33.0
+- gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489
++ gvisor.dev/gvisor v0.0.0-20240430175013-479de5f2c545
+ h12.io/socks v1.0.3
+ lukechampine.com/blake3 v1.2.2
+ )
+diff --git a/proxy/wireguard/gvisortun/tun.go b/proxy/wireguard/gvisortun/tun.go
+index 9e9a0b2..65677c4 100644
+--- a/proxy/wireguard/gvisortun/tun.go
++++ b/proxy/wireguard/gvisortun/tun.go
+@@ -157,7 +157,7 @@ func (tun *netTun) Write(buf [][]byte, offset int) (int, error) {
+ // WriteNotify implements channel.Notification
+ func (tun *netTun) WriteNotify() {
+ pkt := tun.ep.Read()
+- if pkt.IsNil() {
++ if pkt == nil {
+ return
+ }
+
+diff --git a/proxy/wireguard/tun.go b/proxy/wireguard/tun.go
+index c2d3032..dc9d212 100644
+--- a/proxy/wireguard/tun.go
++++ b/proxy/wireguard/tun.go
+@@ -194,7 +194,7 @@ func createGVisorTun(localAddresses []netip.Addr, mtu int, handler promiscuousMo
+ Timeout: 15 * time.Second,
+ })
+
+- handler(xnet.UDPDestination(xnet.IPAddress(id.LocalAddress.AsSlice()), xnet.Port(id.LocalPort)), gonet.NewUDPConn(stack, &wq, ep))
++ handler(xnet.UDPDestination(xnet.IPAddress(id.LocalAddress.AsSlice()), xnet.Port(id.LocalPort)), gonet.NewUDPConn(&wq, ep))
+ }(r)
+ })
+ stack.SetTransportProtocolHandler(udp.ProtocolNumber, udpForwarder.HandlePacket)
diff --git a/srcpkgs/xray/template b/srcpkgs/xray/template
new file mode 100644
index 00000000000000..955533d9d0912a
--- /dev/null
+++ b/srcpkgs/xray/template
@@ -0,0 +1,38 @@
+# Template file for 'xray'
+pkgname=xray
+version=1.8.11
+revision=1
+build_style=go
+go_import_path=github.com/xtls/xray-core
+go_package="${go_import_path}/main"
+hostmakedepends="git"
+short_desc="Network proxy tool"
+maintainer="ziggylee0 <zgglee@proton.me>"
+license="MPL-2.0"
+homepage="https://github.com/XTLS/Xray-core"
+distfiles="https://github.com/XTLS/Xray-core/archive/refs/tags/v${version}.tar.gz
+ https://github.com/Loyalsoldier/v2ray-rules-dat/releases/202404302210/download/geosite.dat
+ https://github.com/Loyalsoldier/v2ray-rules-dat/releases/202404302210/download/geoip.dat"
+checksum="d99ee6008c508abbad6bbb242d058b22efb50fb35867d15447a2b4602ab4b283
+ bd819d0e223c431dc405a4141ebbc0828e12a81ff2a0c9289a76f6c4eafed2eb
+ 0352d736c7678bdaa2f8199fdea9f49d60f82fc9b28c58abd593a34f4df87f9e"
+skip_extraction="geosite.dat geoip.dat"
+
+go_ldflags="-X github.com/xtls/xray-core/core.build=${version} -buildid="
+system_accounts="_xray"
+
+pre_build() {
+ go mod tidy
+}
+
+post_install() {
+ vlicense LICENSE
+ vmkdir usr/share/xray
+ vcopy ${XBPS_SRCDISTDIR}/${pkgname}-${version}/*.dat usr/share/xray/
+ vconf ${FILESDIR}/config.json xray.json
+ vsv xray
+}
+
+do_install() {
+ vbin ${GOPATH}/bin/main xray
+}
next prev parent reply other threads:[~2024-05-04 12:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-04 2:04 [PR PATCH] " ziggylee0
2024-05-04 12:53 ` ziggylee0 [this message]
2024-05-05 1:51 ` [PR PATCH] [Updated] " ziggylee0
2024-05-05 6:41 ` ziggylee0
2024-05-05 13:35 ` ziggylee0
2024-05-05 13:40 ` ziggylee0
2024-05-17 12:46 ` ziggylee0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240504125326.7EC6F21286@inbox.vuxu.org \
--to=ziggylee0@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).