From 20876cac2bee175d06017b2ea32ae562d3483faf Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Tue, 10 Dec 2019 17:11:58 +0100 Subject: dev-ros/image_publisher: fix build with opencv 4 Package-Manager: Portage-2.3.81, Repoman-2.3.20 Signed-off-by: Alexis Ballier --- dev-ros/image_publisher/files/ocv4.patch | 44 ++++++++++++++++++++++ .../image_publisher/image_publisher-1.13.0.ebuild | 3 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 dev-ros/image_publisher/files/ocv4.patch (limited to 'dev-ros/image_publisher') diff --git a/dev-ros/image_publisher/files/ocv4.patch b/dev-ros/image_publisher/files/ocv4.patch new file mode 100644 index 000000000000..12baac2d8473 --- /dev/null +++ b/dev-ros/image_publisher/files/ocv4.patch @@ -0,0 +1,44 @@ +Index: image_publisher/CMakeLists.txt +=================================================================== +--- image_publisher.orig/CMakeLists.txt ++++ image_publisher/CMakeLists.txt +@@ -10,7 +10,7 @@ message(STATUS "opencv version ${OpenCV_ + if(OpenCV_VERSION VERSION_LESS "3.0.0") + find_package(OpenCV 2 REQUIRED COMPONENTS ${opencv_2_components}) + else() +- find_package(OpenCV 3 REQUIRED COMPONENTS ${opencv_3_components}) ++ find_package(OpenCV REQUIRED COMPONENTS ${opencv_3_components}) + endif() + + # generate the dynamic_reconfigure config file +Index: image_publisher/src/nodelet/image_publisher_nodelet.cpp +=================================================================== +--- image_publisher.orig/src/nodelet/image_publisher_nodelet.cpp ++++ image_publisher/src/nodelet/image_publisher_nodelet.cpp +@@ -95,7 +95,7 @@ class ImagePublisherNodelet : public nod + { + if ( cap_.isOpened() ) { + if ( ! cap_.read(image_) ) { +- cap_.set(CV_CAP_PROP_POS_FRAMES, 0); ++ cap_.set(cv::CAP_PROP_POS_FRAMES, 0); + } + } + if (flip_image_) +@@ -136,7 +136,7 @@ public: + nh_.param("filename", filename_, std::string("")); + NODELET_INFO("File name for publishing image is : %s", filename_.c_str()); + try { +- image_ = cv::imread(filename_, CV_LOAD_IMAGE_COLOR); ++ image_ = cv::imread(filename_, cv::IMREAD_COLOR); + if ( image_.empty() ) { // if filename is motion file or device file + try { // if filename is number + int num = boost::lexical_cast(filename_);//num is 1234798797 +@@ -146,7 +146,7 @@ public: + } + CV_Assert(cap_.isOpened()); + cap_.read(image_); +- cap_.set(CV_CAP_PROP_POS_FRAMES, 0); ++ cap_.set(cv::CAP_PROP_POS_FRAMES, 0); + } + CV_Assert(!image_.empty()); + } diff --git a/dev-ros/image_publisher/image_publisher-1.13.0.ebuild b/dev-ros/image_publisher/image_publisher-1.13.0.ebuild index 98088db1be94..dd6ff1f0df2e 100644 --- a/dev-ros/image_publisher/image_publisher-1.13.0.ebuild +++ b/dev-ros/image_publisher/image_publisher-1.13.0.ebuild @@ -16,7 +16,7 @@ IUSE="" RDEPEND=" dev-ros/cv_bridge - media-libs/opencv:= + >=media-libs/opencv-4:= dev-ros/dynamic_reconfigure dev-ros/camera_info_manager dev-ros/image_transport @@ -27,3 +27,4 @@ RDEPEND=" dev-libs/boost:= " DEPEND="${RDEPEND}" +PATCHES=( "${FILESDIR}/ocv4.patch" ) -- cgit v1.2.3-65-gdbad