mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 07:55:13 +08:00
🏅 Sync 2026-06-15 22:09:15
This commit is contained in:
1 parent
d2ec4a48f6
commit
26e9df1a69
68 files changed
+2964
-918
No files matched your search
+22
-2
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tun2socks
|
||||
PKG_VERSION:=2.6.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/xjasonlyu/tun2socks.git
|
||||
@@ -12,7 +12,7 @@ PKG_MAINTAINER:=Konstantine Shevlakov <shevlako@132lan.ru>
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_DEPENDS:=golang/host upx/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
@@ -21,6 +21,25 @@ GO_PKG=github.com/xjasonlyu/tun2socks
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
# --- UPX support ---
|
||||
UPX:=$(STAGING_DIR_HOST)/bin/upx
|
||||
UPX_AVAILABLE:=$(shell [ -x "$(UPX)" ] && echo yes || echo no)
|
||||
|
||||
ifeq ($(UPX_AVAILABLE),yes)
|
||||
define upxcompress
|
||||
@echo "Compressing $(1) with UPX..."
|
||||
$(UPX) --lzma --best $(1)
|
||||
endef
|
||||
else
|
||||
define upxcompress
|
||||
@echo "UPX not found at $(UPX), skipping compression"
|
||||
endef
|
||||
endif
|
||||
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
github.com/xjasonlyu/tun2socks/internal/version.Version=v$(PKG_VERSION) \
|
||||
github.com/xjasonlyu/tun2socks/internal/version.GitCommit=$(shell echo $(PKG_SOURCE_VERSION) | cut -c1-7)
|
||||
GO_MOD_ARGS:=
|
||||
GO_PKG_BUILD_VARS+= GO111MODULE=on
|
||||
|
||||
@@ -37,6 +56,7 @@ define Package/$(PKG_NAME)/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/sbin/
|
||||
$(call upxcompress,$(1)/usr/sbin/$(PKG_NAME))
|
||||
$(CP) ./root/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
Reference in new issue
Block a user