commit:     0f12049c25dcf32f404ff8e65b34c10b0552d02f
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  6 12:28:25 2020 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Thu Aug  6 12:28:34 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f12049c

dev-ros/laser_cb_detector: fix tests with ocv4

Closes: https://bugs.gentoo.org/735584
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/laser_cb_detector/files/ocv4-2.patch       | 34 ++++++++++++++++++++++
 .../laser_cb_detector-0.10.14.ebuild               |  2 +-
 .../laser_cb_detector-9999.ebuild                  |  2 +-
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/dev-ros/laser_cb_detector/files/ocv4-2.patch 
b/dev-ros/laser_cb_detector/files/ocv4-2.patch
new file mode 100644
index 00000000000..3cc51c45d7d
--- /dev/null
+++ b/dev-ros/laser_cb_detector/files/ocv4-2.patch
@@ -0,0 +1,34 @@
+Index: laser_cb_detector/test/laser_cb_detector_unittest.cpp
+===================================================================
+--- laser_cb_detector.orig/test/laser_cb_detector_unittest.cpp
++++ laser_cb_detector/test/laser_cb_detector_unittest.cpp
+@@ -37,7 +37,7 @@
+ 
+ #include <laser_cb_detector/ConfigGoal.h>
+ #include <laser_cb_detector/laser_cb_detector.h>
+-#include <opencv/highgui.h>
++#include <opencv2/highgui.hpp>
+ 
+ using namespace laser_cb_detector;
+ using namespace std;
+@@ -55,8 +55,9 @@ static const string test_path = xstr(TES
+ 
+ calibration_msgs::DenseLaserSnapshot getSnapshot(const string& filename)
+ {
+-  IplImage* image;
+-  image = cvLoadImage(filename.c_str(), 0);         // 0 -> Force image to 
grayscale
++  cv::Mat mat = cv::imread(filename.c_str(), 0);
++  IplImage  image_v = cvIplImage(mat);
++  IplImage* image = &image_v;
+   EXPECT_TRUE(image) << "could not open image file [" << filename << "]" << 
endl;
+ 
+ 
+@@ -92,7 +93,7 @@ calibration_msgs::DenseLaserSnapshot get
+   }
+ 
+   cvReleaseImage(&float_image);
+-  cvReleaseImage(&image);
++  //cvReleaseImage(&image);
+ 
+   return snapshot;
+ }

diff --git a/dev-ros/laser_cb_detector/laser_cb_detector-0.10.14.ebuild 
b/dev-ros/laser_cb_detector/laser_cb_detector-0.10.14.ebuild
index eaa01802cc3..682fde80756 100644
--- a/dev-ros/laser_cb_detector/laser_cb_detector-0.10.14.ebuild
+++ b/dev-ros/laser_cb_detector/laser_cb_detector-0.10.14.ebuild
@@ -32,4 +32,4 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
        )
 "
-PATCHES=( "${FILESDIR}/gcc6.patch" "${FILESDIR}/boost170.patch" 
"${FILESDIR}/ocv4.patch" )
+PATCHES=( "${FILESDIR}/gcc6.patch" "${FILESDIR}/boost170.patch" 
"${FILESDIR}/ocv4.patch" "${FILESDIR}/ocv4-2.patch" )

diff --git a/dev-ros/laser_cb_detector/laser_cb_detector-9999.ebuild 
b/dev-ros/laser_cb_detector/laser_cb_detector-9999.ebuild
index eaa01802cc3..682fde80756 100644
--- a/dev-ros/laser_cb_detector/laser_cb_detector-9999.ebuild
+++ b/dev-ros/laser_cb_detector/laser_cb_detector-9999.ebuild
@@ -32,4 +32,4 @@ DEPEND="${RDEPEND}
                dev-cpp/gtest
        )
 "
-PATCHES=( "${FILESDIR}/gcc6.patch" "${FILESDIR}/boost170.patch" 
"${FILESDIR}/ocv4.patch" )
+PATCHES=( "${FILESDIR}/gcc6.patch" "${FILESDIR}/boost170.patch" 
"${FILESDIR}/ocv4.patch" "${FILESDIR}/ocv4-2.patch" )

Reply via email to