sing-box: update to 1.8.7
[feed/packages.git] / net / sing-box / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=sing-box
4 PKG_VERSION:=1.8.7
5 PKG_RELEASE:=1
6
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:=35db2a6953c04ea6301f242ba2d6c7ca7f6d52bae0b4927beca5255ee958b218
10
11 PKG_LICENSE:=GPL-3.0-or-later
12 PKG_LICENSE_FILES:=LICENSE
13 PKG_MAINTAINER:=Van Waholtz <brvphoenix@gmail.com>
14
15 PKG_BUILD_DEPENDS:=golang/host
16 PKG_BUILD_PARALLEL:=1
17 PKG_BUILD_FLAGS:=no-mips16
18
19 GO_PKG:=github.com/sagernet/sing-box
20 GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box
21
22 GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/package.mk
25 include ../../lang/golang/golang-package.mk
26
27 define Package/sing-box
28 TITLE:=The universal proxy platform
29 SECTION:=net
30 CATEGORY:=Network
31 URL:=https://sing-box.sagernet.org
32 DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +kmod-inet-diag +kmod-tun
33 USERID:=sing-box=5566:sing-box=5566
34 endef
35
36 define Package/sing-box/description
37 Sing-box is a universal proxy platform which supports hysteria, SOCKS, Shadowsocks,
38 ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
39 endef
40
41 define Package/sing-box/config
42 menu "Select build options"
43 depends on PACKAGE_sing-box
44
45 config SINGBOX_WITH_ACME
46 bool "Build with ACME TLS certificate issuer support"
47
48 config SINGBOX_WITH_CLASH_API
49 bool "Build with Clash API support"
50 default y
51
52 config SINGBOX_WITH_DHCP
53 bool "Build with DHCP support, see DHCP DNS transport."
54
55 config SINGBOX_WITH_ECH
56 bool "Build with TLS ECH extension support for TLS outbound"
57 default y
58
59 config SINGBOX_WITH_EMBEDDED_TOR
60 bool "Build with embedded Tor support"
61
62 config SINGBOX_WITH_GRPC
63 bool "Build with standard gRPC support"
64
65 config SINGBOX_WITH_GVISOR
66 bool "Build with gVisor support"
67 default y
68
69 config SINGBOX_WITH_QUIC
70 bool "Build with QUIC support"
71 default y
72
73 config SINGBOX_WITH_REALITY_SERVER
74 bool "Build with reality TLS server support, see TLS."
75 default y
76
77 config SINGBOX_WITH_UTLS
78 bool "Build with uTLS support for TLS outbound"
79 default y
80
81 config SINGBOX_WITH_V2RAY_API
82 bool "Build with V2Ray API support"
83
84 config SINGBOX_WITH_WIREGUARD
85 bool "Build with WireGuard support"
86 default y
87 endmenu
88 endef
89
90 PKG_CONFIG_DEPENDS:= \
91 CONFIG_SINGBOX_WITH_ACME \
92 CONFIG_SINGBOX_WITH_CLASH_API \
93 CONFIG_SINGBOX_WITH_DHCP \
94 CONFIG_SINGBOX_WITH_ECH \
95 CONFIG_SINGBOX_WITH_EMBEDDED_TOR \
96 CONFIG_SINGBOX_WITH_GRPC \
97 CONFIG_SINGBOX_WITH_GVISOR \
98 CONFIG_SINGBOX_WITH_QUIC \
99 CONFIG_SINGBOX_WITH_REALITY_SERVER \
100 CONFIG_SINGBOX_WITH_UTLS \
101 CONFIG_SINGBOX_WITH_V2RAY_API \
102 CONFIG_SINGBOX_WITH_WIREGUARD
103
104 GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
105 $(if $(CONFIG_SINGBOX_WITH_ACME),with_acme) \
106 $(if $(CONFIG_SINGBOX_WITH_CLASH_API),with_clash_api) \
107 $(if $(CONFIG_SINGBOX_WITH_DHCP),with_dhcp) \
108 $(if $(CONFIG_SINGBOX_WITH_ECH),with_ech) \
109 $(if $(CONFIG_SINGBOX_WITH_EMBEDDED_TOR),with_embedded_tor) \
110 $(if $(CONFIG_SINGBOX_WITH_GRPC),with_grpc) \
111 $(if $(CONFIG_SINGBOX_WITH_GVISOR),with_gvisor) \
112 $(if $(CONFIG_SINGBOX_WITH_QUIC),with_quic) \
113 $(if $(CONFIG_SINGBOX_WITH_REALITY_SERVER),with_reality_server) \
114 $(if $(CONFIG_SINGBOX_WITH_UTLS),with_utls) \
115 $(if $(CONFIG_SINGBOX_WITH_V2RAY_API),with_v2ray_api) \
116 $(if $(CONFIG_SINGBOX_WITH_WIREGUARD),with_wireguard) \
117 ))
118
119 define Package/sing-box/conffiles
120 /etc/config/sing-box
121 /etc/sing-box/
122 endef
123
124 define Package/sing-box/install
125 $(INSTALL_DIR) $(1)/usr/bin/
126 $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/sing-box $(1)/usr/bin/sing-box
127
128 $(INSTALL_DIR) $(1)/etc/sing-box
129 $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/sing-box
130
131 $(INSTALL_DIR) $(1)/etc/config/
132 $(INSTALL_CONF) ./files/sing-box.conf $(1)/etc/config/sing-box
133 $(INSTALL_DIR) $(1)/etc/init.d/
134 $(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
135 endef
136
137 $(eval $(call BuildPackage,sing-box))