mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 11:17:34 +08:00
update 2024-02-29 12:12:28
This commit is contained in:
parent
b97b5eac4e
commit
e5d28533fb
@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2022-2023 ImmortalWrt.org
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -14,133 +15,135 @@ PKG_HASH:=35db2a6953c04ea6301f242ba2d6c7ca7f6d52bae0b4927beca5255ee958b218
|
||||
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_SING_BOX_BUILD_ACME \
|
||||
CONFIG_SING_BOX_BUILD_CLASH_API \
|
||||
CONFIG_SING_BOX_BUILD_DHCP \
|
||||
CONFIG_SING_BOX_BUILD_ECH \
|
||||
CONFIG_SING_BOX_BUILD_EMBEDDED_TOR \
|
||||
CONFIG_SING_BOX_BUILD_GRPC \
|
||||
CONFIG_SING_BOX_BUILD_GVISOR \
|
||||
CONFIG_SING_BOX_BUILD_LWIP \
|
||||
CONFIG_SING_BOX_BUILD_QUIC \
|
||||
CONFIG_SING_BOX_BUILD_REALITY_SERVER \
|
||||
CONFIG_SING_BOX_BUILD_UTLS \
|
||||
CONFIG_SING_BOX_BUILD_V2RAY_API \
|
||||
CONFIG_SING_BOX_BUILD_WIREGUARD
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
GO_PKG:=github.com/sagernet/sing-box
|
||||
GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box
|
||||
GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=$(PKG_VERSION)
|
||||
GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/sing-box
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=The universal proxy platform
|
||||
URL:=https://sing-box.sagernet.org/
|
||||
TITLE:=The universal proxy platform.
|
||||
URL:=https://sing-box.sagernet.org
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) \
|
||||
+ca-bundle \
|
||||
+kmod-inet-diag \
|
||||
+kmod-netlink-diag \
|
||||
+(SING_BOX_BUILD_GVISOR||SING_BOX_BUILD_LWIP):kmod-tun
|
||||
USERID:=sing-box=5566:sing-box=5566
|
||||
+kmod-tun
|
||||
endef
|
||||
|
||||
define Package/sing-box/config
|
||||
if PACKAGE_sing-box
|
||||
config SING_BOX_BUILD_ACME
|
||||
bool "Build with ACME TLS certificate issuer support"
|
||||
|
||||
config SING_BOX_BUILD_CLASH_API
|
||||
bool "Build with Clash API support"
|
||||
default y
|
||||
|
||||
config SING_BOX_BUILD_DHCP
|
||||
bool "Build with DHCP support"
|
||||
|
||||
config SING_BOX_BUILD_ECH
|
||||
bool "Build with TLS ECH extension support"
|
||||
default y
|
||||
|
||||
config SING_BOX_BUILD_EMBEDDED_TOR
|
||||
bool "Build with embedded Tor support"
|
||||
|
||||
config SING_BOX_BUILD_GRPC
|
||||
bool "Build with standard gPRC support"
|
||||
help
|
||||
Standard gRPC has good compatibility but poor performance.
|
||||
|
||||
config SING_BOX_BUILD_GVISOR
|
||||
bool "Build with gVisor support"
|
||||
default y
|
||||
|
||||
config SING_BOX_BUILD_LWIP
|
||||
bool "Build with LWIP Tun stack support"
|
||||
|
||||
config SING_BOX_BUILD_QUIC
|
||||
bool "Build with QUIC support"
|
||||
default y
|
||||
help
|
||||
Required by HTTP3 DNS transports, Naive inbound,
|
||||
Hysteria inbound / outbound, and v2ray QUIC transport.
|
||||
|
||||
config SING_BOX_BUILD_REALITY_SERVER
|
||||
bool "Build with REALITY TLS server support"
|
||||
|
||||
config SING_BOX_BUILD_UTLS
|
||||
bool "Build with uTLS support"
|
||||
default y
|
||||
|
||||
config SING_BOX_BUILD_V2RAY_API
|
||||
bool "Build with V2Ray API support"
|
||||
|
||||
config SING_BOX_BUILD_WIREGUARD
|
||||
bool "Build with WireGuard support"
|
||||
default y
|
||||
endif
|
||||
define Package/$(PKG_NAME)/description
|
||||
Sing-box is a universal proxy platform which supports hysteria, SOCKS,
|
||||
Shadowsocks, ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
|
||||
endef
|
||||
|
||||
GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
menu "Customizing build tags"
|
||||
depends on PACKAGE_sing-box
|
||||
|
||||
config SING_BOX_WITH_ACME
|
||||
bool "Build with ACME TLS certificate issuer support"
|
||||
default n
|
||||
|
||||
config SING_BOX_WITH_CLASH_API
|
||||
bool "Build with Clash API support (EXPERIMENTAL!!!)"
|
||||
default y
|
||||
|
||||
config SING_BOX_WITH_DHCP
|
||||
bool "Build with DHCP support"
|
||||
default y
|
||||
|
||||
config SING_BOX_WITH_ECH
|
||||
bool "Build with TLS ECH extension support"
|
||||
default y
|
||||
|
||||
config SING_BOX_WITH_GRPC
|
||||
bool "Build with standard gRPC support"
|
||||
default n
|
||||
help
|
||||
sing-box has better performance gun-lite gRPC built-in by default.
|
||||
This standard gRPC has better compatibility but poor performance.
|
||||
|
||||
config SING_BOX_WITH_GVISOR
|
||||
bool "Build with gVisor support"
|
||||
default n
|
||||
|
||||
config SING_BOX_WITH_QUIC
|
||||
bool "Build with QUIC support"
|
||||
default y
|
||||
help
|
||||
Required by HTTP3 DNS transports, Naive inbound,
|
||||
Hysteria inbound / outbound, and v2ray QUIC transport.
|
||||
|
||||
config SING_BOX_WITH_REALITY_SERVER
|
||||
bool "Build with reality TLS server support"
|
||||
default n
|
||||
|
||||
config SING_BOX_WITH_UTLS
|
||||
bool "Build with uTLS support"
|
||||
default y
|
||||
|
||||
config SING_BOX_WITH_V2RAY_API
|
||||
bool "Build with V2Ray API support (EXPERIMENTAL!!!)"
|
||||
default n
|
||||
|
||||
config SING_BOX_WITH_WIREGUARD
|
||||
bool "Build with WireGuard support"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
endef
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_SING_BOX_WITH_ACME \
|
||||
CONFIG_SING_BOX_WITH_CLASH_API \
|
||||
CONFIG_SING_BOX_WITH_DHCP \
|
||||
CONFIG_SING_BOX_WITH_ECH \
|
||||
CONFIG_SING_BOX_WITH_GRPC \
|
||||
CONFIG_SING_BOX_WITH_GVISOR \
|
||||
CONFIG_SING_BOX_WITH_QUIC \
|
||||
CONFIG_SING_BOX_WITH_REALITY_SERVER \
|
||||
CONFIG_SING_BOX_WITH_UTLS \
|
||||
CONFIG_SING_BOX_WITH_V2RAY_API \
|
||||
CONFIG_SING_BOX_WITH_WIREGUARD
|
||||
|
||||
GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_ACME),with_acme) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_CLASH_API),with_clash_api) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_DHCP),with_dhcp) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_ECH),with_ech) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_EMBEDDED_TOR),with_embedded_tor) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_GRPC),with_grpc) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_GVISOR),with_gvisor) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_LWIP),with_lwip) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_QUIC),with_quic) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_REALITY_SERVER),with_reality_server) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_UTLS),with_utls) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_V2RAY_API),with_v2ray_api) \
|
||||
$(if $(CONFIG_SING_BOX_BUILD_WIREGUARD),with_wireguard) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_ACME),with_acme) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_CLASH_API),with_clash_api) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_DHCP),with_dhcp) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_ECH),with_ech) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_GRPC),with_grpc) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_GVISOR),with_gvisor) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_QUIC),with_quic) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_REALITY_SERVER),with_reality_server) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_UTLS),with_utls) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_V2RAY_API),with_v2ray_api) \
|
||||
$(if $(CONFIG_SING_BOX_WITH_WIREGUARD),with_wireguard) \
|
||||
))
|
||||
|
||||
define Package/sing-box/conffiles
|
||||
/etc/config/sing-box
|
||||
/etc/sing-box/
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/sing-box/config.json
|
||||
endef
|
||||
|
||||
define Package/sing-box/install
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/sing-box
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/sing-box
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_CONF) ./files/sing-box.conf $(1)/etc/config/sing-box
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/sing-box
|
||||
$(INSTALL_DATA) ./files/config.json.example $(1)/etc/sing-box/config.json.example
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,sing-box))
|
||||
|
@ -12,13 +12,13 @@ PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
GEOIP_VER:=202402220038
|
||||
GEOIP_VER:=202402290038
|
||||
GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
|
||||
define Download/geoip
|
||||
URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
|
||||
URL_FILE:=geoip.dat
|
||||
FILE:=$(GEOIP_FILE)
|
||||
HASH:=331c5031528f577dde3d63681d32a15693aace4e38095d40dbe3f751e0db5536
|
||||
HASH:=8463e06eb8a15d11dcb6c134002a443cab447c7e46844352f5dd8eaa661350f4
|
||||
endef
|
||||
|
||||
GEOSITE_VER:=20240221053250
|
||||
|
Loading…
Reference in New Issue
Block a user