Accepting request 763631 from KDE:Extra

- 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

OBS-URL: https://build.opensuse.org/request/show/763631
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/digikam?expand=0&rev=186
This commit is contained in:
Dominique Leuenberger 2020-01-12 22:24:08 +00:00 committed by Git OBS Bridge
commit fba7ac4d0c
4 changed files with 65 additions and 1 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Jan 11 22:09:41 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>
- 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 Thu Nov 21 21:38:08 UTC 2019 - wbauer@tmo.at

View File

@ -1,7 +1,7 @@
# #
# spec file for package digikam # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 Patch0: 0001-Disable-detection-of-OpenGL-for-GLES-platforms.patch
# PATCH-FIX-OPENSUSE -- Lower minimum exiv2 version to 0.26 # PATCH-FIX-OPENSUSE -- Lower minimum exiv2 version to 0.26
Patch1: 0001-Revert-Exiv2-is-now-released-with-exported-targets-u.patch 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: QtAV-devel >= 1.12
BuildRequires: bison BuildRequires: bison
BuildRequires: boost-devel 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 # Leap 15 only has exiv2 0.26
%patch1 -p1 %patch1 -p1
%endif %endif
%patch2 -p1
%patch3 -p1
# Remove build time references so build-compare can do its work # 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') FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')

View File

@ -0,0 +1,26 @@
From 34dc7303045877226ebdd6cd07ce6384c0881eb8 Mon Sep 17 00:00:00 2001
From: Davis King <davis@dlib.net>
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<pixel_type>::num: " << pixel_traits<pixel_type>::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);
}

View File

@ -0,0 +1,26 @@
From cff33fbc9c7c69f92be990cef0f19e63ac1f7654 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
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),