1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00

Update golang and v2ray

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-11-26 19:17:03 +01:00
parent 62584c32ce
commit cac91f628b
8 changed files with 457 additions and 25 deletions

View file

@ -246,12 +246,10 @@ define GoPackage/Build/Compile
mips|mipsle) installsuffix="-installsuffix $(GO_MIPS)" ;; \
mips64|mips64le) installsuffix="-installsuffix $(GO_MIPS64)" ;; \
esac ; \
trimpath="all=-trimpath=$(GO_PKG_BUILD_DIR)" ; \
ldflags="all=-linkmode external -extldflags '$(TARGET_LDFLAGS)'" ; \
go install \
$$$$installsuffix \
-gcflags "$$$$trimpath" \
-asmflags "$$$$trimpath" \
-trimpath \
-ldflags "$$$$ldflags" \
-v \
$(1) \

View file

@ -25,6 +25,7 @@ unexport \
CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \
BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC
# there are more magic environment variables to track down, but ain't nobody got time for that
# deliberately left untouched: GOPROXY GONOPROXY GOSUMDB GONOSUMDB GOPRIVATE
go_arch=$(subst \
aarch64,arm64,$(subst \

View file

@ -10,5 +10,5 @@ ifeq ($(origin GO_INCLUDE_DIR),undefined)
endif
GO_VERSION_MAJOR_MINOR:=1.12
GO_VERSION_PATCH:=7
GO_VERSION_MAJOR_MINOR:=1.13
GO_VERSION_PATCH:=4

View file

@ -18,7 +18,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=95e8447d6f04b8d6a62de1726defbb20ab203208ee167ed15f83d7978ce43b13
PKG_HASH:=95dbeab442ee2746b9acf0934c8e2fc26414a0565c008631b04addb8c02e7624
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE

View file

@ -32,7 +32,8 @@ define Package/v2ray-plugin
TITLE:=SIP003 plugin for shadowsocks, based on v2ray
URL:=https://github.com/shadowsocks/v2ray-plugin
DEPENDS:=$(GO_ARCH_DEPENDS) \
+golang-protobuf-dev +v2ray-core-dev +v2ray-ext-dev +golang-golang-x-crypto-dev
+golang-protobuf-dev +v2ray-core +v2ray-ext-dev +golang-golang-x-crypto-dev
# +golang-protobuf-dev +v2ray-core-dev +v2ray-ext-dev +golang-golang-x-crypto-dev
endef
define Package/v2ray-plugin/description

149
v2ray-core/Config.in Normal file
View file

@ -0,0 +1,149 @@
menu "V2Ray Configuration"
depends on PACKAGE_v2ray-core
choice
prompt "JSON Config Support"
default V2RAY_JSON_V2CTL
config V2RAY_JSON_V2CTL
bool "Load JSON from V2Ctl"
config V2RAY_JSON_INTERNAL
bool "Load JSON Internally"
config V2RAY_JSON_NONE
bool "None"
endchoice
config V2RAY_EXCLUDE_V2CTL
bool "Exclude V2Ctl"
depends on V2RAY_JSON_INTERNAL || V2RAY_JSON_NONE
default n
config V2RAY_EXCLUDE_ASSETS
bool "Exclude geoip.dat & geosite.dat"
default n
config V2RAY_COMPRESS_UPX
bool "Compress executable files with UPX"
default n
choice
prompt "Disable Features"
default V2RAY_DISABLE_NONE
config V2RAY_DISABLE_NONE
bool "None"
config V2RAY_DISABLE_CUSTOM
bool "Custom"
endchoice
config V2RAY_DISABLE_DNS
bool "Disable Internal DNS Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_LOG
bool "Disable Log Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_POLICY
bool "Disable Local Policy Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_REVERSE
bool "Disable Reverse Proxy Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_ROUTING
bool "Disable Internal Routing Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_STATISTICS
bool "Disable Statistics Support"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_BLACKHOLE_PROTO
bool "Disable Blackhole Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_DNS_PROXY
bool "Disable DNS Proxy"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_DOKODEMO_PROTO
bool "Disable Dokodemo-door Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_FREEDOM_PROTO
bool "Disable Freedom Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_MTPROTO_PROXY
bool "Disable MTProto Proxy"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_HTTP_PROTO
bool "Disable HTTP Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_SHADOWSOCKS_PROTO
bool "Disable Shadowsocks Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_SOCKS_PROTO
bool "Disable Socks Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_VMESS_PROTO
bool "Disable VMess Protocol"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_TCP_TRANS
bool "Disable TCP Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_MKCP_TRANS
bool "Disable mKCP Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_WEBSOCKET_TRANS
bool "Disable WebSocket Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_HTTP2_TRANS
bool "Disable HTTP/2 Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_DOMAIN_SOCKET_TRANS
bool "Disable Domain Socket Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
config V2RAY_DISABLE_QUIC_TRANS
bool "Disable QUIC Transport"
depends on V2RAY_DISABLE_CUSTOM
default n
endmenu

21
v2ray-core/LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Xingwang Liao
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,5 +1,5 @@
#
# Copyright (C) 2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
# Copyright (C) 2019 Xingwang Liao
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,36 +8,298 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-core
PKG_VERSION:=4.21.3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/v2ray/v2ray-core.git
PKG_SOURCE_VERSION:=44aafae19edd99583150aacfd9269fabb3ea1828
PKG_SOURCE_DATE:=20191121
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/v2ray/v2ray-core/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=2052ea02ec5569b32748e5c859dcd066fa3818d5caafa70ddaf216576aaec188
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Xingwang Liao <kuoruan@gmail.com>
PKG_CONFIG_DEPENDS := \
CONFIG_V2RAY_JSON_V2CTL \
CONFIG_V2RAY_JSON_INTERNAL \
CONFIG_V2RAY_JSON_NONE \
CONFIG_V2RAY_EXCLUDE_V2CTL \
CONFIG_V2RAY_EXCLUDE_ASSETS \
CONFIG_V2RAY_COMPRESS_UPX \
CONFIG_V2RAY_DISABLE_NONE \
CONFIG_V2RAY_DISABLE_CUSTOM \
CONFIG_V2RAY_DISABLE_DNS \
CONFIG_V2RAY_DISABLE_LOG \
CONFIG_V2RAY_DISABLE_POLICY \
CONFIG_V2RAY_DISABLE_REVERSE \
CONFIG_V2RAY_DISABLE_ROUTING \
CONFIG_V2RAY_DISABLE_STATISTICS \
CONFIG_V2RAY_DISABLE_BLACKHOLE_PROTO \
CONFIG_V2RAY_DISABLE_DNS_PROXY \
CONFIG_V2RAY_DISABLE_DOKODEMO_PROTO \
CONFIG_V2RAY_DISABLE_FREEDOM_PROTO \
CONFIG_V2RAY_DISABLE_MTPROTO_PROXY \
CONFIG_V2RAY_DISABLE_HTTP_PROTO \
CONFIG_V2RAY_DISABLE_SHADOWSOCKS_PROTO \
CONFIG_V2RAY_DISABLE_SOCKS_PROTO \
CONFIG_V2RAY_DISABLE_VMESS_PROTO \
CONFIG_V2RAY_DISABLE_TCP_TRANS \
CONFIG_V2RAY_DISABLE_MKCP_TRANS \
CONFIG_V2RAY_DISABLE_WEBSOCKET_TRANS \
CONFIG_V2RAY_DISABLE_HTTP2_TRANS \
CONFIG_V2RAY_DISABLE_DOMAIN_SOCKET_TRANS \
CONFIG_V2RAY_DISABLE_QUIC_TRANS
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=v2ray.com/core
GO_PKG_SOURCE_ONLY:=1
GO_PKG_LDFLAGS:=-s -w
include $(INCLUDE_DIR)/package.mk
include ../golang/golang-package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/v2ray-core-dev
$(call GoPackage/GoSubMenu)
TITLE:=Go support for Google protocol buffers
URL:=https://github.com/golang/protobuf
DEPENDS:=$(GO_ARCH_DEPENDS) +protobuf
PKGARCH:=all
define Package/v2ray-core
TITLE:=A platform for building proxies
URL:=https://www.v2ray.com
SECTION:=net
CATEGORY:=Network
SUBMENU:=Project V
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
define Package/v2ray-core-dev/description
Go support for Google protocol buffers
define Package/v2ray-core/config
source "$(SOURCE)/Config.in"
endef
$(eval $(call GoSrcPackage,v2ray-core-dev))
$(eval $(call BuildPackage,v2ray-core-dev))
define Package/v2ray-core/description
Project V is a set of network tools that help you to build your own computer network.
It secures your network connections and thus protects your privacy.
This package contains v2ray, v2ctl and v2ray-assets.
endef
V2RAY_SED_ARGS:=
ifeq ($(CONFIG_V2RAY_JSON_INTERNAL),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/main\/json"/\/\/ &/; \
/\/\/ _ "v2ray.com\/core\/main\/jsonem"/s/\/\/ //;
else ifeq ($(CONFIG_V2RAY_JSON_NONE),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/main\/json"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_CUSTOM),y)
ifeq ($(CONFIG_V2RAY_DISABLE_DNS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/dns"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_LOG),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/log"/\/\/ &/; \
s/_ "v2ray.com\/core\/app\/log\/command"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_POLICY),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/policy"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_REVERSE),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/reverse"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_ROUTING),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/router"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_STATISTICS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/app\/stats"/\/\/ &/; \
s/_ "v2ray.com\/core\/app\/stats\/command"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_BLACKHOLE_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/blackhole"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_DNS_PROXY),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/dns"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_DOKODEMO_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/dokodemo"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_FREEDOM_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/freedom"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_MTPROTO_PROXY),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/mtproto"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_HTTP_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/http"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_SHADOWSOCKS_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/shadowsocks"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_SOCKS_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/socks"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_VMESS_PROTO),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/proxy\/vmess\/inbound"/\/\/ &/; \
s/_ "v2ray.com\/core\/proxy\/vmess\/outbound"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_TCP_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/tcp"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_MKCP_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/kcp"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_WEBSOCKET_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/websocket"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_HTTP2_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/http"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/http"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_DOMAIN_SOCKET_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/domainsocket"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_QUIC_TRANS),y)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/quic"/\/\/ &/;
endif
ifeq ($(CONFIG_V2RAY_DISABLE_MKCP_TRANS)$(CONFIG_V2RAY_DISABLE_QUIC_TRANS),yy)
V2RAY_SED_ARGS += \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/noop"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/srtp"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/tls"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/utp"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/wechat"/\/\/ &/; \
s/_ "v2ray.com\/core\/transport\/internet\/headers\/wireguard"/\/\/ &/;
endif
endif
GEOIP_VER:=latest
GEOIP_FILE:=geoip-$(GEOIP_VER).dat
define Download/geoip.dat
URL:=https://github.com/v2ray/geoip/releases/$(GEOIP_VER)/download
URL_FILE:=geoip.dat
FILE:=$(GEOIP_FILE)
HASH:=skip
endef
GEOSITE_VER:=latest
GEOSITE_FILE:=geosite-$(GEOSITE_VER).dat
define Download/geosite.dat
URL:=https://github.com/v2ray/domain-list-community/releases/$(GEOSITE_VER)/download
URL_FILE:=dlc.dat
FILE:=$(GEOSITE_FILE)
HASH:=skip
endef
define Build/Prepare
$(Build/Prepare/Default)
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
# move file to make sure download new file every build
mv -f $(DL_DIR)/$(GEOIP_FILE) $(PKG_BUILD_DIR)/release/config/geoip.dat
mv -f $(DL_DIR)/$(GEOSITE_FILE) $(PKG_BUILD_DIR)/release/config/geosite.dat
endif
( \
sed -i \
's/\(version[[:space:]]*=[[:space:]]*"\).*\("\)/\1$(PKG_VERSION)\2/; \
s/\(build[[:space:]]*=[[:space:]]*"\).*\("\)/\1OpenWrt R$(PKG_RELEASE)\2/' \
$(PKG_BUILD_DIR)/core.go ; \
)
ifneq ($(V2RAY_SED_ARGS),)
( \
sed -i \
'$(V2RAY_SED_ARGS)' \
$(PKG_BUILD_DIR)/main/distro/all/all.go ; \
)
endif
endef
define Build/Compile
$(eval GO_PKG_BUILD_PKG:=v2ray.com/core/main)
$(call GoPackage/Build/Compile)
mv -f $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ray
ifeq ($(CONFIG_V2RAY_COMPRESS_UPX),y)
upx --ultra-brute $(GO_PKG_BUILD_BIN_DIR)/v2ray
endif
ifneq ($(CONFIG_V2RAY_EXCLUDE_V2CTL),y)
$(eval GO_PKG_BUILD_PKG:=v2ray.com/core/infra/control/main)
$(call GoPackage/Build/Compile)
mv -f $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ctl
ifeq ($(CONFIG_V2RAY_COMPRESS_UPX),y)
upx --ultra-brute $(GO_PKG_BUILD_BIN_DIR)/v2ctl
endif
endif
endef
define Package/v2ray-core/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ray $(1)/usr/bin
ifneq ($(CONFIG_V2RAY_EXCLUDE_V2CTL),y)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ctl $(1)/usr/bin
endif
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/release/config/{geoip,geosite}.dat \
$(1)/usr/bin
endif
endef
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
$(eval $(call Download,geoip.dat))
$(eval $(call Download,geosite.dat))
endif
$(eval $(call GoBinPackage,v2ray-core))
$(eval $(call BuildPackage,v2ray-core))