From 379324079807d057a4f1601b7f6460a04c58259d Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Fri, 31 Jul 2020 21:58:25 +0800 Subject: [PATCH] AdGuardHome: add goproxy and upx support --- package/ntlf9t/AdGuardHome/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/ntlf9t/AdGuardHome/Makefile b/package/ntlf9t/AdGuardHome/Makefile index fdc4e40aad..f37881fb50 100644 --- a/package/ntlf9t/AdGuardHome/Makefile +++ b/package/ntlf9t/AdGuardHome/Makefile @@ -23,6 +23,10 @@ PKG_BUILD_DEPENDS:=golang/host node/host PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 +PKG_CONFIG_DEPENDS:= \ + CONFIG_ADGUARDHOME_COMPRESS_GOPROXY \ + CONFIG_ADGUARDHOME_COMPRESS_UPX + GO_PKG:=github.com/AdguardTeam/AdGuardHome GO_PKG_EXCLUDES:=dhcpd/standalone GO_PKG_LDFLAGS:=-s -w @@ -43,6 +47,16 @@ define Package/AdGuardHome/description Free and open source, powerful network-wide ads and trackers blocking DNS server. endef +define Package/$(PKG_NAME)/config +config ADGUARDHOME_COMPRESS_GOPROXY + bool "Compiling with GOPROXY proxy" + default n + +config ADGUARDHOME_COMPRESS_UPX + bool "Compress executable files with UPX" + default y +endef + define Build/Compile ( \ cd $(PKG_BUILD_DIR) ; \ @@ -56,6 +70,9 @@ endef define Package/AdGuardHome/install $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) +ifeq ($(CONFIG_ADGUARDHOME_COMPRESS_UPX),y) + $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/AdGuardHome +endif $(INSTALL_DIR) $(1)/usr/bin/AdGuardHome $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/AdGuardHome $(1)/usr/bin/AdGuardHome/AdGuardHome endef