commit:     12401247632313d3494f864cf75d38916ed2aad4
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  6 21:46:09 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 22:08:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12401247

media-gfx/digikam: Fix cleanup_digikamdb, DB w/ >=mariadb-10.2

Closes: https://bugs.gentoo.org/639032
Package-Manager: Portage-2.3.16, Repoman-2.3.6

 media-gfx/digikam/digikam-5.7.0-r2.ebuild          | 174 +++++++++++++++++++++
 .../digikam/files/digikam-5.7.0-kreadconfig5.patch |  28 ++++
 .../files/digikam-5.7.0-mariadb-10.2-1.patch       |  58 +++++++
 .../files/digikam-5.7.0-mariadb-10.2-2.patch       | 117 ++++++++++++++
 4 files changed, 377 insertions(+)

diff --git a/media-gfx/digikam/digikam-5.7.0-r2.ebuild 
b/media-gfx/digikam/digikam-5.7.0-r2.ebuild
new file mode 100644
index 00000000000..0b1c44fc5b4
--- /dev/null
+++ b/media-gfx/digikam/digikam-5.7.0-r2.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${KDE_BUILD_TYPE} != live ]]; then
+       KDE_HANDBOOK="true"
+       KDE_TEST="true"
+fi
+CMAKE_MAKEFILE_GENERATOR="emake"
+inherit kde5 toolchain-funcs
+
+DESCRIPTION="Digital photo management application"
+HOMEPAGE="https://www.digikam.org/";
+
+LICENSE="GPL-2"
+IUSE="addressbook calendar gphoto2 jpeg2k +kipi +lensfun marble mediaplayer 
semantic-desktop mysql opengl openmp +panorama scanner X"
+
+if [[ ${KDE_BUILD_TYPE} != live ]]; then
+       KEYWORDS="~amd64 ~x86"
+       MY_PV=${PV/_/-}
+       MY_P=${PN}-${MY_PV}
+       SRC_BRANCH=stable
+       [[ ${PV} =~ beta[0-9]$ ]] && SRC_BRANCH=unstable
+       SRC_URI="mirror://kde/${SRC_BRANCH}/digikam/${MY_P}.tar.xz"
+       S="${WORKDIR}/${MY_P}/core"
+fi
+
+# TODO: Package QtAV http://www.qtav.org/
+# video? ( media-video/qtav )
+COMMON_DEPEND="
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kconfigwidgets)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep knotifications)
+       $(add_frameworks_dep knotifyconfig)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep kwidgetsaddons)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_frameworks_dep kxmlgui)
+       $(add_frameworks_dep solid)
+       $(add_qt_dep qtconcurrent)
+       $(add_qt_dep qtdbus)
+       $(add_qt_dep qtgui '-gles2')
+       $(add_qt_dep qtprintsupport)
+       $(add_qt_dep qtsql 'mysql?')
+       $(add_qt_dep qtwebkit)
+       $(add_qt_dep qtwidgets)
+       $(add_qt_dep qtxml)
+       dev-libs/expat
+       >=media-gfx/exiv2-0.26:=
+       media-libs/lcms:2
+       media-libs/liblqr
+       media-libs/libpng:0=
+       media-libs/opencv:=[-qt4(-)]
+       || ( <media-libs/opencv-3.0.0 >=media-libs/opencv-3.1.0 )
+       media-libs/tiff:0
+       virtual/jpeg:0
+       addressbook? (
+               $(add_kdeapps_dep akonadi-contacts)
+               $(add_kdeapps_dep kcontacts)
+       )
+       calendar? ( $(add_kdeapps_dep kcalcore) )
+       gphoto2? ( media-libs/libgphoto2:= )
+       jpeg2k? ( media-libs/jasper:= )
+       kipi? ( $(add_kdeapps_dep libkipi '' '16.03.80') )
+       lensfun? ( media-libs/lensfun )
+       marble? (
+               $(add_frameworks_dep kbookmarks)
+               $(add_kdeapps_dep marble)
+               $(add_qt_dep qtconcurrent)
+               $(add_qt_dep qtnetwork)
+       )
+       mediaplayer? ( media-libs/qtav[opengl] )
+       mysql? ( virtual/mysql[server] )
+       opengl? (
+               $(add_qt_dep qtopengl)
+               virtual/opengl
+       )
+       panorama? ( $(add_frameworks_dep threadweaver) )
+       scanner? ( $(add_kdeapps_dep libksane) )
+       semantic-desktop? ( $(add_frameworks_dep kfilemetadata) )
+       X? (
+               $(add_qt_dep qtx11extras)
+               x11-libs/libX11
+       )
+"
+DEPEND="${COMMON_DEPEND}
+       dev-cpp/eigen:3
+       dev-libs/boost[threads]
+       sys-devel/gettext
+       panorama? (
+               sys-devel/bison
+               sys-devel/flex
+       )
+"
+RDEPEND="${COMMON_DEPEND}
+       media-plugins/kipi-plugins:5
+       panorama? ( media-gfx/hugin )
+       !media-gfx/digikam:4
+"
+
+RESTRICT=test
+# bug 366505
+
+PATCHES=(
+       "${FILESDIR}"/${P}-qt-5.9.3.patch
+       "${FILESDIR}"/${P}-mariadb-10.2-{1,2}.patch
+       "${FILESDIR}"/${P}-kreadconfig5.patch
+)
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+       kde5_pkg_pretend
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+       kde5_pkg_setup
+}
+
+# FIXME: Unbundle libraw (libs/rawengine/libraw)
+src_prepare() {
+       if [[ ${KDE_BUILD_TYPE} != live ]]; then
+               # prepare the translations
+               mv "${WORKDIR}/${MY_P}/po" po || die
+               find po -name "*.po" -and -not -name "digikam.po" -delete || die
+               echo "set_property(GLOBAL PROPERTY 
ALLOW_DUPLICATE_CUSTOM_TARGETS 1)" >> CMakeLists.txt || die
+               echo "find_package(Gettext REQUIRED)" >> CMakeLists.txt || die
+               echo "add_subdirectory( po )" >> CMakeLists.txt || die
+
+               if use handbook; then
+                       # subdirs need to be preserved b/c relative paths...
+                       # doc-translated is, in fact, broken, and ignored
+                       mv "${WORKDIR}/${MY_P}/doc/${PN}" doc-default || die
+                       echo "find_package(KF5DocTools REQUIRED)" >> 
CMakeLists.txt || die
+                       echo "add_subdirectory( doc-default )" >> 
CMakeLists.txt || die
+               fi
+       fi
+
+       if ! use marble; then
+               punt_bogus_dep Qt5 Network
+       fi
+
+       kde5_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DENABLE_APPSTYLES=ON
+               -DENABLE_AKONADICONTACTSUPPORT=$(usex addressbook)
+               -DENABLE_MEDIAPLAYER=$(usex mediaplayer)
+               -DENABLE_MYSQLSUPPORT=$(usex mysql)
+               -DENABLE_OPENCV3=$(has_version ">=media-libs/opencv-3" && echo 
yes || echo no)
+               $(cmake-utils_use_find_package calendar KF5CalendarCore)
+               $(cmake-utils_use_find_package gphoto2 Gphoto2)
+               $(cmake-utils_use_find_package jpeg2k Jasper)
+               $(cmake-utils_use_find_package kipi KF5Kipi)
+               $(cmake-utils_use_find_package lensfun LensFun)
+               $(cmake-utils_use_find_package marble Marble)
+               $(cmake-utils_use_find_package mediaplayer QtAV)
+               $(cmake-utils_use_find_package opengl OpenGL)
+               $(cmake-utils_use_find_package openmp OpenMP)
+               $(cmake-utils_use_find_package panorama KF5ThreadWeaver)
+               $(cmake-utils_use_find_package scanner KF5Sane)
+               $(cmake-utils_use_find_package semantic-desktop KF5FileMetaData)
+               $(cmake-utils_use_find_package X X11)
+       )
+
+       kde5_src_configure
+}

