strongswan: Update to 5.9.9
[feed/packages.git] / net / sing-box / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=sing-box
4 PKG_VERSION:=1.1.5
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:=a1e642362f41bd0e362cd9c8d2f0d29d2eca6a55a948677f6f03cfb81c4f0657
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_USE_MIPS16:=0
18
19 GO_PKG:=github.com/sagernet/sing-box
20 GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box
21
22 include $(INCLUDE_DIR)/package.mk
23 include ../../lang/golang/golang-package.mk
24
25 define Package/sing-box
26 TITLE:=The universal proxy platform
27 SECTION:=net
28 CATEGORY:=Network
29 URL:=https://sing-box.sagernet.org
30 DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +kmod-tun
31 USERID:=sing-box=5566:sing-box=5566
32 endef
33
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.
37 endef
38
39 define Package/sing-box/config
40 menu "Select build options"
41 depends on PACKAGE_sing-box
42
43 config SINGBOX_WITH_ACME
44 bool "Build with ACME TLS certificate issuer support"
45 default n
46
47 config SINGBOX_WITH_CLASH_API
48 bool "Build with Clash API support"
49 default y
50
51 config SINGBOX_WITH_ECH
52 bool "Build with TLS ECH extension support for TLS outbound"
53 default n
54
55 config SINGBOX_WITH_EMBEDDED_TOR
56 bool "Build with embedded Tor support"
57 default n
58
59 config SINGBOX_WITH_GRPC
60 bool "Build with standard gRPC support"
61 default n
62
63 config SINGBOX_WITH_GVISOR
64 bool "Build with gVisor support"
65 default y
66
67 config SINGBOX_WITH_LWIP
68 bool "Build with LWIP Tun stack support"
69 default n
70
71 config SINGBOX_WITH_QUIC
72 bool "Build with QUIC support"
73 default y
74
75 config SINGBOX_WITH_SHADOWSOCKSR
76 bool "Build with ShadowsocksR support"
77 default n
78
79 config SINGBOX_WITH_UTLS
80 bool "Build with uTLS support for TLS outbound"
81 default y
82
83 config SINGBOX_WITH_V2RAY_API
84 bool "Build with V2Ray API support"
85 default n
86
87 config SINGBOX_WITH_WIREGUARD
88 bool "Build with WireGuard support"
89 default y
90 endmenu
91 endef
92
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
106
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) \
120 ))
121
122 define Package/sing-box/conffiles
123 /etc/config/sing-box
124 /etc/sing-box/
125 endef
126
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
130
131 $(INSTALL_DIR) $(1)/etc/sing-box
132 $(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/sing-box
133
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
138 endef
139
140 $(eval $(call BuildPackage,sing-box))