1 include $(TOPDIR
)/rules.mk
7 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
8 PKG_SOURCE_URL
:=https
://codeload.github.com
/SagerNet
/sing-box
/tar.gz
/v
$(PKG_VERSION
)?
9 PKG_HASH
:=a1e642362f41bd0e362cd9c8d2f0d29d2eca6a55a948677f6f03cfb81c4f0657
11 PKG_LICENSE
:=GPL-3.0
-or-later
12 PKG_LICENSE_FILES
:=LICENSE
13 PKG_MAINTAINER
:=Van Waholtz
<brvphoenix@gmail.com
>
15 PKG_BUILD_DEPENDS
:=golang
/host
19 GO_PKG
:=github.com
/sagernet
/sing-box
20 GO_PKG_BUILD_PKG
:=$(GO_PKG
)/cmd
/sing-box
22 include $(INCLUDE_DIR
)/package.mk
23 include ..
/..
/lang
/golang
/golang-package.mk
25 define Package
/sing-box
26 TITLE
:=The universal proxy platform
29 URL
:=https
://sing-box.sagernet.org
30 DEPENDS
:=$(GO_ARCH_DEPENDS
) +ca-bundle
+kmod-tun
31 USERID
:=sing-box
=5566:sing-box
=5566
34 define Package
/sing-box
/description
35 Sing-box is a universal proxy platform which supports hysteria
, SOCKS
, Shadowsocks
,
36 ShadowsocksR
, ShadowTLS
, Tor
, trojan
, VLess
, VMess
, WireGuard and so on.
39 define Package
/sing-box
/config
40 menu
"Select build options"
41 depends on PACKAGE_sing-box
43 config SINGBOX_WITH_ACME
44 bool
"Build with ACME TLS certificate issuer support"
47 config SINGBOX_WITH_CLASH_API
48 bool
"Build with Clash API support"
51 config SINGBOX_WITH_ECH
52 bool
"Build with TLS ECH extension support for TLS outbound"
55 config SINGBOX_WITH_EMBEDDED_TOR
56 bool
"Build with embedded Tor support"
59 config SINGBOX_WITH_GRPC
60 bool
"Build with standard gRPC support"
63 config SINGBOX_WITH_GVISOR
64 bool
"Build with gVisor support"
67 config SINGBOX_WITH_LWIP
68 bool
"Build with LWIP Tun stack support"
71 config SINGBOX_WITH_QUIC
72 bool
"Build with QUIC support"
75 config SINGBOX_WITH_SHADOWSOCKSR
76 bool
"Build with ShadowsocksR support"
79 config SINGBOX_WITH_UTLS
80 bool
"Build with uTLS support for TLS outbound"
83 config SINGBOX_WITH_V2RAY_API
84 bool
"Build with V2Ray API support"
87 config SINGBOX_WITH_WIREGUARD
88 bool
"Build with WireGuard support"
93 PKG_CONFIG_DEPENDS
:= \
94 CONFIG_SINGBOX_WITH_ACME \
95 CONFIG_SINGBOX_WITH_CLASH_API \
96 CONFIG_SINGBOX_WITH_ECH \
97 CONFIG_SINGBOX_WITH_EMBEDDED_TOR \
98 CONFIG_SINGBOX_WITH_GRPC \
99 CONFIG_SINGBOX_WITH_GVISOR \
100 CONFIG_SINGBOX_WITH_LWIP \
101 CONFIG_SINGBOX_WITH_QUIC \
102 CONFIG_SINGBOX_WITH_SHADOWSOCKSR \
103 CONFIG_SINGBOX_WITH_UTLS \
104 CONFIG_SINGBOX_WITH_V2RAY_API \
105 CONFIG_SINGBOX_WITH_WIREGUARD
107 GO_PKG_TAGS
:=$(subst $(space
),$(comma
),$(strip \
108 $(if
$(CONFIG_SINGBOX_WITH_ACME
),with_acme
) \
109 $(if
$(CONFIG_SINGBOX_WITH_CLASH_API
),with_clash_api
) \
110 $(if
$(CONFIG_SINGBOX_WITH_ECH
),with_ech
) \
111 $(if
$(CONFIG_SINGBOX_WITH_EMBEDDED_TOR
),with_embedded_tor
) \
112 $(if
$(CONFIG_SINGBOX_WITH_GRPC
),with_grpc
) \
113 $(if
$(CONFIG_SINGBOX_WITH_GVISOR
),with_gvisor
) \
114 $(if
$(CONFIG_SINGBOX_WITH_LWIP
),with_lwip
) \
115 $(if
$(CONFIG_SINGBOX_WITH_QUIC
),with_quic
) \
116 $(if
$(CONFIG_SINGBOX_WITH_SHADOWSOCKSR
),with_shadowsocksr
) \
117 $(if
$(CONFIG_SINGBOX_WITH_UTLS
),with_utls
) \
118 $(if
$(CONFIG_SINGBOX_WITH_V2RAY_API
),with_v2ray_api
) \
119 $(if
$(CONFIG_SINGBOX_WITH_WIREGUARD
),with_wireguard
) \
122 define Package
/sing-box
/conffiles
127 define Package
/sing-box
/install
128 $(INSTALL_DIR
) $(1)/usr
/bin
/
129 $(INSTALL_BIN
) $(GO_PKG_BUILD_BIN_DIR
)/sing-box
$(1)/usr
/bin
/sing-box
131 $(INSTALL_DIR
) $(1)/etc
/sing-box
132 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/release
/config
/config.json
$(1)/etc
/sing-box
134 $(INSTALL_DIR
) $(1)/etc
/config
/
135 $(INSTALL_CONF
) .
/files
/sing-box.conf
$(1)/etc
/config
/sing-box
136 $(INSTALL_DIR
) $(1)/etc
/init.d
/
137 $(INSTALL_BIN
) .
/files
/sing-box.init
$(1)/etc
/init.d
/sing-box
140 $(eval
$(call BuildPackage
,sing-box
))