commit:     32036f0b89fcca7c7a70361346d60548e7b3539b
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  3 10:35:05 2021 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue Aug  3 10:50:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32036f0b

dev-ros/pcl_conversions: add upstrem patch for new pcl

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/pcl_conversions/files/pcl.patch            | 68 ++++++++++++++++++++++
 ....7.2.ebuild => pcl_conversions-1.7.2-r1.ebuild} |  3 +-
 2 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/dev-ros/pcl_conversions/files/pcl.patch 
b/dev-ros/pcl_conversions/files/pcl.patch
new file mode 100644
index 00000000000..fc0ef886686
--- /dev/null
+++ b/dev-ros/pcl_conversions/files/pcl.patch
@@ -0,0 +1,68 @@
+From 6900f7cf650e6c0df2aef45e0011833905b0ba9e Mon Sep 17 00:00:00 2001
+From: Markus Vieth <[email protected]>
+Date: Fri, 6 Nov 2020 19:13:16 +0100
+Subject: [PATCH] Change conversions of Vertices for new PCL versions (#313)
+
+In 
https://github.com/PointCloudLibrary/pcl/commit/ad00c7bee2fad0391649479d90eee4461a2e74e7,
 the vertices field of pcl::Vertices changed from std::vector<std::uint32_t> to 
std::vector<pcl::index_t>, where index_t is an index type with configurable 
size (currently by default int). This commit makes conversions from and to 
pcl_msgs::Vertices possible again, moving the vector contents if possible.
+---
+ .../include/pcl_conversions/pcl_conversions.h | 23 +++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/pcl_conversions/include/pcl_conversions/pcl_conversions.h 
b/pcl_conversions/include/pcl_conversions/pcl_conversions.h
+index a5671c25..5ac0a41a 100644
+--- a/include/pcl_conversions/pcl_conversions.h
++++ b/include/pcl_conversions/pcl_conversions.h
+@@ -350,10 +350,25 @@ namespace pcl_conversions {
+ 
+   /** pcl::Vertices <=> pcl_msgs::Vertices **/
+ 
++  namespace internal
++  {
++    template <class T>
++    inline void move(std::vector<T> &a, std::vector<T> &b)
++    {
++      b.swap(a);
++    }
++
++    template <class T1, class T2>
++    inline void move(std::vector<T1> &a, std::vector<T2> &b)
++    {
++      b.assign(a.cbegin(), a.cend());
++    }
++  }
++
+   inline
+   void fromPCL(const pcl::Vertices &pcl_vert, pcl_msgs::Vertices &vert)
+   {
+-    vert.vertices = pcl_vert.vertices;
++    vert.vertices.assign(pcl_vert.vertices.cbegin(), 
pcl_vert.vertices.cend());
+   }
+ 
+   inline
+@@ -370,7 +385,7 @@ namespace pcl_conversions {
+   inline
+   void moveFromPCL(pcl::Vertices &pcl_vert, pcl_msgs::Vertices &vert)
+   {
+-    vert.vertices.swap(pcl_vert.vertices);
++    internal::move(pcl_vert.vertices, vert.vertices);
+   }
+ 
+   inline
+@@ -387,7 +402,7 @@ namespace pcl_conversions {
+   inline
+   void toPCL(const pcl_msgs::Vertices &vert, pcl::Vertices &pcl_vert)
+   {
+-    pcl_vert.vertices = vert.vertices;
++    pcl_vert.vertices.assign(vert.vertices.cbegin(), vert.vertices.cend());
+   }
+ 
+   inline
+@@ -404,7 +419,7 @@ namespace pcl_conversions {
+   inline
+   void moveToPCL(pcl_msgs::Vertices &vert, pcl::Vertices &pcl_vert)
+   {
+-    pcl_vert.vertices.swap(vert.vertices);
++    internal::move(vert.vertices, pcl_vert.vertices);
+   }
+ 
+   inline

diff --git a/dev-ros/pcl_conversions/pcl_conversions-1.7.2.ebuild 
b/dev-ros/pcl_conversions/pcl_conversions-1.7.2-r1.ebuild
similarity index 88%
rename from dev-ros/pcl_conversions/pcl_conversions-1.7.2.ebuild
rename to dev-ros/pcl_conversions/pcl_conversions-1.7.2-r1.ebuild
index 2aa2de1919a..ec80ff5fa28 100644
--- a/dev-ros/pcl_conversions/pcl_conversions-1.7.2.ebuild
+++ b/dev-ros/pcl_conversions/pcl_conversions-1.7.2-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -23,3 +23,4 @@ DEPEND="${RDEPEND}
        dev-ros/sensor_msgs[${CATKIN_MESSAGES_CXX_USEDEP}]
        dev-cpp/eigen:3
        test? ( dev-cpp/gtest )"
+PATCHES=("${FILESDIR}/pcl.patch")

Reply via email to