commit:     e993387056ee71a1f3017b0116b293874d7ca09c
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Aug 23 18:35:56 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 15:40:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9933870

sci-libs/pcl: Fix compilation on GCC 15

Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/pcl/files/pcl-1.14.1-gcc15.patch | 62 +++++++++++++++++++++++++++++++
 sci-libs/pcl/pcl-1.14.1.ebuild            |  1 +
 sci-libs/pcl/pcl-9999.ebuild              |  1 +
 3 files changed, 64 insertions(+)

diff --git a/sci-libs/pcl/files/pcl-1.14.1-gcc15.patch 
b/sci-libs/pcl/files/pcl-1.14.1-gcc15.patch
new file mode 100644
index 000000000000..41001211bad1
--- /dev/null
+++ b/sci-libs/pcl/files/pcl-1.14.1-gcc15.patch
@@ -0,0 +1,62 @@
+From: Paul Zander <[email protected]>
+Date: Thu, 22 Aug 2024 16:44:39 +0200
+Subject: [PATCH] fix gcc 15
+
+Signed-off-by: Paul Zander <[email protected]>
+--- a/registration/include/pcl/registration/correspondence_rejection_features.h
++++ b/registration/include/pcl/registration/correspondence_rejection_features.h
+@@ -203,6 +203,11 @@ protected:
+     /** \brief Empty destructor */
+     ~FeatureContainer() override = default;
+ 
++    inline std::string getClassName()
++    {
++      return "FeatureContainer<FeatureT>";
++    }
++
+     inline void
+     setSourceFeature(const FeatureCloudConstPtr& source_features)
+     {
+--- a/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.h
++++ b/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.h
+@@ -94,6 +94,9 @@ namespace pcl
+         short d , off[DIMENSION];
+         NodeData nodeData;
+ 
++        Point3D<Real> center;
++        int offset[3];
++
+         OctNode(void);
+         ~OctNode(void);
+         int initChildren(void);
+--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.h
++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.h
+@@ -56,6 +56,8 @@ namespace pcl
+         bool _contiguous;
+         int _maxEntriesPerRow;
+         static int UseAlloc;
++        std::size_t m_M;
++        std::size_t m_N;
+       public:
+         static Allocator<MatrixEntry<T> > internalAllocator;
+         static int UseAllocator(void);
+--- a/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
++++ b/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp
+@@ -235,7 +235,7 @@ namespace pcl
+     void SparseMatrix<T>::SetIdentity()
+     {
+       SetZero();
+-      for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++)
++      for(int ij=0; ij < std::min( this->rows, this->_maxEntriesPerRow ); 
ij++)
+         (*this)(ij,ij) = T(1);
+     }
+ 
+@@ -388,7 +388,7 @@ namespace pcl
+       T alpha,beta,rDotR;
+       int i;
+ 
+-      solution.Resize(M.Columns());
++      solution.Resize(M._maxEntriesPerRow);
+       solution.SetZero();
+ 
+       d=r=bb;

diff --git a/sci-libs/pcl/pcl-1.14.1.ebuild b/sci-libs/pcl/pcl-1.14.1.ebuild
index 46645bec9842..a9c716c2e295 100644
--- a/sci-libs/pcl/pcl-1.14.1.ebuild
+++ b/sci-libs/pcl/pcl-1.14.1.ebuild
@@ -73,6 +73,7 @@ REQUIRED_USE="
 PATCHES=(
        "${FILESDIR}"/${PN}-1.12.1-allow-configuration-of-install-dirs.patch
        
"${FILESDIR}"/${PN}-1.12.1-fix-hardcoded-relative-directory-of-the-installed-cmake-files.patch
+       "${FILESDIR}/${PN}-1.14.1-gcc15.patch"
 )
 
 src_prepare() {

diff --git a/sci-libs/pcl/pcl-9999.ebuild b/sci-libs/pcl/pcl-9999.ebuild
index 46645bec9842..a9c716c2e295 100644
--- a/sci-libs/pcl/pcl-9999.ebuild
+++ b/sci-libs/pcl/pcl-9999.ebuild
@@ -73,6 +73,7 @@ REQUIRED_USE="
 PATCHES=(
        "${FILESDIR}"/${PN}-1.12.1-allow-configuration-of-install-dirs.patch
        
"${FILESDIR}"/${PN}-1.12.1-fix-hardcoded-relative-directory-of-the-installed-cmake-files.patch
+       "${FILESDIR}/${PN}-1.14.1-gcc15.patch"
 )
 
 src_prepare() {

Reply via email to