AdGuardHome: add goproxy and upx support

This commit is contained in:
CN_SZTL 2020-07-31 21:58:25 +08:00
parent 80babd11b1
commit 3793240798
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -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