Gentoo Archives: gentoo-commits

From: Maciej Mrozowski <reavertm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-games/openscenegraph/, dev-games/openscenegraph/files/
Date: Sat, 26 Sep 2020 18:16:31
Message-Id: 1601144162.4ad9aed9c70ec387d36e928871207af5107c7450.reavertm@gentoo
1 commit: 4ad9aed9c70ec387d36e928871207af5107c7450
2 Author: Maciej Mrozowski <reavertm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 26 18:14:25 2020 +0000
4 Commit: Maciej Mrozowski <reavertm <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 26 18:16:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad9aed9
7
8 dev-games/openscenegraph: use boost::asio to fix building RestHttpDevice plugin
9
10 Closes: https://bugs.gentoo.org/744001
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Maciej Mrozowski <reavertm <AT> gentoo.org>
13
14 .../openscenegraph-3.6.5-use_boost_asio.patch | 274 +++++++++++++++++++++
15 ...3.6.5.ebuild => openscenegraph-3.6.5-r1.ebuild} | 6 +-
16 2 files changed, 277 insertions(+), 3 deletions(-)
17
18 diff --git a/dev-games/openscenegraph/files/openscenegraph-3.6.5-use_boost_asio.patch b/dev-games/openscenegraph/files/openscenegraph-3.6.5-use_boost_asio.patch
19 new file mode 100644
20 index 00000000000..4dfeedcaf19
21 --- /dev/null
22 +++ b/dev-games/openscenegraph/files/openscenegraph-3.6.5-use_boost_asio.patch
23 @@ -0,0 +1,274 @@
24 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/CMakeLists.txt osg-my/CMakeLists.txt
25 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/CMakeLists.txt 2020-01-31 12:03:07.000000000 +0100
26 ++++ osg-my/CMakeLists.txt 2020-09-26 18:45:41.191099844 +0200
27 +@@ -764,7 +764,7 @@
28 + FIND_PACKAGE(DirectInput)
29 + FIND_PACKAGE(NVTT)
30 + IF (NOT WIN32)
31 +- FIND_PACKAGE(Asio)
32 ++ FIND_PACKAGE(Boost)
33 + ENDIF()
34 + FIND_PACKAGE(ZeroConf)
35 +
36 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/CMakeModules/FindAsio.cmake osg-my/CMakeModules/FindAsio.cmake
37 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/CMakeModules/FindAsio.cmake 2020-01-31 12:03:07.000000000 +0100
38 ++++ osg-my/CMakeModules/FindAsio.cmake 1970-01-01 01:00:00.000000000 +0100
39 +@@ -1,22 +0,0 @@
40 +-# Locate ASIO-headers (http://think-async.com/Asio)
41 +-# This module defines
42 +-# ASIO_FOUND, if false, do not try to link to gdal
43 +-# ASIO_INCLUDE_DIR, where to find the headers
44 +-#
45 +-# Created by Stephan Maximilian Huber
46 +-
47 +-FIND_PATH(ASIO_INCLUDE_DIR
48 +- NAMES
49 +- asio.hpp
50 +- PATHS
51 +- /usr/include
52 +- /usr/local/include
53 +-)
54 +-
55 +-SET(ASIO_FOUND "NO")
56 +-IF(ASIO_INCLUDE_DIR)
57 +- FIND_PACKAGE( Boost 1.37 )
58 +- IF(Boost_FOUND)
59 +- SET(ASIO_FOUND "YES")
60 +- ENDIF()
61 +-ENDIF()
62 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/CMakeLists.txt osg-my/src/osgPlugins/CMakeLists.txt
63 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/CMakeLists.txt 2020-01-31 12:03:07.000000000 +0100
64 ++++ osg-my/src/osgPlugins/CMakeLists.txt 2020-09-26 20:04:59.345449848 +0200
65 +@@ -299,13 +299,13 @@
66 + #
67 + # Device integration plugins
68 + #
69 +-IF (SDL_FOUND)
70 ++IF(SDL_FOUND)
71 + ADD_PLUGIN_DIRECTORY(sdl)
72 +-ENDIF(SDL_FOUND)
73 ++ENDIF()
74 +
75 +-IF(ASIO_FOUND)
76 ++IF(Boost_FOUND)
77 + ADD_PLUGIN_DIRECTORY(RestHttpDevice)
78 +-ENDIF(ASIO_FOUND)
79 ++ENDIF()
80 +
81 +
82 + IF(ZEROCONF_FOUND)
83 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/CMakeLists.txt osg-my/src/osgPlugins/RestHttpDevice/CMakeLists.txt
84 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/CMakeLists.txt 2020-01-31 12:03:07.000000000 +0100
85 ++++ osg-my/src/osgPlugins/RestHttpDevice/CMakeLists.txt 2020-09-26 18:46:57.096859301 +0200
86 +@@ -1,6 +1,5 @@
87 + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
88 +-INCLUDE_DIRECTORIES(${ASIO_INCLUDE_DIR})
89 +-
90 ++
91 + SET(TARGET_SRC
92 + connection.cpp
93 + io_service_pool.cpp
94 +@@ -26,7 +25,7 @@
95 + RestHttpDevice.hpp
96 + )
97 +
98 +-SET(TARGET_ADDED_LIBRARIES osgPresentation )
99 ++SET(TARGET_ADDED_LIBRARIES osgPresentation)
100 +
101 + #### end var setup ###
102 + SETUP_PLUGIN(resthttp)
103 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/connection.cpp osg-my/src/osgPlugins/RestHttpDevice/connection.cpp
104 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/connection.cpp 2020-01-31 12:03:07.000000000 +0100
105 ++++ osg-my/src/osgPlugins/RestHttpDevice/connection.cpp 2020-09-26 18:32:19.690576603 +0200
106 +@@ -37,14 +37,14 @@
107 + void connection::start()
108 + {
109 + OSG_DEBUG << "RestHttpDevice :: connection::start" << std::endl;
110 +-
111 ++
112 + socket_.async_read_some(asio::buffer(buffer_),
113 + boost::bind(&connection::handle_read, shared_from_this(),
114 + asio::placeholders::error,
115 + asio::placeholders::bytes_transferred));
116 + }
117 +
118 +-void connection::handle_read(const asio::error_code& e,
119 ++void connection::handle_read(const boost::system::error_code& e,
120 + std::size_t bytes_transferred)
121 + {
122 + if (!e)
123 +@@ -82,12 +82,12 @@
124 + // handler returns. The connection class's destructor closes the socket.
125 + }
126 +
127 +-void connection::handle_write(const asio::error_code& e)
128 ++void connection::handle_write(const boost::system::error_code& e)
129 + {
130 + if (!e)
131 + {
132 + // Initiate graceful connection closure.
133 +- asio::error_code ignored_ec;
134 ++ boost::system::error_code ignored_ec;
135 + socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec);
136 + }
137 +
138 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/connection.hpp osg-my/src/osgPlugins/RestHttpDevice/connection.hpp
139 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/connection.hpp 2020-01-31 12:03:07.000000000 +0100
140 ++++ osg-my/src/osgPlugins/RestHttpDevice/connection.hpp 2020-09-26 19:56:49.410701890 +0200
141 +@@ -11,7 +11,7 @@
142 + #ifndef HTTP_SERVER_CONNECTION_HPP
143 + #define HTTP_SERVER_CONNECTION_HPP
144 +
145 +-#include <asio.hpp>
146 ++#include <boost/asio.hpp>
147 + #include <boost/array.hpp>
148 + #include <boost/noncopyable.hpp>
149 + #include <boost/shared_ptr.hpp>
150 +@@ -21,6 +21,8 @@
151 + #include "request_handler.hpp"
152 + #include "request_parser.hpp"
153 +
154 ++using namespace boost;
155 ++
156 + namespace http {
157 + namespace server {
158 +
159 +@@ -42,11 +44,11 @@
160 + ~connection();
161 + private:
162 + /// Handle completion of a read operation.
163 +- void handle_read(const asio::error_code& e,
164 ++ void handle_read(const boost::system::error_code& e,
165 + std::size_t bytes_transferred);
166 +
167 + /// Handle completion of a write operation.
168 +- void handle_write(const asio::error_code& e);
169 ++ void handle_write(const boost::system::error_code& e);
170 +
171 + /// Socket for the connection.
172 + asio::ip::tcp::socket socket_;
173 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/io_service_pool.cpp osg-my/src/osgPlugins/RestHttpDevice/io_service_pool.cpp
174 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/io_service_pool.cpp 2020-01-31 12:03:07.000000000 +0100
175 ++++ osg-my/src/osgPlugins/RestHttpDevice/io_service_pool.cpp 2020-09-26 19:56:12.353279737 +0200
176 +@@ -11,7 +11,7 @@
177 + #include "server.hpp"
178 + #include <stdexcept>
179 + #include <boost/bind.hpp>
180 +-#include <boost/shared_ptr.hpp>
181 ++#include <boost/thread.hpp>
182 +
183 + namespace http {
184 + namespace server {
185 +@@ -36,17 +36,14 @@
186 + void io_service_pool::run()
187 + {
188 + // Create a pool of threads to run all of the io_services.
189 +- std::vector<boost::shared_ptr<asio::thread> > threads;
190 ++ std::vector<thread> threads;
191 + for (std::size_t i = 0; i < io_services_.size(); ++i)
192 +- {
193 +- boost::shared_ptr<asio::thread> thread(new asio::thread(
194 +- boost::bind(&asio::io_service::run, io_services_[i])));
195 +- threads.push_back(thread);
196 +- }
197 ++ threads.emplace_back(thread(boost::bind(&asio::io_service::run,
198 ++ io_services_[i])));
199 +
200 + // Wait for all threads in the pool to exit.
201 + for (std::size_t i = 0; i < threads.size(); ++i)
202 +- threads[i]->join();
203 ++ threads[i].join();
204 + }
205 +
206 + void io_service_pool::stop()
207 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/io_service_pool.hpp osg-my/src/osgPlugins/RestHttpDevice/io_service_pool.hpp
208 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/io_service_pool.hpp 2020-01-31 12:03:07.000000000 +0100
209 ++++ osg-my/src/osgPlugins/RestHttpDevice/io_service_pool.hpp 2020-09-26 18:37:02.119722575 +0200
210 +@@ -11,11 +11,13 @@
211 + #ifndef HTTP_SERVER_IO_SERVICE_POOL_HPP
212 + #define HTTP_SERVER_IO_SERVICE_POOL_HPP
213 +
214 +-#include <asio.hpp>
215 ++#include <boost/asio.hpp>
216 + #include <vector>
217 + #include <boost/noncopyable.hpp>
218 + #include <boost/shared_ptr.hpp>
219 +
220 ++using namespace boost;
221 ++
222 + namespace http {
223 + namespace server {
224 +
225 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/reply.hpp osg-my/src/osgPlugins/RestHttpDevice/reply.hpp
226 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/reply.hpp 2020-01-31 12:03:07.000000000 +0100
227 ++++ osg-my/src/osgPlugins/RestHttpDevice/reply.hpp 2020-09-26 18:28:42.741206569 +0200
228 +@@ -13,9 +13,11 @@
229 +
230 + #include <string>
231 + #include <vector>
232 +-#include <asio.hpp>
233 ++#include <boost/asio.hpp>
234 + #include "header.hpp"
235 +
236 ++using namespace boost;
237 ++
238 + namespace http {
239 + namespace server {
240 +
241 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/server.cpp osg-my/src/osgPlugins/RestHttpDevice/server.cpp
242 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/server.cpp 2020-01-31 12:03:07.000000000 +0100
243 ++++ osg-my/src/osgPlugins/RestHttpDevice/server.cpp 2020-09-26 19:53:17.692061347 +0200
244 +@@ -23,7 +23,7 @@
245 + request_handler_(doc_root)
246 + {
247 + // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
248 +- asio::ip::tcp::resolver resolver(acceptor_.get_io_service());
249 ++ asio::ip::tcp::resolver resolver(io_service_pool_.get_io_service());
250 + asio::ip::tcp::resolver::query query(address, port);
251 + asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
252 + acceptor_.open(endpoint.protocol());
253 +@@ -47,7 +47,7 @@
254 + io_service_pool_.stop();
255 + }
256 +
257 +-void server::handle_accept(const asio::error_code& e)
258 ++void server::handle_accept(const boost::system::error_code& e)
259 + {
260 + if (!e)
261 + {
262 +diff -ruN OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/server.hpp osg-my/src/osgPlugins/RestHttpDevice/server.hpp
263 +--- OpenSceneGraph-OpenSceneGraph-3.6.5/src/osgPlugins/RestHttpDevice/server.hpp 2020-01-31 12:03:07.000000000 +0100
264 ++++ osg-my/src/osgPlugins/RestHttpDevice/server.hpp 2020-09-26 18:29:38.894046375 +0200
265 +@@ -11,7 +11,7 @@
266 + #ifndef HTTP_SERVER_SERVER_HPP
267 + #define HTTP_SERVER_SERVER_HPP
268 +
269 +-#include <asio.hpp>
270 ++#include <boost/asio.hpp>
271 + #include <string>
272 + #include <vector>
273 + #include <boost/noncopyable.hpp>
274 +@@ -20,6 +20,8 @@
275 + #include "io_service_pool.hpp"
276 + #include "request_handler.hpp"
277 +
278 ++using namespace boost;
279 ++
280 + namespace http {
281 + namespace server {
282 +
283 +@@ -38,12 +40,12 @@
284 +
285 + /// Stop the server.
286 + void stop();
287 +-
288 ++
289 + void setCallback(request_handler::Callback* cb) { request_handler_.setCallback(cb); }
290 +
291 + private:
292 + /// Handle completion of an asynchronous accept operation.
293 +- void handle_accept(const asio::error_code& e);
294 ++ void handle_accept(const boost::system::error_code& e);
295 +
296 + /// The pool of io_service objects used to perform asynchronous operations.
297 + io_service_pool io_service_pool_;
298
299 diff --git a/dev-games/openscenegraph/openscenegraph-3.6.5.ebuild b/dev-games/openscenegraph/openscenegraph-3.6.5-r1.ebuild
300 similarity index 96%
301 rename from dev-games/openscenegraph/openscenegraph-3.6.5.ebuild
302 rename to dev-games/openscenegraph/openscenegraph-3.6.5-r1.ebuild
303 index 6a1d992b139..66084018cb7 100644
304 --- a/dev-games/openscenegraph/openscenegraph-3.6.5.ebuild
305 +++ b/dev-games/openscenegraph/openscenegraph-3.6.5-r1.ebuild
306 @@ -15,7 +15,7 @@ SRC_URI="https://github.com/${PN}/${MY_PN}/archive/${MY_P}.tar.gz"
307 LICENSE="wxWinLL-3 LGPL-2.1"
308 SLOT="0/161" # NOTE: CHECK WHEN BUMPING! Subslot is SOVERSION
309 KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
310 -IUSE="asio curl dicom debug doc egl examples ffmpeg fltk fox gdal gif glut
311 +IUSE="curl dicom debug doc egl examples ffmpeg fltk fox gdal gif glut
312 gstreamer jpeg las lua openexr openinventor osgapps pdf png sdl sdl2
313 svg tiff truetype vnc wxwidgets xrandr +zlib"
314
315 @@ -33,7 +33,6 @@ RDEPEND="
316 virtual/opengl
317 x11-libs/libSM
318 x11-libs/libXext
319 - asio? ( dev-cpp/asio )
320 curl? ( net-misc/curl )
321 examples? (
322 fltk? ( x11-libs/fltk:1[opengl] )
323 @@ -71,6 +70,7 @@ RDEPEND="
324 zlib? ( sys-libs/zlib )
325 "
326 DEPEND="${RDEPEND}
327 + >=dev-libs/boost-1.37.0:*
328 x11-base/xorg-proto
329 "
330
331 @@ -79,6 +79,7 @@ S="${WORKDIR}/${MY_PN}-${MY_P}"
332 PATCHES=(
333 "${FILESDIR}"/${PN}-3.6.3-cmake.patch
334 "${FILESDIR}"/${PN}-3.6.3-docdir.patch
335 + "${FILESDIR}"/${PN}-3.6.5-use_boost_asio.patch
336 )
337
338 src_configure() {
339 @@ -94,7 +95,6 @@ src_configure() {
340 -DDYNAMIC_OPENSCENEGRAPH=ON
341 -DLIB_POSTFIX=${libdir/lib}
342 -DOPENGL_PROFILE=GL2 #GL1 GL2 GL3 GLES1 GLES3 GLES3
343 - $(cmake_use_find_package asio Asio)
344 $(cmake_use_find_package curl CURL)
345 -DBUILD_DOCUMENTATION=$(usex doc)
346 $(cmake_use_find_package dicom DCMTK)