diff options
author | Johannes Huber <johu@gentoo.org> | 2016-12-11 11:12:35 +0100 |
---|---|---|
committer | Johannes Huber <johu@gentoo.org> | 2016-12-11 11:12:35 +0100 |
commit | cd2f2c655d00e87504cd6ecbf0410ffc802f2930 (patch) | |
tree | 2aed83bb01c62bdaeb8788c49fd73f92d5918624 /media-gfx | |
parent | x11-wm/lumina: bump to 1.1.0 (diff) | |
download | gentoo-cd2f2c655d00e87504cd6ecbf0410ffc802f2930.tar.gz gentoo-cd2f2c655d00e87504cd6ecbf0410ffc802f2930.tar.bz2 gentoo-cd2f2c655d00e87504cd6ecbf0410ffc802f2930.zip |
media-gfx/digikam: Fix db lock issue
Revision bump adds upstream patch to fix a database lock with the batch queue
manager.
Reported-by: Oliver Schwabedissen <Oliver@Schwabedissen.name>
Gentoo-bug: 602320
Package-Manager: portage-2.3.3
Diffstat (limited to 'media-gfx')
-rw-r--r-- | media-gfx/digikam/digikam-5.3.0-r1.ebuild | 170 | ||||
-rw-r--r-- | media-gfx/digikam/files/digikam-5.3.0-db-lock.patch | 135 |
2 files changed, 305 insertions, 0 deletions
diff --git a/media-gfx/digikam/digikam-5.3.0-r1.ebuild b/media-gfx/digikam/digikam-5.3.0-r1.ebuild new file mode 100644 index 000000000000..9aeb0cc00423 --- /dev/null +++ b/media-gfx/digikam/digikam-5.3.0-r1.ebuild @@ -0,0 +1,170 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +if [[ ${KDE_BUILD_TYPE} != live ]]; then + KDE_HANDBOOK="true" + KDE_TEST="true" +fi +CMAKE_MAKEFILE_GENERATOR="emake" +CMAKE_MIN_VERSION="3.0" +inherit kde5 toolchain-funcs + +DESCRIPTION="Digital photo management application" +HOMEPAGE="https://www.digikam.org/" + +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" +IUSE="addressbook calendar gphoto2 jpeg2k +kipi +lensfun marble semantic-desktop mysql opengl openmp +panorama scanner video X" + +if [[ ${KDE_BUILD_TYPE} != live ]]; then + 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 + +COMMON_DEPEND=" + $(add_frameworks_dep kconfig) + $(add_frameworks_dep kconfigwidgets) + $(add_frameworks_dep kcoreaddons) + $(add_frameworks_dep kiconthemes) + $(add_frameworks_dep ki18n) + $(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 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:= + media-libs/lcms:2 + media-libs/liblqr + >=media-libs/libpgf-6.12.27 + 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) + ) + mysql? ( virtual/mysql ) + opengl? ( + $(add_qt_dep qtopengl) + virtual/opengl + ) + panorama? ( $(add_frameworks_dep threadweaver) ) + scanner? ( $(add_kdeapps_dep libksane) ) + semantic-desktop? ( $(add_frameworks_dep kfilemetadata) ) + video? ( $(add_qt_dep qtmultimedia 'widgets') ) + X? ( + $(add_qt_dep qtx11extras) + x11-libs/libX11 + ) +" +DEPEND="${COMMON_DEPEND} + $(add_qt_dep qtconcurrent) + 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}-db-lock.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_MYSQLSUPPORT=$(usex mysql) + -DENABLE_MEDIAPLAYER=$(usex video) + -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 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.3.0-db-lock.patch b/media-gfx/digikam/files/digikam-5.3.0-db-lock.patch new file mode 100644 index 000000000000..50223f011846 --- /dev/null +++ b/media-gfx/digikam/files/digikam-5.3.0-db-lock.patch @@ -0,0 +1,135 @@ +From f37ef2c195b61a43a40e9cbb7f119fdc8e9d38f4 Mon Sep 17 00:00:00 2001 +From: Maik Qualmann <metzpinguin@gmail.com> +Date: Sat, 10 Dec 2016 11:16:50 +0100 +Subject: fix locked database with BQM + +--- + utilities/queuemanager/manager/actionthread.cpp | 27 ++++++++++++++++++++++--- + utilities/queuemanager/manager/actionthread.h | 1 + + utilities/queuemanager/manager/task.cpp | 24 +++++----------------- + 3 files changed, 30 insertions(+), 22 deletions(-) + +diff --git a/utilities/queuemanager/manager/actionthread.cpp b/utilities/queuemanager/manager/actionthread.cpp +index 48c3fa3..141bb3d 100644 +--- a/utilities/queuemanager/manager/actionthread.cpp ++++ b/utilities/queuemanager/manager/actionthread.cpp +@@ -28,6 +28,7 @@ + + #include "digikam_debug.h" + #include "digikam_config.h" ++#include "collectionscanner.h" + #include "task.h" + + namespace Digikam +@@ -82,7 +83,7 @@ void ActionThread::processQueueItems(const QList<AssignedBatchTools>& items) + { + ActionJobCollection collection; + +- for(int i = 0 ; i < items.size() ; i++) ++ for (int i = 0 ; i < items.size() ; i++) + { + Task* const t = new Task(); + t->setSettings(d->settings); +@@ -92,10 +93,12 @@ void ActionThread::processQueueItems(const QList<AssignedBatchTools>& items) + this, SIGNAL(signalStarting(Digikam::ActionData))); + + connect(t, SIGNAL(signalFinished(Digikam::ActionData)), +- this, SIGNAL(signalFinished(Digikam::ActionData))); ++ this, SLOT(slotUpdateImageInfo(Digikam::ActionData)), ++ Qt::BlockingQueuedConnection); + + connect(this, SIGNAL(signalCancelTask()), +- t, SLOT(slotCancel()), Qt::QueuedConnection); ++ t, SLOT(slotCancel()), ++ Qt::QueuedConnection); + + collection.insert(t, 0); + } +@@ -111,6 +114,24 @@ void ActionThread::cancel() + ActionThreadBase::cancel(); + } + ++void ActionThread::slotUpdateImageInfo(const Digikam::ActionData& ad) ++{ ++ if (ad.status == ActionData::BatchDone) ++ { ++ CollectionScanner scanner; ++ ImageInfo source = ImageInfo::fromUrl(ad.fileUrl); ++ qlonglong id = scanner.scanFile(ad.destUrl.toLocalFile(), CollectionScanner::NormalScan); ++ ImageInfo info(id); ++ QDateTime dateTime = info.dateTime(); ++ // Copy the digiKam attributes from original file to the new file ++ CollectionScanner::copyFileProperties(source, info); ++ // Restore date time from new file ++ info.setDateTime(dateTime); ++ } ++ ++ emit signalFinished(ad); ++} ++ + void ActionThread::slotThreadFinished() + { + if (isEmpty()) +diff --git a/utilities/queuemanager/manager/actionthread.h b/utilities/queuemanager/manager/actionthread.h +index 8cb848b..3375c2e 100644 +--- a/utilities/queuemanager/manager/actionthread.h ++++ b/utilities/queuemanager/manager/actionthread.h +@@ -72,6 +72,7 @@ Q_SIGNALS: + + private Q_SLOTS: + ++ void slotUpdateImageInfo(const Digikam::ActionData& ad); + void slotThreadFinished(); + + private: +diff --git a/utilities/queuemanager/manager/task.cpp b/utilities/queuemanager/manager/task.cpp +index a94b4f9..4c6b710 100644 +--- a/utilities/queuemanager/manager/task.cpp ++++ b/utilities/queuemanager/manager/task.cpp +@@ -46,10 +46,8 @@ extern "C" + #include "dimg.h" + #include "dmetadata.h" + #include "imageinfo.h" +-#include "fileactionmngr.h" + #include "batchtool.h" + #include "batchtoolsmanager.h" +-#include "collectionscanner.h" + #include "fileoperation.h" + + namespace Digikam +@@ -245,27 +243,15 @@ void Task::run() + } + } + +- if (!FileOperation::localFileRename(d->tools.m_itemUrl.toLocalFile(), +- outUrl.toLocalFile(), +- dest.toLocalFile())) ++ if (FileOperation::localFileRename(d->tools.m_itemUrl.toLocalFile(), ++ outUrl.toLocalFile(), ++ dest.toLocalFile())) + { +- emitActionData(ActionData::BatchFailed, i18n("Failed to create file..."), dest); ++ emitActionData(ActionData::BatchDone, i18n("Item processed successfully %1", renameMess), dest); + } + else + { +- // -- Now copy the digiKam attributes from original file to the new file ------------ +- +- CollectionScanner scanner; +- qlonglong id = scanner.scanFile(dest.toLocalFile(), CollectionScanner::NormalScan); +- +- ImageInfo destInfo(id); +- CollectionScanner::copyFileProperties(source, destInfo); +- +- // -- Read again new file that the database is up to date --------------------------- +- +- scanner.scanFile(destInfo, CollectionScanner::Rescan); +- +- emitActionData(ActionData::BatchDone, i18n("Item processed successfully %1", renameMess), dest); ++ emitActionData(ActionData::BatchFailed, i18n("Failed to create file..."), dest); + } + } + else +-- +cgit v0.11.2 + |