forked from shadowsocks/openwrt-shadowsocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
130 lines (107 loc) · 3.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#
# Copyright (C) 2014-2020 Jian Chang <[email protected]>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-libev
PKG_VERSION:=3.3.4
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev.git
PKG_SOURCE_VERSION:=72d7d9217ce2a8a59dc647e8f1fbbd77f7cd30aa
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <[email protected]>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=c-ares libev libsodium mbedtls pcre
PKG_CONFIG_DEPENDS:= \
CONFIG_SHADOWSOCKS_STATIC_LINK \
CONFIG_SHADOWSOCKS_WITH_EV \
CONFIG_SHADOWSOCKS_WITH_PCRE \
CONFIG_SHADOWSOCKS_WITH_CARES \
CONFIG_SHADOWSOCKS_WITH_SODIUM \
CONFIG_SHADOWSOCKS_WITH_MBEDTLS
include $(INCLUDE_DIR)/package.mk
define Package/shadowsocks-libev
SECTION:=net
CATEGORY:=Network
TITLE:=Lightweight Secured Socks5 Proxy
URL:=https://github.com/shadowsocks/shadowsocks-libev
DEPENDS:=+libpthread \
+!SHADOWSOCKS_WITH_EV:libev \
+!SHADOWSOCKS_WITH_PCRE:libpcre \
+!SHADOWSOCKS_WITH_CARES:libcares \
+!SHADOWSOCKS_WITH_SODIUM:libsodium \
+!SHADOWSOCKS_WITH_MBEDTLS:libmbedtls
endef
Package/shadowsocks-libev-server = $(Package/shadowsocks-libev)
define Package/shadowsocks-libev-server/config
menu "Shadowsocks-libev Compile Configuration"
depends on PACKAGE_shadowsocks-libev || PACKAGE_shadowsocks-libev-server
config SHADOWSOCKS_STATIC_LINK
bool "enable static link libraries."
default n
menu "Select libraries"
depends on SHADOWSOCKS_STATIC_LINK
config SHADOWSOCKS_WITH_EV
bool "static link libev."
default y
config SHADOWSOCKS_WITH_PCRE
bool "static link libpcre."
default y
config SHADOWSOCKS_WITH_CARES
bool "static link libcares."
default y
config SHADOWSOCKS_WITH_SODIUM
bool "static link libsodium."
default y
config SHADOWSOCKS_WITH_MBEDTLS
bool "static link libmbedtls."
default y
endmenu
endmenu
endef
define Package/shadowsocks-libev/description
Shadowsocks-libev is a lightweight secured socks5 proxy for embedded devices and low end boxes.
endef
Package/shadowsocks-libev-server/description = $(Package/shadowsocks-libev/description)
CONFIGURE_ARGS += \
--disable-ssp \
--disable-documentation \
--disable-assert
ifeq ($(CONFIG_SHADOWSOCKS_STATIC_LINK),y)
ifeq ($(CONFIG_SHADOWSOCKS_WITH_EV),y)
CONFIGURE_ARGS += --with-ev="$(STAGING_DIR)/usr"
endif
ifeq ($(CONFIG_SHADOWSOCKS_WITH_PCRE),y)
CONFIGURE_ARGS += --with-pcre="$(STAGING_DIR)/usr"
endif
ifeq ($(CONFIG_SHADOWSOCKS_WITH_CARES),y)
CONFIGURE_ARGS += --with-cares="$(STAGING_DIR)/usr"
endif
ifeq ($(CONFIG_SHADOWSOCKS_WITH_SODIUM),y)
CONFIGURE_ARGS += --with-sodium="$(STAGING_DIR)/usr"
endif
ifeq ($(CONFIG_SHADOWSOCKS_WITH_MBEDTLS),y)
CONFIGURE_ARGS += --with-mbedtls="$(STAGING_DIR)/usr"
endif
CONFIGURE_ARGS += LDFLAGS="-Wl,-static -static -static-libgcc"
endif
define Package/shadowsocks-libev/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-{local,redir,tunnel} $(1)/usr/bin
endef
define Package/shadowsocks-libev-server/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ss-server $(1)/usr/bin
endef
$(eval $(call BuildPackage,shadowsocks-libev))
$(eval $(call BuildPackage,shadowsocks-libev-server))