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