new package: v2ray

This commit is contained in:
Tee KOBAYASHI 2022-02-17 18:26:42 +09:00 committed by xtkoba
parent 0e8422d5a2
commit b4b1b02383
2 changed files with 34 additions and 0 deletions

19
packages/v2ray/build.sh Normal file
View File

@ -0,0 +1,19 @@
TERMUX_PKG_HOMEPAGE=https://www.v2fly.org/
TERMUX_PKG_DESCRIPTION="A platform for building proxies to bypass network restrictions"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.0.3
TERMUX_PKG_SRCURL=https://github.com/v2fly/v2ray-core.git
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make() {
termux_setup_golang
go mod init || :
go mod tidy
go build -o v2ray ./main
}
termux_step_make_install() {
install -Dm700 -t $TERMUX_PREFIX/bin v2ray
install -Dm600 -t $TERMUX_PREFIX/share/v2ray release/config/*.json
}

View File

@ -0,0 +1,15 @@
--- a/common/platform/others.go
+++ b/common/platform/others.go
@@ -31,9 +31,9 @@
defPath := filepath.Join(assetPath, file)
for _, p := range []string{
defPath,
- filepath.Join("/usr/local/share/v2ray/", file),
- filepath.Join("/usr/share/v2ray/", file),
- filepath.Join("/opt/share/v2ray/", file),
+ filepath.Join("@TERMUX_PREFIX@/local/share/v2ray/", file),
+ filepath.Join("@TERMUX_PREFIX@/share/v2ray/", file),
+ filepath.Join("@TERMUX_PREFIX@/opt/v2ray/share/", file),
} {
if _, err := os.Stat(p); err != nil && errors.Is(err, fs.ErrNotExist) {
continue