diff --git a/media-gfx/digikam/files/digikam-5.7.0-kreadconfig5.patch 
b/media-gfx/digikam/files/digikam-5.7.0-kreadconfig5.patch
new file mode 100644
index 00000000000..7305f64aa3f
--- /dev/null
+++ b/media-gfx/digikam/files/digikam-5.7.0-kreadconfig5.patch
@@ -0,0 +1,28 @@
+From bbf087645d426e20ce96fa2accd70ff4198d30ec Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <andreas.sturmlech...@gmail.com>
+Date: Wed, 6 Dec 2017 22:31:29 +0100
+Subject: [PATCH] cleanup_digikamdb: Don't depend on kde-runtime
+
+Summary: This needs to use kreadconfig5 in a Frameworks world.
+
+Differential Revision: https://phabricator.kde.org/D9235
+---
+ data/scripts/cleanup_digikamdb/cleanup_digikamdb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/data/scripts/cleanup_digikamdb/cleanup_digikamdb 
b/data/scripts/cleanup_digikamdb/cleanup_digikamdb
+index 3a68d3d040..9cfcd6ac8d 100644
+--- a/data/scripts/cleanup_digikamdb/cleanup_digikamdb
++++ b/data/scripts/cleanup_digikamdb/cleanup_digikamdb
+@@ -58,7 +58,7 @@ readConfigValue()
+ {
+     local config_file="digikamrc"
+     local config_group="Database Settings"
+-    local db_dir=$(kreadconfig --file "${config_file}" --group 
"${config_group}" --key "$1")
++    local db_dir=$(kreadconfig5 --file "${config_file}" --group 
"${config_group}" --key "$1")
+     echo "${db_dir}"
+ }
+ 
+-- 
+2.15.1
+

