1 |
commit: cb15b7b2638edb3fe4046dd531059730dbbc7dba |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Aug 28 12:17:22 2019 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Aug 28 17:01:40 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb15b7b2 |
7 |
|
8 |
dev-ros/libmavconn: fix build with boost 1.70 |
9 |
|
10 |
Package-Manager: Portage-2.3.73, Repoman-2.3.17 |
11 |
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org> |
12 |
|
13 |
dev-ros/libmavconn/files/boost170.patch | 98 ++++++++++++++++++++++++++ |
14 |
dev-ros/libmavconn/libmavconn-0.19.0-r1.ebuild | 7 +- |
15 |
2 files changed, 103 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/dev-ros/libmavconn/files/boost170.patch b/dev-ros/libmavconn/files/boost170.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..357025d90af |
20 |
--- /dev/null |
21 |
+++ b/dev-ros/libmavconn/files/boost170.patch |
22 |
@@ -0,0 +1,98 @@ |
23 |
+Index: libmavconn/src/tcp.cpp |
24 |
+=================================================================== |
25 |
+--- libmavconn.orig/src/tcp.cpp |
26 |
++++ libmavconn/src/tcp.cpp |
27 |
+@@ -41,13 +41,19 @@ static bool resolve_address_tcp(io_servi |
28 |
+ error_code ec; |
29 |
+ |
30 |
+ tcp::resolver::query query(host, ""); |
31 |
+- std::for_each(resolver.resolve(query, ec), tcp::resolver::iterator(), |
32 |
+- [&](const tcp::endpoint & q_ep) { |
33 |
+- ep = q_ep; |
34 |
+- ep.port(port); |
35 |
+- result = true; |
36 |
+- CONSOLE_BRIDGE_logDebug(PFXd "host %s resolved as %s", chan, host.c_str(), to_string_ss(ep).c_str()); |
37 |
+- }); |
38 |
++ |
39 |
++ auto fn = [&](const tcp::endpoint & q_ep) { |
40 |
++ ep = q_ep; |
41 |
++ ep.port(port); |
42 |
++ result = true; |
43 |
++ CONSOLE_BRIDGE_logDebug(PFXd "host %s resolved as %s", chan, host.c_str(), to_string_ss(ep).c_str()); |
44 |
++ }; |
45 |
++ |
46 |
++#if BOOST_ASIO_VERSION >= 101200 |
47 |
++ for (auto q_ep : resolver.resolve(query, ec)) fn(q_ep); |
48 |
++#else |
49 |
++ std::for_each(resolver.resolve(query, ec), tcp::resolver::iterator(), fn); |
50 |
++#endif |
51 |
+ |
52 |
+ if (ec) { |
53 |
+ CONSOLE_BRIDGE_logWarn(PFXd "resolve error: %s", chan, ec.message().c_str()); |
54 |
+@@ -112,7 +118,7 @@ void MAVConnTCPClient::client_connected( |
55 |
+ server_channel, conn_id, to_string_ss(server_ep).c_str()); |
56 |
+ |
57 |
+ // start recv |
58 |
+- socket.get_io_service().post(std::bind(&MAVConnTCPClient::do_recv, shared_from_this())); |
59 |
++ static_cast<boost::asio::io_service&>(socket.get_executor().context()).post(std::bind(&MAVConnTCPClient::do_recv, shared_from_this())); |
60 |
+ } |
61 |
+ |
62 |
+ MAVConnTCPClient::~MAVConnTCPClient() |
63 |
+@@ -152,7 +158,7 @@ void MAVConnTCPClient::send_bytes(const |
64 |
+ |
65 |
+ tx_q.emplace_back(bytes, length); |
66 |
+ } |
67 |
+- socket.get_io_service().post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
68 |
++ static_cast<boost::asio::io_service&>(socket.get_executor().context()).post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
69 |
+ } |
70 |
+ |
71 |
+ void MAVConnTCPClient::send_message(const mavlink_message_t *message) |
72 |
+@@ -174,7 +180,7 @@ void MAVConnTCPClient::send_message(cons |
73 |
+ |
74 |
+ tx_q.emplace_back(message); |
75 |
+ } |
76 |
+- socket.get_io_service().post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
77 |
++ static_cast<boost::asio::io_service&>(socket.get_executor().context()).post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
78 |
+ } |
79 |
+ |
80 |
+ void MAVConnTCPClient::send_message(const mavlink::Message &message) |
81 |
+@@ -194,7 +200,7 @@ void MAVConnTCPClient::send_message(cons |
82 |
+ |
83 |
+ tx_q.emplace_back(message, get_status_p(), sys_id, comp_id); |
84 |
+ } |
85 |
+- socket.get_io_service().post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
86 |
++ static_cast<boost::asio::io_service&>(socket.get_executor().context()).post(std::bind(&MAVConnTCPClient::do_send, shared_from_this(), true)); |
87 |
+ } |
88 |
+ |
89 |
+ void MAVConnTCPClient::do_recv() |
90 |
+Index: libmavconn/src/udp.cpp |
91 |
+=================================================================== |
92 |
+--- libmavconn.orig/src/udp.cpp |
93 |
++++ libmavconn/src/udp.cpp |
94 |
+@@ -41,13 +41,19 @@ static bool resolve_address_udp(io_servi |
95 |
+ error_code ec; |
96 |
+ |
97 |
+ udp::resolver::query query(host, ""); |
98 |
+- std::for_each(resolver.resolve(query, ec), udp::resolver::iterator(), |
99 |
+- [&](const udp::endpoint & q_ep) { |
100 |
+- ep = q_ep; |
101 |
+- ep.port(port); |
102 |
+- result = true; |
103 |
+- CONSOLE_BRIDGE_logDebug(PFXd "host %s resolved as %s", chan, host.c_str(), to_string_ss(ep).c_str()); |
104 |
+- }); |
105 |
++ |
106 |
++ auto fn = [&](const udp::endpoint & q_ep) { |
107 |
++ ep = q_ep; |
108 |
++ ep.port(port); |
109 |
++ result = true; |
110 |
++ CONSOLE_BRIDGE_logDebug(PFXd "host %s resolved as %s", chan, host.c_str(), to_string_ss(ep).c_str()); |
111 |
++ }; |
112 |
++ |
113 |
++#if BOOST_ASIO_VERSION >= 101200 |
114 |
++ for (auto q_ep : resolver.resolve(query, ec)) fn(q_ep); |
115 |
++#else |
116 |
++ std::for_each(resolver.resolve(query, ec), udp::resolver::iterator(), fn); |
117 |
++#endif |
118 |
+ |
119 |
+ if (ec) { |
120 |
+ CONSOLE_BRIDGE_logWarn(PFXd "resolve error: %s", chan, ec.message().c_str()); |
121 |
|
122 |
diff --git a/dev-ros/libmavconn/libmavconn-0.19.0-r1.ebuild b/dev-ros/libmavconn/libmavconn-0.19.0-r1.ebuild |
123 |
index dddbbe6be4d..d42a92fd0e6 100644 |
124 |
--- a/dev-ros/libmavconn/libmavconn-0.19.0-r1.ebuild |
125 |
+++ b/dev-ros/libmavconn/libmavconn-0.19.0-r1.ebuild |
126 |
@@ -1,4 +1,4 @@ |
127 |
-# Copyright 1999-2017 Gentoo Foundation |
128 |
+# Copyright 1999-2019 Gentoo Authors |
129 |
# Distributed under the terms of the GNU General Public License v2 |
130 |
|
131 |
EAPI=5 |
132 |
@@ -19,4 +19,7 @@ RDEPEND=" |
133 |
dev-libs/console_bridge:= |
134 |
" |
135 |
DEPEND="${RDEPEND}" |
136 |
-PATCHES=( "${FILESDIR}/logging.patch" ) |
137 |
+PATCHES=( |
138 |
+ "${FILESDIR}/logging.patch" |
139 |
+ "${FILESDIR}/boost170.patch" |
140 |
+) |