Browse Source

treewide: get rid of UPX

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 3 years ago
parent
commit
eaa2a01e86
4 changed files with 1 additions and 104 deletions
  1. 1 24
      README.md
  2. 0 28
      v2ray-plugin/Makefile
  3. 0 24
      v2raya/Makefile
  4. 0 28
      xray-plugin/Makefile

+ 1 - 24
README.md

@@ -72,13 +72,8 @@
 
 ### Note
 
-If you want to use this repo with official OpenWrt source tree, the following tools and packages need to be added manually:
+If you want to use this repo with official OpenWrt source tree, the following packages need to be added manually:
 
-tools:
-- [ucl](https://github.com/coolsnowwolf/lede/tree/master/tools/ucl)
-- [upx](https://github.com/coolsnowwolf/lede/tree/master/tools/upx)
-
-packages:
 - [dns2socks](https://github.com/immortalwrt/packages/tree/master/net/dns2socks)
 - [microsocks](https://github.com/immortalwrt/packages/tree/master/net/microsocks)
 - [ipt2socks](https://github.com/immortalwrt/packages/tree/master/net/ipt2socks)
@@ -93,21 +88,3 @@ for i in "dns2socks" "microsocks" "ipt2socks" "pdnsd-alt" "redsocks2"; do \
   svn checkout "https://github.com/immortalwrt/packages/trunk/net/$i" "package/helloworld/$i"; \
 done
 ```
-
-You should manually add the following code into tools/Makefile, make sure to add code before the compile command: 
-
-```bash
-tools-y += ucl upx
-$(curdir)/upx/compile := $(curdir)/ucl/compile
-```
-
-e.g.:
-
-```bash
-svn checkout https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
-svn checkout https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
-
-sed -i 'N;24a\tools-y += ucl upx' tools/Makefile
-sed -i 'N;40a\$(curdir)/upx/compile := $(curdir)/ucl/compile' tools/Makefile
-```
-You should note that hard-coding the line number is not an ideal solution. It may destroy the structure of the original file due to the update of the openwrt source code and cause unexpected problems. 

+ 0 - 28
v2ray-plugin/Makefile

@@ -17,37 +17,16 @@ PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=madeye <[email protected]>
 
-PKG_CONFIG_DEPENDS:= \
-	CONFIG_V2RAY_PLUGIN_COMPRESS_GOPROXY \
-	CONFIG_V2RAY_PLUGIN_COMPRESS_UPX
-
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
 GO_PKG:=github.com/shadowsocks/v2ray-plugin
-GO_PKG_LDFLAGS:=-s -w
 GO_PKG_LDFLAGS_X:=main.VERSION=v$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
 
-define Package/v2ray-plugin/config
-config V2RAY_PLUGIN_COMPRESS_GOPROXY
-	bool "Compiling with GOPROXY proxy"
-	default n
-
-config V2RAY_PLUGIN_COMPRESS_UPX
-	bool "Compress executable files with UPX"
-	depends on !mips64
-	default n
-endef
-
-ifeq ($(CONFIG_V2RAY_PLUGIN_COMPRESS_GOPROXY),y)
-	export GO111MODULE=on
-	export GOPROXY=https://goproxy.bj.bcebos.com
-endif
-
 define Package/v2ray-plugin
   SECTION:=net
   CATEGORY:=Network
@@ -57,12 +36,5 @@ define Package/v2ray-plugin
   DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
 endef
 
-define Build/Compile
-	$(call GoPackage/Build/Compile)
-ifeq ($(CONFIG_V2RAY_PLUGIN_COMPRESS_UPX),y)
-	$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin
-endif
-endef
-
 $(eval $(call GoBinPackage,v2ray-plugin))
 $(eval $(call BuildPackage,v2ray-plugin))

+ 0 - 24
v2raya/Makefile

@@ -17,16 +17,11 @@ PKG_LICENSE:=AGPL-3.0-only
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Tianling Shen <[email protected]>
 
-PKG_CONFIG_DEPENDS:= \
-	CONFIG_V2RAYA_COMPRESS_GOPROXY \
-	CONFIG_V2RAYA_COMPRESS_UPX \
-
 PKG_BUILD_DEPENDS:=golang/host node/host node-yarn/host
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
 GO_PKG:=github.com/v2rayA/v2rayA
-GO_PKG_LDFLAGS:=-s -w
 GO_PKG_LDFLAGS_X:=$(GO_PKG)/conf.Version=$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
@@ -56,22 +51,6 @@ define Package/v2raya/description
   compatible with SS, SSR, Trojan(trojan-go), PingTunnel protocols.
 endef
 
-define Package/v2raya/config
-config V2RAYA_COMPRESS_GOPROXY
-	bool "Compiling with GOPROXY proxy"
-	default n
-
-config V2RAYA_COMPRESS_UPX
-	bool "Compress executable files with UPX"
-	depends on !mips64
-	default n
-endef
-
-ifneq ($(CONFIG_V2RAYA_COMPRESS_GOPROXY),)
-	export GO111MODULE=on
-	export GOPROXY=https://goproxy.bj.bcebos.com
-endif
-
 define Package/v2raya/conffiles
 /etc/v2raya/
 /etc/config/v2raya
@@ -85,9 +64,6 @@ define Build/Compile
 		popd ; \
 		$(call GoPackage/Build/Compile) ; \
 	)
-ifneq ($(CONFIG_V2RAYA_COMPRESS_UPX),)
-	$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2rayA
-endif
 endef
 
 define Package/v2raya/install

+ 0 - 28
xray-plugin/Makefile

@@ -16,36 +16,15 @@ PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Tianling Shen <[email protected]>
 
-PKG_CONFIG_DEPENDS:= \
-	CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY \
-	CONFIG_XRAY_PLUGIN_COMPRESS_UPX
-
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
 GO_PKG:=github.com/teddysun/xray-plugin
-GO_PKG_LDFLAGS:=-s -w
 
 include $(INCLUDE_DIR)/package.mk
 include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
 
-define Package/xray-plugin/config
-config XRAY_PLUGIN_COMPRESS_GOPROXY
-	bool "Compiling with GOPROXY proxy"
-	default n
-
-config XRAY_PLUGIN_COMPRESS_UPX
-	bool "Compress executable files with UPX"
-	depends on !mips64
-	default n
-endef
-
-ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY),)
-	export GO111MODULE=on
-	export GOPROXY=https://goproxy.bj.bcebos.com
-endif
-
 define Package/xray-plugin
   SECTION:=net
   CATEGORY:=Network
@@ -55,12 +34,5 @@ define Package/xray-plugin
   DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
 endef
 
-define Build/Compile
-	$(call GoPackage/Build/Compile)
-ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_UPX),)
-	$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/xray-plugin
-endif
-endef
-
 $(eval $(call GoBinPackage,xray-plugin))
 $(eval $(call BuildPackage,xray-plugin))