[arch-commits] Commit in digikam/trunk (PKGBUILD digikam-opencv-3.4.patch)

Antonio Rojas arojas at archlinux.org
Sun Dec 24 22:59:38 UTC 2017


    Date: Sunday, December 24, 2017 @ 22:59:37
  Author: arojas
Revision: 313594

opencv 3.4 rebuild

Added:
  digikam/trunk/digikam-opencv-3.4.patch
Modified:
  digikam/trunk/PKGBUILD

--------------------------+
 PKGBUILD                 |   24 +++---
 digikam-opencv-3.4.patch |  156 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 169 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-12-24 21:09:57 UTC (rev 313593)
+++ PKGBUILD	2017-12-24 22:59:37 UTC (rev 313594)
@@ -1,27 +1,28 @@
 # $Id$
 # Maintainer: Ronald van Haren <ronald at archlinux.org>
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
 # Contributor: Andrea Scarpino <andrea at archlinux.org>
 # Contributor: Tobias Powalowski <tpowa at archlinux.org>
 
 pkgbase=digikam
-pkgname=('digikam' 'kipi-plugins')
+pkgname=(digikam kipi-plugins)
 _pkgver=5.7.0
 pkgver=${_pkgver//-/_} # for beta versions
-pkgrel=4
+pkgrel=5
 pkgdesc="An advanced digital photo management application"
 arch=('x86_64')
 license=('GPL')
 url="http://www.digikam.org/"
-makedepends=('extra-cmake-modules' 'libkipi' 'libksane' 'liblqr' 'opencv' 'boost'
-             'doxygen' 'lensfun' 'eigen' 'kdoctools' 'marble-common' 'kdesignerplugin'
-             'kfilemetadata' 'akonadi-contacts' 'qtav' 'threadweaver' 'kcalcore'
-             'knotifyconfig' 'libmediawiki' 'libkvkontakte')
+makedepends=(extra-cmake-modules libkipi libksane liblqr opencv doxygen lensfun eigen boost kdoctools marble-common
+             kfilemetadata akonadi-contacts qtav threadweaver kcalcore knotifyconfig libmediawiki libkvkontakte)
 source=("http://download.kde.org/stable/${pkgname}/${pkgname}-${_pkgver}.tar.xz"
         digikam-kcalcore-17.12.patch
-        digikam-qt-5.9.3.patch::"https://cgit.kde.org/digikam.git/patch/?id=855ba5b7")
+        digikam-qt-5.9.3.patch::"https://cgit.kde.org/digikam.git/patch/?id=855ba5b7"
+        digikam-opencv-3.4.patch)
 sha256sums=('3605ffb5b6e8fbd6b725e5075f74f505d7edee7531789c2882d11df2d20150f5'
             '61648bdeb88dcb94d2896b9d9211c6a6b50a39a143701e04465aa040a60053c0'
-            '03822e596321028d0971ec82351337dad76abeda93c9cef3b1d2a31807e02661')
+            '03822e596321028d0971ec82351337dad76abeda93c9cef3b1d2a31807e02661'
+            'b822cf879216a479134e48e3cfb597ef5b741698454e0993846ab660896caba7')
 
 prepare() {
   mkdir -p build
@@ -35,6 +36,8 @@
   patch -p1 -i "$srcdir"/digikam-kcalcore-17.12.patch
 # fix thumbnails with Qt 5.9.3
   patch -p1 -i "$srcdir"/digikam-qt-5.9.3.patch
+# fix build with opencv 3.4
+  patch -p1 -i "$srcdir"/digikam-opencv-3.4.patch
 }
 
 build() {
@@ -56,8 +59,7 @@
 
 package_digikam() {
   pkgdesc="Digital photo management application for KDE"
-  depends=('liblqr' 'libkipi' 'lensfun' 'opencv' 'akonadi-contacts'
-	'knotifyconfig' 'libksane' 'kfilemetadata' 'qtav' 'marble-common' 'threadweaver' 'kcalcore')
+  depends=(liblqr libkipi lensfun opencv akonadi-contacts knotifyconfig libksane kfilemetadata qtav marble-common threadweaver kcalcore)
   optdepends=('kipi-plugins: export to various online services'
               'hugin: panorama tool' 'qt5-imageformats: support for additional image formats (WEBP, TIFF)')
 
@@ -74,7 +76,7 @@
 
 package_kipi-plugins() {
   pkgdesc="A collection of plugins extending the KDE graphics and image applications as digiKam"
-  depends=('kio' 'libkipi')
+  depends=(kio libkipi)
   optdepends=('libmediawiki: MediaWiki Export plugin'
               'libkvkontakte: VKontakte.ru Exporter plugin')
 

Added: digikam-opencv-3.4.patch
===================================================================
--- digikam-opencv-3.4.patch	                        (rev 0)
+++ digikam-opencv-3.4.patch	2017-12-24 22:59:37 UTC (rev 313594)
@@ -0,0 +1,156 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f2d9c6212f..6341db8d32 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -245,7 +245,7 @@ endif()
+ if(ENABLE_OPENCV3)
+ 
+     set(OPENCV_MIN_VERSION "3.1.0")
+-    DETECT_OPENCV(${OPENCV_MIN_VERSION} core objdetect imgproc imgcodecs)
++    DETECT_OPENCV(${OPENCV_MIN_VERSION} core objdetect imgproc imgcodecs face)
+ 
+     if(${OpenCV_FOUND})
+         if(${OpenCV_VERSION} VERSION_LESS 3.1.0)
+diff --git a/libs/facesengine/opencv3-face/face.hpp b/libs/facesengine/opencv3-face/face.hpp
+index a99e7b349b..200b5b8b00 100644
+--- a/libs/facesengine/opencv3-face/face.hpp
++++ b/libs/facesengine/opencv3-face/face.hpp
+@@ -47,6 +47,7 @@ the use of this software, even if advised of the possibility of such damage.
+ 
+ */
+ 
++#include "libopencv.h"
+ #include "opencv2/core.hpp"
+ #include "predict_collector.hpp"
+ #include <map>
+@@ -318,8 +319,12 @@ public:
+     The suffix const means that prediction does not affect the internal model state, so the method can
+     be safely called from within different threads.
+      */
++#if OPENCV_TEST_VERSION(3,4,0)
+     CV_WRAP virtual void save(const String& filename) const;
+-
++#else
++    CV_WRAP virtual void write(const String& filename) const;
++#endif
++    
+     /** @brief Loads a FaceRecognizer and its model state.
+ 
+     Loads a persisted model and state from a given XML or YAML file . Every FaceRecognizer has to
+@@ -327,17 +332,29 @@ public:
+     FaceRecognizer::load(FileStorage& fs) in turn gets called by
+     FaceRecognizer::load(const String& filename), to ease saving a model.
+      */
++#if OPENCV_TEST_VERSION(3,4,0)
+     CV_WRAP virtual void load(const String& filename);
+-
++#else
++    CV_WRAP virtual void read(const String& filename);
++#endif
++    
+     /** @overload
+     Saves this model to a given FileStorage.
+     @param fs The FileStorage to store this FaceRecognizer to.
+     */
++#if OPENCV_TEST_VERSION(3,4,0)
+     virtual void save(FileStorage& fs) const = 0;
+-
++#else
++    virtual void write(FileStorage& fs) const = 0;
++#endif
++    
+     /** @overload */
++#if OPENCV_TEST_VERSION(3,4,0)
+     virtual void load(const FileStorage& fs) = 0;
+-
++#else
++    virtual void read(const FileStorage& fs) = 0;
++#endif
++    
+     /** @brief Sets string info for the specified model's label.
+ 
+     The string info is replaced by the provided value if it was set before for the specified label.
+diff --git a/libs/facesengine/opencv3-face/facerec.cpp b/libs/facesengine/opencv3-face/facerec.cpp
+index a58124be1f..21ad5e57e7 100644
+--- a/libs/facesengine/opencv3-face/facerec.cpp
++++ b/libs/facesengine/opencv3-face/facerec.cpp
+@@ -66,21 +66,37 @@ void FaceRecognizer::update(InputArrayOfArrays src, InputArray labels)
+     CV_Error(Error::StsNotImplemented, error_msg);
+ }
+ 
++#if OPENCV_TEST_VERSION(3,4,0)
+ void FaceRecognizer::load(const String &filename)
++#else
++void FaceRecognizer::read(const String &filename)
++#endif
+ {
+     FileStorage fs(filename, FileStorage::READ);
+     if (!fs.isOpened())
+         CV_Error(Error::StsError, "File can't be opened for writing!");
++#if OPENCV_TEST_VERSION(3,4,0)
+     this->load(fs);
++#else
++    this->read(fs);
++#endif
+     fs.release();
+ }
+ 
++#if OPENCV_TEST_VERSION(3,4,0)
+ void FaceRecognizer::save(const String &filename) const
++#else
++void FaceRecognizer::write(const String &filename) const
++#endif
+ {
+     FileStorage fs(filename, FileStorage::WRITE);
+     if (!fs.isOpened())
+         CV_Error(Error::StsError, "File can't be opened for writing!");
++#if OPENCV_TEST_VERSION(3,4,0)
+     this->save(fs);
++#else
++    this->write(fs);
++#endif
+     fs.release();
+ }
+ 
+diff --git a/libs/facesengine/recognition-opencv-lbph/facerec_borrowed.h b/libs/facesengine/recognition-opencv-lbph/facerec_borrowed.h
+index 0ff718fc2f..4561db8af5 100644
+--- a/libs/facesengine/recognition-opencv-lbph/facerec_borrowed.h
++++ b/libs/facesengine/recognition-opencv-lbph/facerec_borrowed.h
+@@ -104,9 +104,12 @@ public:
+ #if OPENCV_TEST_VERSION(3,0,0)
+     using cv::FaceRecognizer::save;
+     using cv::FaceRecognizer::load;
+-#else
++#elif OPENCV_TEST_VERSION(3,4,0)
+     using cv::face::FaceRecognizer::save;
+     using cv::face::FaceRecognizer::load;
++#else
++    using cv::face::FaceRecognizer::write;
++    using cv::face::FaceRecognizer::read;
+ #endif
+ 
+     static cv::Ptr<LBPHFaceRecognizer> create(int radius=1,
+@@ -160,8 +163,10 @@ public:
+      */
+ #if OPENCV_TEST_VERSION(3,1,0)
+     void load(const cv::FileStorage&) {}
+-#else
++#elif OPENCV_TEST_VERSION(3,4,0)
+     void load(const cv::FileStorage&) override {}
++#else
++    void read(const cv::FileStorage&) override {}
+ #endif
+ 
+     /**
+@@ -169,8 +174,10 @@ public:
+      */
+ #if OPENCV_TEST_VERSION(3,1,0)
+     void save(cv::FileStorage&) const {}
+-#else
++#elif OPENCV_TEST_VERSION(3,4,0)
+     void save(cv::FileStorage&) const override {}
++#else
++    void write(cv::FileStorage&) const override {}
+ #endif
+ 
+     /**



More information about the arch-commits mailing list