Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: xray-1.8.11
@ 2024-05-03  8:48 ziggylee0
  2024-05-03  8:49 ` [PR PATCH] [Closed]: " ziggylee0
  0 siblings, 1 reply; 3+ messages in thread
From: ziggylee0 @ 2024-05-03  8:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

There is a new 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/50175

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-musl
  -  i686



A patch file from https://github.com/void-linux/void-packages/pull/50175.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-50175.patch --]
[-- Type: text/x-diff, Size: 4775 bytes --]

From 98dc152331fa8d1a81aeb4cd24ba522a80a31fd0 Mon Sep 17 00:00:00 2001
From: zg <zg@fake.org>
Date: Fri, 3 May 2024 16:40:46 +0800
Subject: [PATCH] New package: xray-1.8.11

---
 srcpkgs/xray/files/config.json          | 18 +++++++++++
 srcpkgs/xray/files/xray/run             |  3 ++
 srcpkgs/xray/patches/update-gvisor.diff | 43 +++++++++++++++++++++++++
 srcpkgs/xray/template                   | 38 ++++++++++++++++++++++
 4 files changed, 102 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..2c669694eaf3ca
--- /dev/null
+++ b/srcpkgs/xray/files/xray/run
@@ -0,0 +1,3 @@
+#!/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..d9fc687196dc5b
--- /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="zg <hi@hqxa.cc>"
+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}"
+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
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Closed]: New package: xray-1.8.11
  2024-05-03  8:48 [PR PATCH] New package: xray-1.8.11 ziggylee0
@ 2024-05-03  8:49 ` ziggylee0
  0 siblings, 0 replies; 3+ messages in thread
From: ziggylee0 @ 2024-05-03  8:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

There's a closed pull request on the void-packages repository

New package: xray-1.8.11
https://github.com/void-linux/void-packages/pull/50175

Description:


#### 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-musl
  -  i686



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PR PATCH] New package: xray-1.8.11
@ 2024-05-04  2:04 ziggylee0
  0 siblings, 0 replies; 3+ messages in thread
From: ziggylee0 @ 2024-05-04  2:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

There is a new 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
+}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-04  2:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-03  8:48 [PR PATCH] New package: xray-1.8.11 ziggylee0
2024-05-03  8:49 ` [PR PATCH] [Closed]: " ziggylee0
2024-05-04  2:04 [PR PATCH] " ziggylee0

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).