mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 01:44:32 +04:00
sing-box: add variant tiny
The tiny version disables tailscale by default for small package size. OpenWrt also has the tailscale package as an alternative. We prefer to keep the base version has the same build tags with the upstream releases for compatibility. Signed-off-by: Van Waholtz <brvphoenix@gmail.com>
This commit is contained in:
@@ -31,6 +31,8 @@ define Package/sing-box
|
|||||||
URL:=https://sing-box.sagernet.org
|
URL:=https://sing-box.sagernet.org
|
||||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +kmod-inet-diag +kmod-tun
|
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +kmod-inet-diag +kmod-tun
|
||||||
USERID:=sing-box=5566:sing-box=5566
|
USERID:=sing-box=5566:sing-box=5566
|
||||||
|
VARIANT:=full
|
||||||
|
DEFAULT_VARIANT:=1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/sing-box/description
|
define Package/sing-box/description
|
||||||
@@ -38,6 +40,16 @@ define Package/sing-box/description
|
|||||||
ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
|
ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/sing-box-tiny
|
||||||
|
$(Package/sing-box)
|
||||||
|
TITLE+=(tiny)
|
||||||
|
PROVIDES:=sing-box
|
||||||
|
VARIANT:=tiny
|
||||||
|
CONFLICTS:=sing-box
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/sing-box-tiny/description:=$(Package/sing-box/description)
|
||||||
|
|
||||||
define Package/sing-box/config
|
define Package/sing-box/config
|
||||||
menu "Select build options"
|
menu "Select build options"
|
||||||
depends on PACKAGE_sing-box
|
depends on PACKAGE_sing-box
|
||||||
@@ -96,6 +108,12 @@ PKG_CONFIG_DEPENDS:= \
|
|||||||
CONFIG_SINGBOX_WITH_V2RAY_API \
|
CONFIG_SINGBOX_WITH_V2RAY_API \
|
||||||
CONFIG_SINGBOX_WITH_WIREGUARD
|
CONFIG_SINGBOX_WITH_WIREGUARD
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),tiny)
|
||||||
|
ifeq ($(CONFIG_SMALL_FLASH),)
|
||||||
|
GO_PKG_TAGS:=with_gvisor
|
||||||
|
endif
|
||||||
|
GO_PKG_TAGS:=$(GO_PKG_TAGS),with_quic,with_utls,with_clash_api
|
||||||
|
else
|
||||||
GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
|
GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
|
||||||
$(if $(CONFIG_SINGBOX_WITH_ACME),with_acme) \
|
$(if $(CONFIG_SINGBOX_WITH_ACME),with_acme) \
|
||||||
$(if $(CONFIG_SINGBOX_WITH_CLASH_API),with_clash_api) \
|
$(if $(CONFIG_SINGBOX_WITH_CLASH_API),with_clash_api) \
|
||||||
@@ -109,12 +127,15 @@ GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
|
|||||||
$(if $(CONFIG_SINGBOX_WITH_V2RAY_API),with_v2ray_api) \
|
$(if $(CONFIG_SINGBOX_WITH_V2RAY_API),with_v2ray_api) \
|
||||||
$(if $(CONFIG_SINGBOX_WITH_WIREGUARD),with_wireguard) \
|
$(if $(CONFIG_SINGBOX_WITH_WIREGUARD),with_wireguard) \
|
||||||
))
|
))
|
||||||
|
endif
|
||||||
|
|
||||||
define Package/sing-box/conffiles
|
define Package/sing-box/conffiles
|
||||||
/etc/config/sing-box
|
/etc/config/sing-box
|
||||||
/etc/sing-box/
|
/etc/sing-box/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
Package/sing-box-tiny/conffiles=$(Package/sing-box/conffiles)
|
||||||
|
|
||||||
define Package/sing-box/install
|
define Package/sing-box/install
|
||||||
$(INSTALL_DIR) $(1)/usr/bin/
|
$(INSTALL_DIR) $(1)/usr/bin/
|
||||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/sing-box $(1)/usr/bin/sing-box
|
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/sing-box $(1)/usr/bin/sing-box
|
||||||
@@ -128,4 +149,7 @@ define Package/sing-box/install
|
|||||||
$(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
|
$(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
Package/sing-box-tiny/install=$(Package/sing-box/install)
|
||||||
|
|
||||||
$(eval $(call BuildPackage,sing-box))
|
$(eval $(call BuildPackage,sing-box))
|
||||||
|
$(eval $(call BuildPackage,sing-box-tiny))
|
||||||
|
|||||||
Reference in New Issue
Block a user