luci-app-ssr-plus: use KFERMercer's v2ray build
This commit is contained in:
parent
2a7804433f
commit
cf2eb58233
@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-ssr-plus
|
PKG_NAME:=luci-app-ssr-plus
|
||||||
PKG_RELEASE:=133
|
PKG_RELEASE:=135
|
||||||
PKG_VERSION:=1
|
PKG_VERSION:=1
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
@ -9,19 +9,15 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define Package/$(PKG_NAME)/config
|
define Package/$(PKG_NAME)/config
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
|
||||||
bool "Include Shadowsocks New Version"
|
bool "Include Shadowsocks New Version"
|
||||||
default y
|
default y if x86_64
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-core
|
|
||||||
bool "Include v2ray-core"
|
|
||||||
default y
|
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
||||||
bool "Include V2ray"
|
bool "Include V2ray"
|
||||||
default n
|
default y if x86_64
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan
|
||||||
bool "Include Trojan"
|
bool "Include Trojan"
|
||||||
default n
|
default y if x86_64
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||||
bool "Include Kcptun"
|
bool "Include Kcptun"
|
||||||
@ -29,22 +25,21 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
|||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
||||||
bool "Include ShadowsocksR Server"
|
bool "Include ShadowsocksR Server"
|
||||||
default n
|
default y if x86_64
|
||||||
|
|
||||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
||||||
bool "Include ShadowsocksR Socks and Tunnel"
|
bool "Include ShadowsocksR Socks and Tunnel"
|
||||||
default y
|
default y if x86_64
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/luci-app-ssr-plus
|
define Package/luci-app-ssr-plus
|
||||||
SECTION:=luci
|
SECTION:=luci
|
||||||
CATEGORY:=LuCI
|
CATEGORY:=LuCI
|
||||||
SUBMENU:=3. Applications
|
SUBMENU:=3. Applications
|
||||||
TITLE:=SS/SSR/V2Ray LuCI interface
|
TITLE:=SS/SSR/V2Ray/Trojan LuCI interface
|
||||||
PKGARCH:=all
|
PKGARCH:=all
|
||||||
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget \
|
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_v2ray-core:v2ray-core \
|
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
|
||||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
|
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
|
||||||
|
|||||||
@ -1,304 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2019-2020 Xingwang Liao
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=v2ray-core
|
|
||||||
PKG_VERSION:=4.22.1
|
|
||||||
PKG_RELEASE:=4
|
|
||||||
|
|
||||||
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:=31c1934eeac3552c7ab68eac9dc3e964e05f3c743b3733b0b6a0159c495019d6
|
|
||||||
|
|
||||||
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
|
|
||||||
export GO111MODULE=on
|
|
||||||
export GOPROXY=https://goproxy.cn
|
|
||||||
|
|
||||||
GO_PKG:=v2ray.com/core
|
|
||||||
GO_PKG_LDFLAGS:=-s -w
|
|
||||||
GO_PKG_LDFLAGS_X:= \
|
|
||||||
v2ray.com/core.version=$(PKG_VERSION) \
|
|
||||||
v2ray.com/core.build=R$(PKG_RELEASE) \
|
|
||||||
v2ray.com/core.codename=OpenWrt
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
|
||||||
|
|
||||||
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-certificates
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/v2ray-core/config
|
|
||||||
source "$(SOURCE)/Config.in"
|
|
||||||
endef
|
|
||||||
|
|
||||||
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
|
|
||||||
$(call 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
|
|
||||||
|
|
||||||
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 --lzma --best $(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 --lzma --best $(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))
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
menu "V2Ray Configuration"
|
menu "V2Ray Configuration"
|
||||||
depends on PACKAGE_v2ray-core
|
depends on PACKAGE_v2ray
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "JSON Config Support"
|
prompt "JSON Config Support"
|
||||||
@ -1,69 +1,303 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2015-2016 OpenWrt.org
|
# Copyright (C) 2019-2020 Xingwang Liao
|
||||||
|
# Copyright (C) 2019-2020 KFERMercer
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v3.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=v2ray
|
PKG_NAME:=v2ray
|
||||||
PKG_VERSION:=4.21.3
|
PKG_VERSION:=4.22.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=5
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION)
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-core-$(PKG_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://codeload.github.com/v2ray/v2ray-core/tar.gz/v$(PKG_VERSION)?
|
||||||
|
PKG_HASH:=31c1934eeac3552c7ab68eac9dc3e964e05f3c743b3733b0b6a0159c495019d6
|
||||||
|
|
||||||
|
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_LDFLAGS:=-s -w
|
||||||
|
GO_PKG_LDFLAGS_X:= \
|
||||||
|
v2ray.com/core.version=$(PKG_VERSION) \
|
||||||
|
v2ray.com/core.build=R$(PKG_RELEASE) \
|
||||||
|
v2ray.com/core.codename=OpenWrt
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||||
|
|
||||||
define Package/$(PKG_NAME)
|
define Package/v2ray
|
||||||
SECTION:=net
|
TITLE:=A platform for building proxies
|
||||||
CATEGORY:=Network
|
URL:=https://www.v2ray.com
|
||||||
TITLE:=V2Ray is a cross-platform proxy software
|
SECTION:=net
|
||||||
DEPENDS:=+ca-certificates
|
CATEGORY:=Network
|
||||||
URL:=https://github.com/v2ray/v2ray-core
|
SUBMENU:=Project V
|
||||||
|
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/v2ray/config
|
||||||
define Package/$(PKG_NAME)/description
|
source "$(SOURCE)/Config.in"
|
||||||
V2Ray is a cross-platform proxy software
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
V2RAY_BIN:=v2ray
|
define Package/v2ray/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.
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
This package contains v2ray, v2ctl and v2ray-assets.
|
||||||
PKG_ARCH_V2RAY:=amd64
|
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
|
endif
|
||||||
ifeq ($(ARCH),mipsel)
|
|
||||||
PKG_ARCH_V2RAY:=mipsle
|
ifeq ($(CONFIG_V2RAY_DISABLE_CUSTOM),y)
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_V2RAY_DISABLE_DNS),y)
|
||||||
|
V2RAY_SED_ARGS += \
|
||||||
|
s/_ "v2ray.com\/core\/app\/dns"/\/\/ &/;
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),mips)
|
|
||||||
PKG_ARCH_V2RAY:=mips
|
ifeq ($(CONFIG_V2RAY_DISABLE_LOG),y)
|
||||||
|
V2RAY_SED_ARGS += \
|
||||||
|
s/_ "v2ray.com\/core\/app\/log"/\/\/ &/; \
|
||||||
|
s/_ "v2ray.com\/core\/app\/log\/command"/\/\/ &/;
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),i386)
|
|
||||||
PKG_ARCH_V2RAY:=x86
|
ifeq ($(CONFIG_V2RAY_DISABLE_POLICY),y)
|
||||||
|
V2RAY_SED_ARGS += \
|
||||||
|
s/_ "v2ray.com\/core\/app\/policy"/\/\/ &/;
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),arm)
|
|
||||||
PKG_ARCH_V2RAY:=arm
|
ifeq ($(CONFIG_V2RAY_DISABLE_REVERSE),y)
|
||||||
ifneq ($(BOARD),bcm53xx)
|
V2RAY_SED_ARGS += \
|
||||||
V2RAY_BIN:=v2ray_armv7
|
s/_ "v2ray.com\/core\/app\/reverse"/\/\/ &/;
|
||||||
endif
|
|
||||||
ifeq ($(BOARD),kirkwood)
|
|
||||||
V2RAY_BIN:=v2ray
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),aarch64)
|
|
||||||
PKG_ARCH_V2RAY:=arm64
|
ifeq ($(CONFIG_V2RAY_DISABLE_ROUTING),y)
|
||||||
|
V2RAY_SED_ARGS += \
|
||||||
|
s/_ "v2ray.com\/core\/app\/router"/\/\/ &/;
|
||||||
endif
|
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
|
define Build/Prepare
|
||||||
endef
|
$(call Build/Prepare/Default)
|
||||||
|
|
||||||
define Build/Configure
|
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
|
||||||
|
|
||||||
|
ifneq ($(V2RAY_SED_ARGS),)
|
||||||
|
( \
|
||||||
|
sed -i \
|
||||||
|
'$(V2RAY_SED_ARGS)' \
|
||||||
|
$(PKG_BUILD_DIR)/main/distro/all/all.go ; \
|
||||||
|
)
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Build/Compile
|
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 --lzma --best $(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 --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ctl
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/$(PKG_NAME)/install
|
define Package/v2ray/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin/v2ray
|
$(INSTALL_DIR) $(1)/usr/bin/v2ray
|
||||||
$(INSTALL_BIN) ./files/$(PKG_ARCH_V2RAY)/$(V2RAY_BIN) $(1)/usr/bin/v2ray/v2ray
|
|
||||||
|
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray $(1)/usr/bin/v2ray
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_V2RAY_EXCLUDE_V2CTL),y)
|
||||||
|
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ctl $(1)/usr/bin/v2ray
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
|
||||||
|
$(INSTALL_DATA) \
|
||||||
|
$(PKG_BUILD_DIR)/release/config/{geoip,geosite}.dat \
|
||||||
|
$(1)/usr/bin/v2ray
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
ifneq ($(CONFIG_V2RAY_EXCLUDE_ASSETS),y)
|
||||||
|
$(eval $(call Download,geoip.dat))
|
||||||
|
$(eval $(call Download,geosite.dat))
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(eval $(call GoBinPackage,v2ray))
|
||||||
|
$(eval $(call BuildPackage,v2ray))
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user