diff --git a/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-1.patch 
b/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-1.patch
new file mode 100644
index 00000000000..e3e968fbaac
--- /dev/null
+++ b/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-1.patch
@@ -0,0 +1,58 @@
+From 395ab5b02ed7d02736a08e370217c0c96b391bb9 Mon Sep 17 00:00:00 2001
+From: Maik Qualmann <metzping...@gmail.com>
+Date: Wed, 6 Dec 2017 08:09:44 +0100
+Subject: Workaround for the problem mariaDB >= 10.2 and QTBUG-63108
+
+---
+ libs/album/albummanager.cpp | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/libs/album/albummanager.cpp b/libs/album/albummanager.cpp
+index a72acc3..2ea40e9 100644
+--- a/libs/album/albummanager.cpp
++++ b/libs/album/albummanager.cpp
+@@ -162,6 +162,7 @@ public:
+         hasPriorizedDbPath(false),
+         dbPort(0),
+         dbInternalServer(false),
++        dbFakeConnection(false),
+         showOnlyAvailableAlbums(false),
+         albumListJob(0),
+         dateListJob(0),
+@@ -192,6 +193,7 @@ public:
+     QString                     dbHostName;
+     int                         dbPort;
+     bool                        dbInternalServer;
++    bool                        dbFakeConnection;
+ 
+     bool                        showOnlyAvailableAlbums;
+ 
+@@ -391,6 +393,11 @@ void AlbumManager::cleanUp()
+         d->personListJob->cancel();
+         d->personListJob = 0;
+     }
++
++    if (d->dbFakeConnection)
++    {
++        QSqlDatabase::removeDatabase(QLatin1String("FakeConnection"));
++    }
+ }
+ 
+ bool AlbumManager::databaseEqual(const DbEngineParameters& parameters) const
+@@ -727,6 +734,13 @@ bool AlbumManager::setDatabase(const DbEngineParameters& 
params, bool priority,
+     // ensure, embedded database is loaded
+     qCDebug(DIGIKAM_GENERAL_LOG) << params;
+ 
++    // workaround for the problem mariaDB >= 10.2 and QTBUG-63108.
++    if (params.isMySQL() && !d->dbFakeConnection)
++    {
++        QSqlDatabase::addDatabase(QLatin1String("QMYSQL"), 
QLatin1String("FakeConnection"));
++        d->dbFakeConnection = true;
++    }
++
+     if (params.internalServer)
+     {
+         DatabaseServerError result = 
DatabaseServerStarter::instance()->startServerManagerProcess(params);
+-- 
+cgit v0.11.2
+

diff --git a/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-2.patch 
b/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-2.patch
new file mode 100644
index 00000000000..eed213c3bc9
--- /dev/null
+++ b/media-gfx/digikam/files/digikam-5.7.0-mariadb-10.2-2.patch
@@ -0,0 +1,117 @@
+From ba1ceda1448895009ba6524398ca42441695cc3e Mon Sep 17 00:00:00 2001
+From: Maik Qualmann <metzping...@gmail.com>
+Date: Wed, 6 Dec 2017 18:28:32 +0100
+Subject: workaround for QTBUG-63108 now works in all cases
+
+---
+ app/main/digikamapp.cpp                  |  2 ++
+ libs/album/albummanager.cpp              | 30 +++++++++++++++++++++---------
+ libs/album/albummanager.h                |  3 +++
+ libs/database/utils/dbsettingswidget.cpp |  3 +++
+ 4 files changed, 29 insertions(+), 9 deletions(-)
+
+diff --git a/app/main/digikamapp.cpp b/app/main/digikamapp.cpp
+index 4349271..935b786 100644
+--- a/app/main/digikamapp.cpp
++++ b/app/main/digikamapp.cpp
+@@ -383,6 +383,8 @@ DigikamApp::~DigikamApp()
+         DatabaseServerStarter::instance()->stopServerManagerProcess();
+     }
+ 
++    AlbumManager::instance()->removeFakeConnection();
++
+     m_instance = 0;
+ 
+     delete d->modelCollection;
+diff --git a/libs/album/albummanager.cpp b/libs/album/albummanager.cpp
+index 2ea40e9..92a8b37 100644
+--- a/libs/album/albummanager.cpp
++++ b/libs/album/albummanager.cpp
+@@ -393,11 +393,6 @@ void AlbumManager::cleanUp()
+         d->personListJob->cancel();
+         d->personListJob = 0;
+     }
+-
+-    if (d->dbFakeConnection)
+-    {
+-        QSqlDatabase::removeDatabase(QLatin1String("FakeConnection"));
+-    }
+ }
+ 
+ bool AlbumManager::databaseEqual(const DbEngineParameters& parameters) const
+@@ -734,11 +729,10 @@ bool AlbumManager::setDatabase(const DbEngineParameters& 
params, bool priority,
+     // ensure, embedded database is loaded
+     qCDebug(DIGIKAM_GENERAL_LOG) << params;
+ 
+-    // workaround for the problem mariaDB >= 10.2 and QTBUG-63108.
+-    if (params.isMySQL() && !d->dbFakeConnection)
++    // workaround for the problem mariaDB >= 10.2 and QTBUG-63108
++    if (params.isMySQL())
+     {
+-        QSqlDatabase::addDatabase(QLatin1String("QMYSQL"), 
QLatin1String("FakeConnection"));
+-        d->dbFakeConnection = true;
++        addFakeConnection();
+     }
+ 
+     if (params.internalServer)
+@@ -3558,4 +3552,22 @@ void AlbumManager::removeWatchedPAlbums(const PAlbum* 
const album)
+     d->albumWatch->removeWatchedPAlbums(album);
+ }
+ 
++void AlbumManager::addFakeConnection()
++{
++    if (!d->dbFakeConnection)
++    {
++        // workaround for the problem mariaDB >= 10.2 and QTBUG-63108
++        QSqlDatabase::addDatabase(QLatin1String("QMYSQL"), 
QLatin1String("FakeConnection"));
++        d->dbFakeConnection = true;
++    }
++}
++
++void AlbumManager::removeFakeConnection()
++{
++    if (d->dbFakeConnection)
++    {
++        QSqlDatabase::removeDatabase(QLatin1String("FakeConnection"));
++    }
++}
++
+ }  // namespace Digikam
+diff --git a/libs/album/albummanager.h b/libs/album/albummanager.h
+index bee58c4..5b24c8d 100644
+--- a/libs/album/albummanager.h
++++ b/libs/album/albummanager.h
+@@ -625,6 +625,9 @@ public:
+ 
+     void removeWatchedPAlbums(const PAlbum* const album);
+ 
++    void addFakeConnection();
++    void removeFakeConnection();
++
+     //@}
+ 
+ Q_SIGNALS:
+diff --git a/libs/database/utils/dbsettingswidget.cpp 
b/libs/database/utils/dbsettingswidget.cpp
+index ca95646..4f1e1a4 100644
+--- a/libs/database/utils/dbsettingswidget.cpp
++++ b/libs/database/utils/dbsettingswidget.cpp
+@@ -65,6 +65,7 @@
+ #include "dlayoutbox.h"
+ #include "mysqlinitbinary.h"
+ #include "mysqlservbinary.h"
++#include "albummanager.h"
+ 
+ namespace Digikam
+ {
+@@ -669,6 +670,8 @@ bool 
DatabaseSettingsWidget::checkMysqlServerConnection(QString& error)
+ 
+     qApp->setOverrideCursor(Qt::WaitCursor);
+ 
++    AlbumManager::instance()->addFakeConnection();
++
+     QString databaseID(QLatin1String("ConnectionTest"));
+     QSqlDatabase testDatabase = QSqlDatabase::addDatabase(databaseBackend(), 
databaseID);
+ 
+-- 
+cgit v0.11.2
+

Reply via email to