Update upx.patch

This commit is contained in:
kiddin9 2026-04-13 05:03:32 +08:00 committed by GitHub
parent 6174bafbf2
commit ef0862f644
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,3 +75,29 @@
define Package/mihomo/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(CURDIR)/.prepare.sh $(VERSION) $(CURDIR) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
--- a/mosdns/Makefile
+++ b/mosdns/Makefile
@@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILE:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
-PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_DEPENDS:=golang/host upx/host
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16
@@ -35,6 +35,13 @@ define Package/mosdns
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
+define Build/Compile
+ $(call GoPackage/Build/Compile)
+ifneq ($(filter arm mipsel mips,$(ARCH)),)
+ $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/mosdns
+endif
+endef
+
define Package/mosdns/install
$(call GoPackage/Package/Install/Bin,$(1))
endef