Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libtorrent-rasterbar/files/, net-libs/libtorrent-rasterbar/
Date: Thu, 02 May 2019 19:16:30
Message-Id: 1556824559.8fd1300cdd710f78fa75b9245dd020eeea18643b.zlogene@gentoo
1 commit: 8fd1300cdd710f78fa75b9245dd020eeea18643b
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 2 19:15:59 2019 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Thu May 2 19:15:59 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fd1300c
7
8 net-libs/libtorrent-rasterbar: fix boost-1.70 compat
9
10 Closes: https://bugs.gentoo.org/683764
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12 Package-Manager: Portage-2.3.62, Repoman-2.3.11
13
14 .../files/fix-boost-1.70.patch | 295 +++++++++++++++++++++
15 .../libtorrent-rasterbar-1.2.0.ebuild | 2 +
16 2 files changed, 297 insertions(+)
17
18 diff --git a/net-libs/libtorrent-rasterbar/files/fix-boost-1.70.patch b/net-libs/libtorrent-rasterbar/files/fix-boost-1.70.patch
19 new file mode 100644
20 index 00000000000..25adcdedcea
21 --- /dev/null
22 +++ b/net-libs/libtorrent-rasterbar/files/fix-boost-1.70.patch
23 @@ -0,0 +1,295 @@
24 +From 76c2794923c4c101ff715be11d794f7fefc6c524 Mon Sep 17 00:00:00 2001
25 +From: Arvid Norberg <arvid.norberg@×××××.com>
26 +Date: Fri, 19 Apr 2019 20:56:19 +0200
27 +Subject: [PATCH] fix build with boost-1.70 (#3788)
28 +
29 +fix build with boost 1.70.0 Fix #3683
30 +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@×××××.com>
31 +---
32 + include/libtorrent/io_service.hpp | 3 +++
33 + include/libtorrent/io_service_fwd.hpp | 13 +++++++++++--
34 + include/libtorrent/proxy_base.hpp | 2 +-
35 + include/libtorrent/tracker_manager.hpp | 2 +-
36 + include/libtorrent/udp_socket.hpp | 2 +-
37 + src/disk_io_thread_pool.cpp | 2 +-
38 + src/http_connection.cpp | 18 +++++++++---------
39 + src/kademlia/dht_tracker.cpp | 2 +-
40 + src/lsd.cpp | 4 ++--
41 + src/natpmp.cpp | 6 +++---
42 + src/udp_socket.cpp | 2 +-
43 + src/upnp.cpp | 2 +-
44 + test/test_fast_extension.cpp | 2 +-
45 + 13 files changed, 36 insertions(+), 24 deletions(-)
46 +
47 +diff --git a/include/libtorrent/io_service.hpp b/include/libtorrent/io_service.hpp
48 +index 123274019b..5f6be1a2ca 100644
49 +--- a/include/libtorrent/io_service.hpp
50 ++++ b/include/libtorrent/io_service.hpp
51 +@@ -38,9 +38,12 @@ POSSIBILITY OF SUCH DAMAGE.
52 + #else
53 + #include "libtorrent/aux_/disable_warnings_push.hpp"
54 + #include <boost/asio/io_service.hpp>
55 ++#include <boost/version.hpp>
56 + #include "libtorrent/aux_/disable_warnings_pop.hpp"
57 + #endif // SIMULATOR
58 +
59 ++#include "libtorrent/io_service_fwd.hpp"
60 ++
61 + namespace libtorrent {
62 +
63 + #if defined TORRENT_BUILD_SIMULATOR
64 +diff --git a/include/libtorrent/io_service_fwd.hpp b/include/libtorrent/io_service_fwd.hpp
65 +index 1b22c3e58f..71b845d3f3 100644
66 +--- a/include/libtorrent/io_service_fwd.hpp
67 ++++ b/include/libtorrent/io_service_fwd.hpp
68 +@@ -55,10 +55,19 @@ namespace boost { namespace asio {
69 + namespace libtorrent {
70 +
71 + #if defined TORRENT_BUILD_SIMULATOR
72 +- typedef sim::asio::io_service io_service;
73 ++ using io_service = sim::asio::io_service;
74 + #else
75 +- typedef boost::asio::io_service io_service;
76 ++ using io_service = boost::asio::io_service;
77 + #endif
78 ++
79 ++#if BOOST_VERSION >= 107000
80 ++template <typename T>
81 ++io_service& get_io_service(T& o) { return static_cast<io_service&>(o.get_executor().context()); }
82 ++#else
83 ++template <typename T>
84 ++io_service& get_io_service(T& o) { return o.get_io_service(); }
85 ++#endif
86 ++
87 + }
88 +
89 + #endif
90 +diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp
91 +index 344c230977..d7666545c6 100644
92 +--- a/include/libtorrent/proxy_base.hpp
93 ++++ b/include/libtorrent/proxy_base.hpp
94 +@@ -246,7 +246,7 @@ class proxy_base
95 +
96 + io_service& get_io_service()
97 + {
98 +- return m_sock.get_io_service();
99 ++ return lt::get_io_service(m_sock);
100 + }
101 +
102 + lowest_layer_type& lowest_layer()
103 +diff --git a/include/libtorrent/tracker_manager.hpp b/include/libtorrent/tracker_manager.hpp
104 +index 86331adbca..1fc28e89ff 100644
105 +--- a/include/libtorrent/tracker_manager.hpp
106 ++++ b/include/libtorrent/tracker_manager.hpp
107 +@@ -259,7 +259,7 @@ namespace libtorrent {
108 + virtual void on_timeout(error_code const& ec) = 0;
109 + virtual ~timeout_handler();
110 +
111 +- io_service& get_io_service() { return m_timeout.get_io_service(); }
112 ++ io_service& get_io_service() { return lt::get_io_service(m_timeout); }
113 +
114 + private:
115 +
116 +diff --git a/include/libtorrent/udp_socket.hpp b/include/libtorrent/udp_socket.hpp
117 +index f4dcbeb248..c5c9aeba66 100644
118 +--- a/include/libtorrent/udp_socket.hpp
119 ++++ b/include/libtorrent/udp_socket.hpp
120 +@@ -61,7 +61,7 @@ namespace libtorrent {
121 + static constexpr udp_send_flags_t dont_fragment = 3_bit;
122 +
123 + bool is_open() const { return m_abort == false; }
124 +- io_service& get_io_service() { return m_socket.get_io_service(); }
125 ++ io_service& get_io_service() { return lt::get_io_service(m_socket); }
126 +
127 + template <typename Handler>
128 + void async_read(Handler&& h)
129 +diff --git a/src/disk_io_thread_pool.cpp b/src/disk_io_thread_pool.cpp
130 +index 4d4b5ee678..123159a45d 100644
131 +--- a/src/disk_io_thread_pool.cpp
132 ++++ b/src/disk_io_thread_pool.cpp
133 +@@ -173,7 +173,7 @@ namespace libtorrent {
134 + // buffer pool won't exist anymore, and crash. This prevents that.
135 + m_threads.emplace_back(&pool_thread_interface::thread_fun
136 + , &m_thread_iface, std::ref(*this)
137 +- , io_service::work(m_idle_timer.get_io_service()));
138 ++ , io_service::work(get_io_service(m_idle_timer)));
139 + }
140 + }
141 +
142 +diff --git a/src/http_connection.cpp b/src/http_connection.cpp
143 +index e01e9ea1d5..81e5368a55 100644
144 +--- a/src/http_connection.cpp
145 ++++ b/src/http_connection.cpp
146 +@@ -148,7 +148,7 @@ void http_connection::get(std::string const& url, time_duration timeout, int pri
147 +
148 + if (ec)
149 + {
150 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
151 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
152 + , me, ec, span<char>{}));
153 + return;
154 + }
155 +@@ -160,7 +160,7 @@ void http_connection::get(std::string const& url, time_duration timeout, int pri
156 + )
157 + {
158 + error_code err(errors::unsupported_url_protocol);
159 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
160 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
161 + , me, err, span<char>{}));
162 + return;
163 + }
164 +@@ -258,7 +258,7 @@ void http_connection::start(std::string const& hostname, int port
165 +
166 + if (ec)
167 + {
168 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
169 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
170 + , me, ec, span<char>{}));
171 + return;
172 + }
173 +@@ -297,7 +297,7 @@ void http_connection::start(std::string const& hostname, int port
174 + #if TORRENT_USE_I2P
175 + if (i2p_conn->proxy().type != settings_pack::i2p_proxy)
176 + {
177 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
178 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
179 + , me, error_code(errors::no_i2p_router), span<char>{}));
180 + return;
181 + }
182 +@@ -332,8 +332,8 @@ void http_connection::start(std::string const& hostname, int port
183 + m_ssl_ctx->set_verify_mode(ssl::context::verify_none, ec);
184 + if (ec)
185 + {
186 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
187 +- , me, ec, span<char>{}));
188 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
189 ++ , me, ec, span<char>{}));
190 + return;
191 + }
192 + }
193 +@@ -344,7 +344,7 @@ void http_connection::start(std::string const& hostname, int port
194 + // assume this is not a tracker connection. Tracker connections that
195 + // shouldn't be subject to the proxy should pass in nullptr as the proxy
196 + // pointer.
197 +- instantiate_connection(m_timer.get_io_service()
198 ++ instantiate_connection(lt::get_io_service(m_timer)
199 + , proxy ? *proxy : null_proxy, m_sock, userdata, nullptr, false, false);
200 +
201 + if (m_bind_addr)
202 +@@ -353,7 +353,7 @@ void http_connection::start(std::string const& hostname, int port
203 + m_sock.bind(tcp::endpoint(*m_bind_addr, 0), ec);
204 + if (ec)
205 + {
206 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
207 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
208 + , me, ec, span<char>{}));
209 + return;
210 + }
211 +@@ -362,7 +362,7 @@ void http_connection::start(std::string const& hostname, int port
212 + setup_ssl_hostname(m_sock, hostname, ec);
213 + if (ec)
214 + {
215 +- m_timer.get_io_service().post(std::bind(&http_connection::callback
216 ++ lt::get_io_service(m_timer).post(std::bind(&http_connection::callback
217 + , me, ec, span<char>{}));
218 + return;
219 + }
220 +diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp
221 +index a840bcf991..f2b2b9e2a1 100644
222 +--- a/src/kademlia/dht_tracker.cpp
223 ++++ b/src/kademlia/dht_tracker.cpp
224 +@@ -130,7 +130,7 @@ namespace libtorrent { namespace dht {
225 + // must use piecewise construction because tracker_node::connection_timer
226 + // is neither copyable nor movable
227 + auto n = m_nodes.emplace(std::piecewise_construct_t(), std::forward_as_tuple(s)
228 +- , std::forward_as_tuple(m_key_refresh_timer.get_io_service()
229 ++ , std::forward_as_tuple(get_io_service(m_key_refresh_timer)
230 + , s, this, m_settings, nid, m_log, m_counters
231 + , std::bind(&dht_tracker::get_node, this, _1, _2)
232 + , m_storage));
233 +diff --git a/src/lsd.cpp b/src/lsd.cpp
234 +index 99e21ead44..562f374c62 100644
235 +--- a/src/lsd.cpp
236 ++++ b/src/lsd.cpp
237 +@@ -100,11 +100,11 @@ void lsd::debug_log(char const* fmt, ...) const
238 + void lsd::start(error_code& ec)
239 + {
240 + m_socket.open(std::bind(&lsd::on_announce, self(), _1, _2)
241 +- , m_broadcast_timer.get_io_service(), ec);
242 ++ , lt::get_io_service(m_broadcast_timer), ec);
243 + if (ec) return;
244 +
245 + m_socket6.open(std::bind(&lsd::on_announce, self(), _1, _2)
246 +- , m_broadcast_timer.get_io_service(), ec);
247 ++ , lt::get_io_service(m_broadcast_timer), ec);
248 + }
249 +
250 + lsd::~lsd() = default;
251 +diff --git a/src/natpmp.cpp b/src/natpmp.cpp
252 +index 1226bcebac..5876683ea9 100644
253 +--- a/src/natpmp.cpp
254 ++++ b/src/natpmp.cpp
255 +@@ -160,13 +160,13 @@ void natpmp::start(address local_address, std::string device)
256 + // try to find one even if the listen socket isn't bound to a device
257 + if (device.empty())
258 + {
259 +- device = device_for_address(local_address, m_socket.get_io_service(), ec);
260 ++ device = device_for_address(local_address, get_io_service(m_socket), ec);
261 + // if this fails fall back to using the first default gateway in the
262 + // routing table
263 + ec.clear();
264 + }
265 +
266 +- auto const route = get_default_route(m_socket.get_io_service()
267 ++ auto const route = get_default_route(get_io_service(m_socket)
268 + , device, local_address.is_v6(), ec);
269 +
270 + if (!route)
271 +@@ -194,7 +194,7 @@ void natpmp::start(address local_address, std::string device)
272 + if (local_address.is_unspecified())
273 + {
274 + std::vector<ip_interface> const net = enum_net_interfaces(
275 +- m_socket.get_io_service(), ec);
276 ++ get_io_service(m_socket), ec);
277 +
278 + auto const it = std::find_if(net.begin(), net.end(), [&](ip_interface const& i)
279 + {
280 +diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp
281 +index 9ca38e5486..2459e4f1ca 100644
282 +--- a/src/udp_socket.cpp
283 ++++ b/src/udp_socket.cpp
284 +@@ -492,7 +492,7 @@ void udp_socket::set_proxy_settings(aux::proxy_settings const& ps)
285 + {
286 + // connect to socks5 server and open up the UDP tunnel
287 +
288 +- m_socks5_connection = std::make_shared<socks5>(m_socket.get_io_service());
289 ++ m_socks5_connection = std::make_shared<socks5>(lt::get_io_service(m_socket));
290 + m_socks5_connection->start(ps);
291 + }
292 + }
293 +diff --git a/src/upnp.cpp b/src/upnp.cpp
294 +index a300571e47..b1e8a5bb19 100644
295 +--- a/src/upnp.cpp
296 ++++ b/src/upnp.cpp
297 +@@ -121,7 +121,7 @@ void upnp::start()
298 +
299 + error_code ec;
300 + m_socket.open(std::bind(&upnp::on_reply, self(), _1, _2)
301 +- , m_refresh_timer.get_io_service(), ec);
302 ++ , lt::get_io_service(m_refresh_timer), ec);
303 +
304 + m_mappings.reserve(10);
305 + }
306 +diff --git a/test/test_fast_extension.cpp b/test/test_fast_extension.cpp
307 +index 91256fa0c9..cddc508825 100644
308 +--- a/test/test_fast_extension.cpp
309 ++++ b/test/test_fast_extension.cpp
310 +@@ -462,7 +462,7 @@ std::shared_ptr<torrent_info> setup_peer(tcp::socket& s, sha1_hash& ih
311 + }
312 + else
313 + {
314 +- tcp::acceptor l(s.get_io_service());
315 ++ tcp::acceptor l(lt::get_io_service(s));
316 + l.open(tcp::v4());
317 + l.bind(tcp::endpoint(address_v4::from_string("127.0.0.1"), 0));
318 + l.listen();
319
320 diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.2.0.ebuild b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.2.0.ebuild
321 index ff391a34b94..a182fa18ab3 100644
322 --- a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.2.0.ebuild
323 +++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-1.2.0.ebuild
324 @@ -43,6 +43,8 @@ DEPEND="${RDEPEND}
325
326 S="${WORKDIR}/${PN/-rasterbar}-${MY_P}"
327
328 +PATCHES=( "${FILESDIR}"/fix-boost-1.70.patch )
329 +
330 src_prepare() {
331 mkdir "${S}"/build-aux/ || die
332 touch "${S}"/build-aux/config.rpath || die