From 1ad56ebc63337cca7f4802f45275da9fe627cde0632d2956b8058f08349c0d84 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Sun, 12 Jan 2020 22:24:08 +0000 Subject: [PATCH] Updating link to change in openSUSE:Factory/digikam revision 186.0 OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/digikam?expand=0&rev=4aff46865ff5d19e859fdf1abb144963 --- digikam.changes | 7 +++++ digikam.spec | 7 ++++- ...o-work-with-latest-version-of-OpenCV.patch | 26 +++++++++++++++++++ fix-build-with-opencv-4.2.patch | 26 +++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 dlib-update-to-work-with-latest-version-of-OpenCV.patch create mode 100644 fix-build-with-opencv-4.2.patch diff --git a/digikam.changes b/digikam.changes index 7df4c10..1d07e2f 100644 --- a/digikam.changes +++ b/digikam.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Jan 11 22:09:41 UTC 2020 - Fabian Vogt + +- Add patches to fix build with OpenCV >= 4.2 (boo#1160721): + * fix-build-with-opencv-4.2.patch + * dlib-update-to-work-with-latest-version-of-OpenCV.patch + ------------------------------------------------------------------- Thu Nov 21 21:38:08 UTC 2019 - wbauer@tmo.at diff --git a/digikam.spec b/digikam.spec index ab2091b..9c43ff2 100644 --- a/digikam.spec +++ b/digikam.spec @@ -1,7 +1,7 @@ # # spec file for package digikam # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -30,6 +30,9 @@ Source0: https://download.kde.org/stable/%{name}/%{version}/%{name}-%{ver Patch0: 0001-Disable-detection-of-OpenGL-for-GLES-platforms.patch # PATCH-FIX-OPENSUSE -- Lower minimum exiv2 version to 0.26 Patch1: 0001-Revert-Exiv2-is-now-released-with-exported-targets-u.patch +# PATCH-FIX-UPSTREAM +Patch2: fix-build-with-opencv-4.2.patch +Patch3: dlib-update-to-work-with-latest-version-of-OpenCV.patch BuildRequires: QtAV-devel >= 1.12 BuildRequires: bison BuildRequires: boost-devel @@ -179,6 +182,8 @@ The main digikam libraries that are being shared between showfoto and digikam # Leap 15 only has exiv2 0.26 %patch1 -p1 %endif +%patch2 -p1 +%patch3 -p1 # Remove build time references so build-compare can do its work FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y') diff --git a/dlib-update-to-work-with-latest-version-of-OpenCV.patch b/dlib-update-to-work-with-latest-version-of-OpenCV.patch new file mode 100644 index 0000000..c236758 --- /dev/null +++ b/dlib-update-to-work-with-latest-version-of-OpenCV.patch @@ -0,0 +1,26 @@ +From 34dc7303045877226ebdd6cd07ce6384c0881eb8 Mon Sep 17 00:00:00 2001 +From: Davis King +Date: Sun, 22 Dec 2019 07:52:08 -0500 +Subject: [PATCH] Fix opencv version check to work on all opencv versions + +Index: digikam-6.4.0/core/libs/facesengine/recognition/dlib-dnn/dnnface/dnn_base/cv_image.h +=================================================================== +--- digikam-6.4.0.orig/core/libs/facesengine/recognition/dlib-dnn/dnnface/dnn_base/cv_image.h ++++ digikam-6.4.0/core/libs/facesengine/recognition/dlib-dnn/dnnface/dnn_base/cv_image.h +@@ -52,7 +52,16 @@ public: + << "\n\t img.channels(): " << img.channels() + << "\n\t img.pixel_traits::num: " << pixel_traits::num + ); ++// Note, do NOT use CV_VERSION_MAJOR because in OpenCV 2 CV_VERSION_MAJOR actually held ++// CV_VERSION_MINOR and instead they used CV_VERSION_EPOCH. So for example, in OpenCV ++// 2.4.9.1 CV_VERSION_MAJOR==4 and CV_VERSION_EPOCH==2. However, CV_MAJOR_VERSION has always ++// (seemingly) held the actual major version number, so we use that to test for the OpenCV major ++// version. ++#if CV_MAJOR_VERSION > 3 ++ IplImage temp = cvIplImage(img); ++#else + IplImage temp = img; ++#endif + init(&temp); + } + diff --git a/fix-build-with-opencv-4.2.patch b/fix-build-with-opencv-4.2.patch new file mode 100644 index 0000000..039ffe2 --- /dev/null +++ b/fix-build-with-opencv-4.2.patch @@ -0,0 +1,26 @@ +From cff33fbc9c7c69f92be990cef0f19e63ac1f7654 Mon Sep 17 00:00:00 2001 +From: Antonio Rojas +Date: Sat, 21 Dec 2019 14:46:46 +0100 +Subject: [PATCH] Fix build with opencv 4.2 + +Port away from old API which is removed in 4.2 + +Differential Revision: https://phabricator.kde.org/D26143 +--- + .../facesengine/detection/opencv-face/opencvfacedetector_p.cpp | 2 +- + .../facesengine/detection/opencv-face/opencvfacedetector_p.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: digikam-6.4.0/core/libs/facesengine/detection/opencvfacedetector.cpp +=================================================================== +--- digikam-6.4.0.orig/core/libs/facesengine/detection/opencvfacedetector.cpp ++++ digikam-6.4.0/core/libs/facesengine/detection/opencvfacedetector.cpp +@@ -166,7 +166,7 @@ public: + * of the region of interest of this cascade (still relative to whole image). + * For frontal face cascades, returns the given parameter unchanged. + */ +- cv::Rect faceROI(const CvRect& faceRect) const ++ cv::Rect faceROI(const cv::Rect& faceRect) const + { + return cv::Rect(lround(faceRect.x + roi.x() * faceRect.width), + lround(faceRect.y + roi.y() * faceRect.height),