1 |
commit: 2f934bb189f6267f1815f853403c84de934e3235 |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 23 12:24:26 2017 +0000 |
4 |
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 23 12:28:12 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f934bb1 |
7 |
|
8 |
dev-ros/image_publisher: Backport upstream patches to build with gcc6. |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
dev-ros/image_publisher/files/gcc6-1.patch | 44 ++++++++++++++++++++++ |
13 |
dev-ros/image_publisher/files/gcc6.patch | 32 ++++++++++++++++ |
14 |
.../image_publisher/image_publisher-1.12.19.ebuild | 3 +- |
15 |
3 files changed, 78 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/dev-ros/image_publisher/files/gcc6-1.patch b/dev-ros/image_publisher/files/gcc6-1.patch |
18 |
new file mode 100644 |
19 |
index 00000000..74e238b |
20 |
--- /dev/null |
21 |
+++ b/dev-ros/image_publisher/files/gcc6-1.patch |
22 |
@@ -0,0 +1,44 @@ |
23 |
+commit 562332df73781c1e56ce9123542334cc1d91b143 |
24 |
+Author: Lukas Bulwahn <lukas.bulwahn@×××××××××××××.de> |
25 |
+Date: Thu Oct 6 08:55:27 2016 +0200 |
26 |
+ |
27 |
+ explicitly cast to std::vector<double> to make gcc6 happy |
28 |
+ |
29 |
+ With gcc6, compiling image_publisher fails with this error: |
30 |
+ ``` |
31 |
+ /[...]/image_publisher/src/nodelet/image_publisher_nodelet.cpp: In member function 'virtual void image_publisher::ImagePublisherNodelet::onInit()': |
32 |
+ /[...]/image_publisher/src/nodelet/image_publisher_nodelet.cpp:180:43: error: ambiguous overload for 'operator=' (operand types are 'sensor_msgs::CameraInfo_<std::allocator<void> >::_D_type {aka std::vector<double>}' and 'boost::assign_detail::generic_list<int>') |
33 |
+ camera_info_.D = list_of(0)(0)(0)(0)(0); |
34 |
+ ``` |
35 |
+ |
36 |
+ After adding an initial explicit type cast for the assignment, |
37 |
+ compiling fails further with: |
38 |
+ ``` |
39 |
+ | /[...]/image_publisher/src/nodelet/image_publisher_nodelet.cpp: In member function 'virtual void image_publisher::ImagePublisherNodelet::onInit()': |
40 |
+ | /[...]/image_publisher/src/nodelet/image_publisher_nodelet.cpp:180:65: error: call of overloaded 'vector(boost::assign_detail::generic_list<int>&)' is ambiguous |
41 |
+ | camera_info_.D = std::vector<double> (list_of(0)(0)(0)(0)(0)); |
42 |
+ ``` |
43 |
+ |
44 |
+ Various sources on the internet [1, 2, 3] point to use the |
45 |
+ `convert_to_container` method; hence, this commit follows those |
46 |
+ suggestions and with that image_publisher compiles with gcc6. |
47 |
+ |
48 |
+ [1] http://stackoverflow.com/questions/16211410/ambiguity-when-using-boostassignlist-of-to-construct-a-stdvector |
49 |
+ [2] http://stackoverflow.com/questions/12352692/ambiguous-call-with-list-of-in-vs2010/12362548#12362548 |
50 |
+ [3] http://stackoverflow.com/questions/13285272/using-boostassignlist-of?rq=1 |
51 |
+ |
52 |
+ Signed-off-by: Lukas Bulwahn <lukas.bulwahn@×××××××××××××.de> |
53 |
+ |
54 |
+diff --git a/image_publisher/src/nodelet/image_publisher_nodelet.cpp b/image_publisher/src/nodelet/image_publisher_nodelet.cpp |
55 |
+index 4102d0d..26e1352 100644 |
56 |
+--- a/image_publisher/src/nodelet/image_publisher_nodelet.cpp |
57 |
++++ b/image_publisher/src/nodelet/image_publisher_nodelet.cpp |
58 |
+@@ -177,7 +177,7 @@ public: |
59 |
+ camera_info_.width = image_.cols; |
60 |
+ camera_info_.height = image_.rows; |
61 |
+ camera_info_.distortion_model = "plumb_bob"; |
62 |
+- camera_info_.D = list_of(0)(0)(0)(0)(0); |
63 |
++ camera_info_.D = list_of(0)(0)(0)(0)(0).convert_to_container<std::vector<double> >(); |
64 |
+ camera_info_.K = list_of(1)(0)(camera_info_.width/2)(0)(1)(camera_info_.height/2)(0)(0)(1); |
65 |
+ camera_info_.R = list_of(1)(0)(0)(0)(1)(0)(0)(0)(1); |
66 |
+ camera_info_.P = list_of(1)(0)(camera_info_.width/2)(0)(0)(1)(camera_info_.height/2)(0)(0)(0)(1)(0); |
67 |
|
68 |
diff --git a/dev-ros/image_publisher/files/gcc6.patch b/dev-ros/image_publisher/files/gcc6.patch |
69 |
new file mode 100644 |
70 |
index 00000000..4815e9e |
71 |
--- /dev/null |
72 |
+++ b/dev-ros/image_publisher/files/gcc6.patch |
73 |
@@ -0,0 +1,32 @@ |
74 |
+commit 6c2d65452bd5fe62723988a1a570789921900d59 |
75 |
+Author: Lukas Bulwahn <lukas.bulwahn@×××××××××××××.de> |
76 |
+Date: Fri Sep 30 15:39:47 2016 +0200 |
77 |
+ |
78 |
+ address gcc6 build error |
79 |
+ |
80 |
+ With gcc6, compiling fails with `stdlib.h: No such file or directory`, |
81 |
+ as including '-isystem /usr/include' breaks with gcc6, cf., |
82 |
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129. |
83 |
+ |
84 |
+ This commit addresses this issue for this package in the same way |
85 |
+ it was addressed in various other ROS packages. A list of related |
86 |
+ commits and pull requests is at: |
87 |
+ |
88 |
+ https://github.com/ros/rosdistro/issues/12783 |
89 |
+ |
90 |
+ Signed-off-by: Lukas Bulwahn <lukas.bulwahn@×××××××××××××.de> |
91 |
+ |
92 |
+diff --git a/image_publisher/CMakeLists.txt b/image_publisher/CMakeLists.txt |
93 |
+index 8015a45..431109c 100644 |
94 |
+--- a/image_publisher/CMakeLists.txt |
95 |
++++ b/image_publisher/CMakeLists.txt |
96 |
+@@ -8,8 +8,7 @@ generate_dynamic_reconfigure_options(cfg/ImagePublisher.cfg) |
97 |
+ |
98 |
+ catkin_package() |
99 |
+ |
100 |
+-# add the executable |
101 |
+-include_directories(SYSTEM ${catkin_INCLUDE_DIRS}) |
102 |
++include_directories(${catkin_INCLUDE_DIRS}) |
103 |
+ |
104 |
+ add_library(${PROJECT_NAME} SHARED src/nodelet/image_publisher_nodelet.cpp) |
105 |
+ target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES}) |
106 |
|
107 |
diff --git a/dev-ros/image_publisher/image_publisher-1.12.19.ebuild b/dev-ros/image_publisher/image_publisher-1.12.19.ebuild |
108 |
index c7d3a65..782fa09 100644 |
109 |
--- a/dev-ros/image_publisher/image_publisher-1.12.19.ebuild |
110 |
+++ b/dev-ros/image_publisher/image_publisher-1.12.19.ebuild |
111 |
@@ -1,4 +1,4 @@ |
112 |
-# Copyright 1999-2016 Gentoo Foundation |
113 |
+# Copyright 1999-2017 Gentoo Foundation |
114 |
# Distributed under the terms of the GNU General Public License v2 |
115 |
# $Id$ |
116 |
|
117 |
@@ -25,3 +25,4 @@ RDEPEND=" |
118 |
dev-ros/sensor_msgs[${CATKIN_MESSAGES_CXX_USEDEP}] |
119 |
" |
120 |
DEPEND="${RDEPEND}" |
121 |
+PATCHES=( "${FILESDIR}/gcc6.patch" "${FILESDIR}/gcc6-1.patch" ) |