This commit is contained in:
coolsnowwolf 2020-04-27 12:30:33 +08:00
commit a818d7e5da
2 changed files with 23 additions and 7 deletions

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=v2ray-plugin PKG_NAME:=v2ray-plugin
PKG_VERSION:=1.3.0 PKG_VERSION:=1.3.0
PKG_RELEASE:=2 PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-plugin-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/shadowsocks/v2ray-plugin/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/shadowsocks/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
@ -26,19 +26,34 @@ PKG_USE_MIPS16:=0
GO_PKG:=github.com/shadowsocks/v2ray-plugin GO_PKG:=github.com/shadowsocks/v2ray-plugin
GO_PKG_LDFLAGS:=-s -w GO_PKG_LDFLAGS:=-s -w
PKG_CONFIG_DEPENDS := CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/v2ray-plugin define Package/$(PKG_NAME)/config
config $(PKG_NAME)_INCLUDE_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
endef
ifeq ($(CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.io
#export GOPROXY=https://mirrors.aliyun.com/goproxy/
endif
define Package/$(PKG_NAME)
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
SUBMENU:=Project V
TITLE:=SIP003 plugin for shadowsocks, based on v2ray TITLE:=SIP003 plugin for shadowsocks, based on v2ray
URL:=https://github.com/shadowsocks/v2ray-plugin URL:=https://github.com/shadowsocks/v2ray-plugin
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
endef endef
define Package/v2ray-plugin/description define Package/$(PKG_NAME)/description
Yet another SIP003 plugin for shadowsocks, based on v2ray Yet another SIP003 plugin for shadowsocks, based on v2ray
endef endef
@ -51,9 +66,9 @@ define Build/Compile
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin
endef endef
define Package/v2ray-plugin/install define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/bin $(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(1)/usr/bin/v2ray-plugin $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(1)/usr/bin/v2ray-plugin
endef endef
$(eval $(call GoBinPackage,v2ray-plugin)) $(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,v2ray-plugin)) $(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -89,7 +89,8 @@ endef
ifeq ($(CONFIG_V2RAY_COMPRESS_GOPROXY),y) ifeq ($(CONFIG_V2RAY_COMPRESS_GOPROXY),y)
export GO111MODULE=on export GO111MODULE=on
export GOPROXY=https://goproxy.cn export GOPROXY=https://goproxy.io
#export GOPROXY=https://mirrors.aliyun.com/goproxy/
endif endif
V2RAY_SED_ARGS:= V2RAY_SED_ARGS:=