Gentoo Archives: gentoo-commits

From: Adrian Schollmeyer <nex+b-g-o@××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-libs/ixwebsocket/files/, net-libs/ixwebsocket/
Date: Mon, 20 Sep 2021 14:34:45
Message-Id: 1632148413.230ae6504e8044193141d4455eff013e56e7aebe.nex+b-g-o@gentoo
1 commit: 230ae6504e8044193141d4455eff013e56e7aebe
2 Author: Adrian Schollmeyer <nex+b-g-o <AT> nexadn <DOT> de>
3 AuthorDate: Mon Sep 20 14:28:11 2021 +0000
4 Commit: Adrian Schollmeyer <nex+b-g-o <AT> nexadn <DOT> de>
5 CommitDate: Mon Sep 20 14:33:33 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=230ae650
7
8 net-libs/ixwebsocket: Add new package
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Adrian Schollmeyer <nex+b-g-o <AT> nexadn.de>
12
13 net-libs/ixwebsocket/Manifest | 1 +
14 .../files/ixwebsocket-11.2.8-remove-deflate.patch | 19 +++++++
15 .../ixwebsocket-11.2.8-remove-network-tests.patch | 28 ++++++++++
16 .../ixwebsocket-11.2.8-use-gnuinstalldirs.patch | 34 ++++++++++++
17 .../ixwebsocket-11.2.8-use-system-spdlog.patch | 55 +++++++++++++++++++
18 net-libs/ixwebsocket/ixwebsocket-11.2.8.ebuild | 62 ++++++++++++++++++++++
19 net-libs/ixwebsocket/metadata.xml | 11 ++++
20 7 files changed, 210 insertions(+)
21
22 diff --git a/net-libs/ixwebsocket/Manifest b/net-libs/ixwebsocket/Manifest
23 new file mode 100644
24 index 000000000..a2f68d56b
25 --- /dev/null
26 +++ b/net-libs/ixwebsocket/Manifest
27 @@ -0,0 +1 @@
28 +DIST ixwebsocket-11.2.8.tar.gz 583075 BLAKE2B 014af74ec236a49b8bad574761e6d861348ef22f3cbda798862f87591c27c2ee8b94f740d534ed7f6fc0736ea2e06788c64a208dab65575aa815d40472c6c50d SHA512 7938c2b59b5f310afa1a0c94171dd55a4e8821ac0763feb11528d520f1d3bf1037bb8d53d31eec1952888f601f597c00c9490e15cfca7f9c3aa6d80614d7b1f5
29
30 diff --git a/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-deflate.patch b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-deflate.patch
31 new file mode 100644
32 index 000000000..fffedc6b7
33 --- /dev/null
34 +++ b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-deflate.patch
35 @@ -0,0 +1,19 @@
36 +diff --git a/CMakeLists.txt b/CMakeLists.txt
37 +index 77d2f6b..665c35f 100644
38 +--- a/CMakeLists.txt
39 ++++ b/CMakeLists.txt
40 +@@ -206,14 +206,6 @@ if (USE_ZLIB)
41 + target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_ZLIB)
42 + endif()
43 +
44 +-# brew install libdeflate
45 +-find_package(Deflate)
46 +-if (DEFLATE_FOUND)
47 +- include_directories(${DEFLATE_INCLUDE_DIRS})
48 +- target_link_libraries(ixwebsocket ${DEFLATE_LIBRARIES})
49 +- target_compile_definitions(ixwebsocket PUBLIC IXWEBSOCKET_USE_DEFLATE)
50 +-endif()
51 +-
52 + if (WIN32)
53 + target_link_libraries(ixwebsocket wsock32 ws2_32 shlwapi)
54 + add_definitions(-D_CRT_SECURE_NO_WARNINGS)
55
56 diff --git a/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-network-tests.patch b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-network-tests.patch
57 new file mode 100644
58 index 000000000..a2d1360cb
59 --- /dev/null
60 +++ b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-remove-network-tests.patch
61 @@ -0,0 +1,28 @@
62 +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
63 +index 661aebb..bab73c7 100644
64 +--- a/test/CMakeLists.txt
65 ++++ b/test/CMakeLists.txt
66 +@@ -11,15 +11,12 @@ option(USE_TLS "Add TLS support" ON)
67 +
68 + # Shared sources
69 + set (TEST_TARGET_NAMES
70 +- IXSocketTest
71 + IXSocketConnectTest
72 + IXWebSocketServerTest
73 + IXWebSocketTestConnectionDisconnection
74 + IXUrlParserTest
75 +- IXHttpClientTest
76 + IXUnityBuildsTest
77 + IXHttpTest
78 +- IXDNSLookupTest
79 + IXWebSocketSubProtocolTest
80 + # IXWebSocketBroadcastTest ## FIXME was depending on cobra / take a broadcast server from ws
81 + IXStrCaseCompareTest
82 +@@ -33,7 +30,6 @@ if (UNIX)
83 +
84 + # Fail on Windows in CI probably because the pathing is wrong and
85 + # some resource files cannot be found
86 +- IXHttpServerTest
87 + IXWebSocketChatTest
88 + )
89 + endif()
90
91 diff --git a/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-gnuinstalldirs.patch b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-gnuinstalldirs.patch
92 new file mode 100644
93 index 000000000..a7e2b6ba8
94 --- /dev/null
95 +++ b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-gnuinstalldirs.patch
96 @@ -0,0 +1,34 @@
97 +diff --git a/CMakeLists.txt b/CMakeLists.txt
98 +index 77d2f6b..4c64106 100644
99 +--- a/CMakeLists.txt
100 ++++ b/CMakeLists.txt
101 +@@ -238,23 +238,25 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
102 + target_compile_options(ixwebsocket PRIVATE /MP)
103 + endif()
104 +
105 ++include(GNUInstallDirs)
106 ++
107 + target_include_directories(ixwebsocket PUBLIC
108 + $<BUILD_INTERFACE:${IXWEBSOCKET_INCLUDE_DIRS}/>
109 +- $<INSTALL_INTERFACE:include/ixwebsocket>
110 ++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ixwebsocket>
111 + )
112 +
113 + set_target_properties(ixwebsocket PROPERTIES PUBLIC_HEADER "${IXWEBSOCKET_HEADERS}")
114 +
115 + install(TARGETS ixwebsocket
116 + EXPORT ixwebsocket
117 +- ARCHIVE DESTINATION lib
118 +- PUBLIC_HEADER DESTINATION include/ixwebsocket/
119 ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
120 ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ixwebsocket/
121 + )
122 +
123 + install(EXPORT ixwebsocket
124 + FILE ixwebsocket-config.cmake
125 + NAMESPACE ixwebsocket::
126 +- DESTINATION lib/cmake/ixwebsocket)
127 ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ixwebsocket)
128 +
129 + if (USE_WS OR USE_TEST)
130 + include(FetchContent)
131
132 diff --git a/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-system-spdlog.patch b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-system-spdlog.patch
133 new file mode 100644
134 index 000000000..ed329b41d
135 --- /dev/null
136 +++ b/net-libs/ixwebsocket/files/ixwebsocket-11.2.8-use-system-spdlog.patch
137 @@ -0,0 +1,55 @@
138 +diff --git a/CMakeLists.txt b/CMakeLists.txt
139 +index 77d2f6b..86c7172 100644
140 +--- a/CMakeLists.txt
141 ++++ b/CMakeLists.txt
142 +@@ -257,13 +257,9 @@ install(EXPORT ixwebsocket
143 + DESTINATION lib/cmake/ixwebsocket)
144 +
145 + if (USE_WS OR USE_TEST)
146 +- include(FetchContent)
147 +- FetchContent_Declare(spdlog
148 +- GIT_REPOSITORY "https://github.com/gabime/spdlog"
149 +- GIT_TAG "v1.8.0"
150 +- GIT_SHALLOW 1)
151 +-
152 +- FetchContent_MakeAvailable(spdlog)
153 ++ find_package(spdlog REQUIRED)
154 ++ find_package(fmt REQUIRED)
155 ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSPDLOG_FMT_EXTERNAL")
156 +
157 + if (USE_WS)
158 + add_subdirectory(ws)
159 +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
160 +index 661aebb..ab0c92e 100644
161 +--- a/test/CMakeLists.txt
162 ++++ b/test/CMakeLists.txt
163 +@@ -66,7 +66,7 @@ target_include_directories(ixwebsocket_test PRIVATE
164 + ../third_party
165 + )
166 + target_link_libraries(ixwebsocket_test ixwebsocket)
167 +-target_link_libraries(ixwebsocket_test spdlog)
168 ++target_link_libraries(ixwebsocket_test spdlog::spdlog fmt::fmt)
169 +
170 + foreach(TEST_TARGET_NAME ${TEST_TARGET_NAMES})
171 + add_executable(${TEST_TARGET_NAME}
172 +@@ -89,7 +89,7 @@ foreach(TEST_TARGET_NAME ${TEST_TARGET_NAMES})
173 + target_link_libraries(${TEST_TARGET_NAME} ixwebsocket_test)
174 + target_link_libraries(${TEST_TARGET_NAME} ixwebsocket)
175 +
176 +- target_link_libraries(${TEST_TARGET_NAME} spdlog)
177 ++ target_link_libraries(${TEST_TARGET_NAME} spdlog fmt)
178 +
179 + add_test(NAME ${TEST_TARGET_NAME}
180 + COMMAND ${TEST_TARGET_NAME}
181 +diff --git a/ws/CMakeLists.txt b/ws/CMakeLists.txt
182 +index 98f15de..10834e5 100644
183 +--- a/ws/CMakeLists.txt
184 ++++ b/ws/CMakeLists.txt
185 +@@ -31,6 +31,6 @@ add_executable(ws
186 + # library with the most dependencies come first
187 + target_link_libraries(ws ixwebsocket)
188 +
189 +-target_link_libraries(ws spdlog)
190 ++target_link_libraries(ws spdlog::spdlog fmt::fmt)
191 +
192 + install(TARGETS ws RUNTIME DESTINATION bin)
193
194 diff --git a/net-libs/ixwebsocket/ixwebsocket-11.2.8.ebuild b/net-libs/ixwebsocket/ixwebsocket-11.2.8.ebuild
195 new file mode 100644
196 index 000000000..43bcde917
197 --- /dev/null
198 +++ b/net-libs/ixwebsocket/ixwebsocket-11.2.8.ebuild
199 @@ -0,0 +1,62 @@
200 +# Copyright 2021 Gentoo Authors
201 +# Distributed under the terms of the GNU General Public License v2
202 +
203 +EAPI=8
204 +
205 +inherit cmake
206 +
207 +MY_P="IXWebSocket-${PV}"
208 +
209 +DESCRIPTION="C++ websocket client and server library"
210 +HOMEPAGE="https://github.com/machinezone/IXWebSocket"
211 +SRC_URI="https://github.com/machinezone/IXWebSocket/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
212 +
213 +LICENSE="BSD"
214 +SLOT="0"
215 +KEYWORDS="~amd64 ~x86"
216 +IUSE="+ssl test zlib ws"
217 +
218 +DEPEND="
219 + sys-libs/zlib:=
220 +
221 + ws? (
222 + >=dev-libs/spdlog-1.8.0:=
223 + )
224 + test? (
225 + >=dev-libs/spdlog-1.8.0:=
226 + )
227 +"
228 +RDEPEND="
229 + sys-libs/zlib:=
230 +"
231 +BDEPEND=""
232 +
233 +S="${WORKDIR}/${MY_P}"
234 +
235 +RESTRICT="!test? ( test )"
236 +
237 +PATCHES=(
238 + # Upstream installs to hardcoded lib- and include-dirs
239 + "${FILESDIR}/${P}-use-gnuinstalldirs.patch"
240 + # Some tests require network connectivity
241 + "${FILESDIR}/${P}-remove-network-tests.patch"
242 + # Upstream uses git submodules
243 + "${FILESDIR}/${P}-use-system-spdlog.patch"
244 + # Upstream detects deflate dynamically, so let's remove it
245 + "${FILESDIR}/${P}-remove-deflate.patch"
246 +)
247 +
248 +src_configure() {
249 + local mycmakeargs=(
250 + -DUSE_TLS="$(usex ssl)"
251 + -DUSE_ZLIB="$(usex zlib)"
252 + -DUSE_WS="$(usex ws)"
253 + -DUSE_TEST="$(usex test)"
254 + )
255 + cmake_src_configure
256 +}
257 +
258 +src_test() {
259 + cd "${BUILD_DIR}" || die
260 + ctest --output-on-failure || die
261 +}
262
263 diff --git a/net-libs/ixwebsocket/metadata.xml b/net-libs/ixwebsocket/metadata.xml
264 new file mode 100644
265 index 000000000..1d44d14fb
266 --- /dev/null
267 +++ b/net-libs/ixwebsocket/metadata.xml
268 @@ -0,0 +1,11 @@
269 +<?xml version="1.0" encoding="UTF-8"?>
270 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
271 +<pkgmetadata>
272 + <maintainer type="person">
273 + <name>Adrian Schollmeyer</name>
274 + <email>nex+b-g-o@××××××.de</email>
275 + </maintainer>
276 + <use>
277 + <flag name="ws">Build the ws utility</flag>
278 + </use>
279 +</pkgmetadata>