@@ -5,51 +5,96 @@ package("zeromq")
5
5
6
6
set_urls (" https://github.com/zeromq/libzmq/releases/download/v$(version)/zeromq-$(version).tar.gz" ,
7
7
" https://github.com/zeromq/libzmq.git" )
8
+
8
9
add_versions (" 4.3.5" , " 6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43" )
9
10
add_versions (" 4.3.2" , " ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763" )
10
11
add_versions (" 4.3.4" , " c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5" )
11
12
13
+ add_patches (" 4.3.5" , " patches/4.3.5/mingw.patch" , " d36460c7080f928cd83f2a5752ed832cc2dd8c0ce4d8d69fc8e23f09d48f166c" )
12
14
add_patches (" 4.3.4" , " https://github.com/zeromq/libzmq/commit/438d5d88392baffa6c2c5e0737d9de19d6686f0d.patch" , " 08f8068e109225ff628f9205597b917f633f02bc0be9382b06fbd98b0de2f8a0" )
13
15
14
- if is_plat (" macosx" ) then
16
+ if is_plat (" mingw" ) and is_subhost (" msys" ) then
17
+ add_extsources (" pacman::zeromq" )
18
+ elseif is_plat (" linux" ) then
19
+ add_extsources (" pacman::zeromq" )
20
+ elseif is_plat (" macosx" ) then
15
21
add_extsources (" brew::zeromq" )
16
22
end
17
23
24
+ add_configs (" openpgm" , {description = " Build with support for OpenPGM" , default = false , type = " boolean" , readonly = true })
25
+ add_configs (" norm" , {description = " Build with support for NORM" , default = false , type = " boolean" , readonly = true })
26
+ add_configs (" vmci" , {description = " Build with support for VMware VMCI socket" , default = false , type = " boolean" , readonly = true })
27
+
28
+ add_configs (" curve" , {description = " Enable CURVE security" , default = false , type = " boolean" })
18
29
if is_plat (" linux" ) then
19
30
add_configs (" libunwind" , {description = " Enable libunwind." , default = false , type = " boolean" })
20
31
end
21
32
22
- if is_plat (" windows" ) then
23
- add_deps (" cmake" )
33
+ if is_plat (" windows" , " mingw" ) then
24
34
add_syslinks (" ws2_32" , " advapi32" , " rpcrt4" , " iphlpapi" )
25
- elseif is_plat (" linux" ) then
35
+ elseif is_plat (" linux" , " bsd " ) then
26
36
add_syslinks (" pthread" )
27
37
end
28
- on_load (" windows" , " linux" , function (package )
29
- if package :is_plat (" windows" ) and not package :config (" shared" ) then
38
+
39
+ add_deps (" cmake" )
40
+
41
+ on_load (function (package )
42
+ if not package :config (" shared" ) then
30
43
package :add (" defines" , " ZMQ_STATIC" )
31
44
end
45
+
46
+ if package :config (" openpgm" ) then
47
+ package :add (" deps" , " openpgm" )
48
+ end
49
+ if package :config (" norm" ) then
50
+ package :add (" deps" , " norm" )
51
+ end
52
+ if package :config (" curve" ) then
53
+ package :add (" deps" , " libsodium" )
54
+ end
55
+
32
56
if package :is_plat (" linux" ) and package :config (" libunwind" ) then
33
57
package :add (" deps" , " libunwind" )
34
58
end
35
59
end )
36
60
37
- on_install (" windows " , function (package )
61
+ on_install (function (package )
38
62
io .replace (" CMakeLists.txt" , " NOT ${CMAKE_BUILD_TYPE} MATCHES \" Debug\" " , " FALSE" , {plain = true })
39
- local configs = {" -DBUILD_TESTS=OFF" , " -DLIBZMQ_WERROR=OFF" }
40
- table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :debug () and " Debug" or " Release" ))
63
+
64
+ local configs = {
65
+ " -DBUILD_TESTS=OFF" ,
66
+ " -DLIBZMQ_WERROR=OFF" ,
67
+ " -DWITH_DOC=OFF" ,
68
+ " -DWITH_DOCS=OFF" ,
69
+ " -DWITH_PERF_TOOL=OFF" ,
70
+ " -DENABLE_CPACK=OFF" ,
71
+ " -DENABLE_CLANG=OFF" ,
72
+ }
73
+ table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
41
74
table.insert (configs , " -DBUILD_STATIC=" .. (package :config (" shared" ) and " OFF" or " ON" ))
42
75
table.insert (configs , " -DBUILD_SHARED=" .. (package :config (" shared" ) and " ON" or " OFF" ))
43
- import (" package.tools.cmake" ).install (package , configs )
44
- end )
76
+ table.insert (configs , " -DENABLE_ASAN=" .. (package :config (" asan" ) and " ON" or " OFF" ))
77
+ if (package :is_plat (" windows" ) and package :is_cross ()) or package :is_plat (" mingw" ) then
78
+ -- hardcode win10
79
+ table.insert (configs , " -DCMAKE_SYSTEM_VERSION=10.0" )
80
+ end
45
81
46
- on_install (" linux" , " macosx" , function (package )
47
- local configs = {" --disable-dependency-tracking" , " --without-docs" , " --enable-libbsd=no" , " --disable-Werror" }
48
- table.insert (configs , " --enable-static=" .. (package :config (" shared" ) and " no" or " yes" ))
49
- table.insert (configs , " --enable-shared=" .. (package :config (" shared" ) and " yes" or " no" ))
50
- table.insert (configs , " --enable-libunwind=" .. (package :config (" libunwind" ) and " yes" or " no" ))
51
- table.insert (configs , " --libdir=" .. package :installdir (" lib" ))
52
- import (" package.tools.autoconf" ).install (package , configs )
82
+ table.insert (configs , " -DWITH_OPENPGM=" .. (package :config (" openpgm" ) and " ON" or " OFF" ))
83
+ table.insert (configs , " -DWITH_NORM=" .. (package :config (" norm" ) and " ON" or " OFF" ))
84
+ table.insert (configs , " -DWITH_VMCI=" .. (package :config (" vmci" ) and " ON" or " OFF" ))
85
+ if package :is_plat (" mingw" ) then
86
+ table.insert (configs , " -DPOLLER=epoll" )
87
+ end
88
+
89
+ local libsodium = package :dep (" libsodium" )
90
+ if libsodium then
91
+ table.insert (configs , " -DENABLE_CURVE=ON" )
92
+ table.insert (configs , " -DWITH_LIBSODIUM=ON" )
93
+ table.insert (configs , " -DWITH_LIBSODIUM_STATIC=" .. (libsodium :config (" shared" ) and " OFF" or " ON" ))
94
+ else
95
+ table.insert (configs , " -DENABLE_CURVE=OFF" )
96
+ end
97
+ import (" package.tools.cmake" ).install (package , configs )
53
98
end )
54
99
55
100
on_test (function (package )
0 commit comments