summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkinoKaede2020-12-03 23:08:54 +0800
committerAkinoKaede2020-12-03 23:08:54 +0800
commitdd3fcb8129e8e8cf2474d3908a5ac1dd69bf34e6 (patch)
tree2656ef6cfb069a2e6a445fc0d7003b59988c0451
parentca19ed8f1106c84f030a60386f5226e217bf820f (diff)
downloadaur-dd3fcb8129e8e8cf2474d3908a5ac1dd69bf34e6.tar.gz
patch location asset
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD46
-rw-r--r--location_asset.patch9
-rw-r--r--xray.service1
-rw-r--r--xray@.service1
5 files changed, 41 insertions, 25 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a16a3940bea0..94dd167404eb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,13 @@
pkgbase = xray-git
pkgdesc = The best v2ray-core, with XTLS support.
- pkgver = 1.0.0.r6.872b1b2
+ pkgver = 1.0.0.r8.ed8d6d7
pkgrel = 1
url = https://github.com/XTLS/Xray-core
arch = x86_64
license = MPLv2
makedepends = go
makedepends = git
+ makedepends = patch
depends = glibc
depends = v2ray-domain-list-community
depends = v2ray-geoip
@@ -19,12 +20,14 @@ pkgbase = xray-git
source = vpoint_vmess_freedom.json
source = xray.service
source = xray@.service
+ source = location_asset.patch
sha512sums = SKIP
sha512sums = 2000211cbf987adaee7f278cc8cb23268965caab3bc46401f9324f2beaad95bec11012f5f4500f1016f4b75f097f3ac96cc5be2da7a6df0261582b3f23b3d78d
sha512sums = 9914fd3da02511b716951e521ca22006a6e8ad66e64d32cc7dd7dc3544a754174b37e35df6108ca217130f02763265d74f8bc56c4e52b262bdd48dcdb5310eb5
sha512sums = 532f66fe19196de0cc43df1812d6f32cbca7bbcacaa0cd4141bd80b3121b17eb8b23e0464765cf05a97b11e0213fb688eade83e393e36b3e7ebded6f0925de97
- sha512sums = f5ea93fab3a108ee30bbf9ac6f611df0397809f0c63c6bdb79dde60a49c3be175b4c915bd4d26313fbd2703b73f3a28f3e158352c521d1173baac219df73300d
- sha512sums = 7c96cbea8d8e34d2458c3aeb31b03e9f322e3774193e0458f003f2336c7ff39b65a94840942f09b7c5e96287c74cdd8b7b96717e38ff230161ad887d34a86d8f
+ sha512sums = 1d31e11c3a11090ee2616adfcf77a4a1013793c8f63a41e5293d07e889e34f85223b9f5a0791b649f22ecc5e18e12182b5b074e61aa36f5cd6de523f3c64f95d
+ sha512sums = 6582aa9bf988acb2660a7172282768c217ad8335a55ccee916d7786c227bc62cc973d7d6d3b5632260c69eec98c15804c2b52cdd91c5f395d3a0fe36519586b4
+ sha512sums = 3fc64f9980fb9d5ceedf6c77fa88abcbf9c3ca15189de7f4e5e319d525591d7049676b8a89e9ef1341ed3ba198041539db4fe37338bab4df9f9b7594f77b36b6
pkgname = xray-git
diff --git a/PKGBUILD b/PKGBUILD
index c11178c2c124..d3835d91b76a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,14 @@
# Contributor: pandada8 <pandada8@gmail.com>
pkgname=xray-git
-pkgver=1.0.0.r6.872b1b2
+pkgver=1.0.0.r8.ed8d6d7
pkgrel=1
pkgdesc="The best v2ray-core, with XTLS support."
arch=('x86_64')
url="https://github.com/XTLS/Xray-core"
license=('MPLv2')
depends=('glibc' 'v2ray-domain-list-community' 'v2ray-geoip')
-makedepends=('go' 'git')
+makedepends=('go' 'git' 'patch')
backup=(etc/xray/config.json)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
@@ -21,14 +21,16 @@ source=(
"vpoint_vmess_freedom.json"
"xray.service"
"xray@.service"
+ "location_asset.patch"
)
sha512sums=(
'SKIP'
'2000211cbf987adaee7f278cc8cb23268965caab3bc46401f9324f2beaad95bec11012f5f4500f1016f4b75f097f3ac96cc5be2da7a6df0261582b3f23b3d78d'
'9914fd3da02511b716951e521ca22006a6e8ad66e64d32cc7dd7dc3544a754174b37e35df6108ca217130f02763265d74f8bc56c4e52b262bdd48dcdb5310eb5'
'532f66fe19196de0cc43df1812d6f32cbca7bbcacaa0cd4141bd80b3121b17eb8b23e0464765cf05a97b11e0213fb688eade83e393e36b3e7ebded6f0925de97'
- 'f5ea93fab3a108ee30bbf9ac6f611df0397809f0c63c6bdb79dde60a49c3be175b4c915bd4d26313fbd2703b73f3a28f3e158352c521d1173baac219df73300d'
- '7c96cbea8d8e34d2458c3aeb31b03e9f322e3774193e0458f003f2336c7ff39b65a94840942f09b7c5e96287c74cdd8b7b96717e38ff230161ad887d34a86d8f'
+ '1d31e11c3a11090ee2616adfcf77a4a1013793c8f63a41e5293d07e889e34f85223b9f5a0791b649f22ecc5e18e12182b5b074e61aa36f5cd6de523f3c64f95d'
+ '6582aa9bf988acb2660a7172282768c217ad8335a55ccee916d7786c227bc62cc973d7d6d3b5632260c69eec98c15804c2b52cdd91c5f395d3a0fe36519586b4'
+ '3fc64f9980fb9d5ceedf6c77fa88abcbf9c3ca15189de7f4e5e319d525591d7049676b8a89e9ef1341ed3ba198041539db4fe37338bab4df9f9b7594f77b36b6'
)
pkgver() {
@@ -36,27 +38,31 @@ pkgver() {
printf "%s" "$(git describe --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}
+prepare() {
+ patch "${srcdir}"/Xray-core/common/platform/others.go "${srcdir}"/location_asset.patch
+}
+
build() {
- cd "${srcdir}"/Xray-core
- export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external"
- export CGO_LDFLAGS="${LDFLAGS}"
- export CGO_CFLAGS="${CFLAGS}"
- export CGO_CPPFLAGS="${CPPFLAGS}"
- go build -o xray ./main
+ cd "${srcdir}"/Xray-core
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ go build -o xray ./main
}
check() {
- cd "${srcdir}"/Xray-core
- go test -p 1 -tags json -v -timeout 30m github.com/xtls/xray-core/v1/core/...
+ cd "${srcdir}"/Xray-core
+ go test -p 1 -tags json -v -timeout 30m github.com/xtls/xray-core/v1/core/...
}
package() {
- cd "${srcdir}"
- install -Dm644 xray.service "${pkgdir}"/usr/lib/systemd/system/xray.service
- install -Dm644 xray@.service "${pkgdir}"/usr/lib/systemd/system/xray@.service
- install -Dm644 *.json -t "${pkgdir}"/etc/xray/
-
- cd "${srcdir}"/Xray-core
- install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/xray/LICENSE
- install -Dm755 xray -t "${pkgdir}"/usr/bin/
+ cd "${srcdir}"
+ install -Dm644 xray.service "${pkgdir}"/usr/lib/systemd/system/xray.service
+ install -Dm644 xray@.service "${pkgdir}"/usr/lib/systemd/system/xray@.service
+ install -Dm644 *.json -t "${pkgdir}"/etc/xray/
+
+ cd "${srcdir}"/Xray-core
+ install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/xray/LICENSE
+ install -Dm755 xray -t "${pkgdir}"/usr/bin/
}
diff --git a/location_asset.patch b/location_asset.patch
new file mode 100644
index 000000000000..7bf4aaff8679
--- /dev/null
+++ b/location_asset.patch
@@ -0,0 +1,9 @@
+@@ -30,6 +30,8 @@
+ defPath,
+ filepath.Join("/usr/local/share/xray/", file),
+ filepath.Join("/usr/share/xray/", file),
++ filepath.Join("/usr/local/share/v2ray/", file),
++ filepath.Join("/usr/share/v2ray/", file),
+ } {
+ if _, err := os.Stat(p); os.IsNotExist(err) {
+ continue
diff --git a/xray.service b/xray.service
index f4215d9be8ba..77889293c647 100644
--- a/xray.service
+++ b/xray.service
@@ -8,7 +8,6 @@ User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
-Environment=XRAY_LOCATION_ASSET=/usr/share/v2ray
ExecStart=/usr/bin/xray run -config /etc/xray/config.json
Restart=on-failure
RestartPreventExitStatus=23
diff --git a/xray@.service b/xray@.service
index bbb0461171ae..c7563486d112 100644
--- a/xray@.service
+++ b/xray@.service
@@ -8,7 +8,6 @@ User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
-Environment=XRAY_LOCATION_ASSET=/usr/share/v2ray
ExecStart=/usr/bin/xray run -config /etc/xray/%i.json
Restart=on-failure
RestartPreventExitStatus=23