summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-01-25 20:01:50 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2023-01-25 20:07:25 +0100
commit2719d30e9a3c60fa2c089a39952c8060d097f197 (patch)
tree6d3dcb05b535a9361b1251f155ee72d789173684 /kde-apps/gwenview
parentmedia-gfx/exiv2: add 0.27.6 (diff)
downloadgentoo-2719d30e9a3c60fa2c089a39952c8060d097f197.tar.gz
gentoo-2719d30e9a3c60fa2c089a39952c8060d097f197.tar.bz2
gentoo-2719d30e9a3c60fa2c089a39952c8060d097f197.zip
kde-apps/gwenview: Fix RAW plugin coexistence
Upstream commit c419ec4a052b39eae7c17caf2a89d39d76b43777 KDE-bug: https://bugs.kde.org/show_bug.cgi?id=463132 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-apps/gwenview')
-rw-r--r--kde-apps/gwenview/files/gwenview-22.08.3-fix-raw-plugin-coexistence.patch58
-rw-r--r--kde-apps/gwenview/gwenview-22.08.3-r2.ebuild107
-rw-r--r--kde-apps/gwenview/gwenview-22.12.1-r1.ebuild103
3 files changed, 268 insertions, 0 deletions
diff --git a/kde-apps/gwenview/files/gwenview-22.08.3-fix-raw-plugin-coexistence.patch b/kde-apps/gwenview/files/gwenview-22.08.3-fix-raw-plugin-coexistence.patch
new file mode 100644
index 000000000000..759b23095ff9
--- /dev/null
+++ b/kde-apps/gwenview/files/gwenview-22.08.3-fix-raw-plugin-coexistence.patch
@@ -0,0 +1,58 @@
+From c419ec4a052b39eae7c17caf2a89d39d76b43777 Mon Sep 17 00:00:00 2001
+From: Mirco Miranda <mirco.miranda@systemceramics.com>
+Date: Tue, 10 Jan 2023 14:53:30 +0000
+Subject: [PATCH] Fixed coexistence between Qt Raw plugin and KDcraw
+
+Use the RAW plugin to load raw images if installed:
+- Previews are always generated from the RAW image at the fastest possible speed.
+- Images are loaded in the highest possible quality (default plugin raw).
+- If the raw plugin is not installed everything works as before (use KDcraw).
+
+BUG: 463132
+FIXED-IN: 22.12.2
+
+
+(cherry picked from commit a7dc8feefc2147a08526b61bf361b63f78645ea0)
+---
+ lib/document/loadingdocumentimpl.cpp | 3 ++-
+ lib/thumbnailprovider/thumbnailgenerator.cpp | 8 +++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/lib/document/loadingdocumentimpl.cpp b/lib/document/loadingdocumentimpl.cpp
+index baa0542a..ece4d9e2 100644
+--- a/lib/document/loadingdocumentimpl.cpp
++++ b/lib/document/loadingdocumentimpl.cpp
+@@ -205,7 +205,8 @@ struct LoadingDocumentImplPrivate {
+ QImageReader reader;
+
+ #ifdef KDCRAW_FOUND
+- if (KDcrawIface::KDcraw::rawFilesList().contains(QString::fromLatin1(mFormatHint))) {
++ if (!QImageReader::supportedImageFormats().contains(QByteArray("raw"))
++ && KDcrawIface::KDcraw::rawFilesList().contains(QString::fromLatin1(mFormatHint))) {
+ QByteArray previewData;
+
+ // if the image is in format supported by dcraw, fetch its embedded preview
+diff --git a/lib/thumbnailprovider/thumbnailgenerator.cpp b/lib/thumbnailprovider/thumbnailgenerator.cpp
+index 3179dfae..f01d5c04 100644
+--- a/lib/thumbnailprovider/thumbnailgenerator.cpp
++++ b/lib/thumbnailprovider/thumbnailgenerator.cpp
+@@ -70,9 +70,15 @@ bool ThumbnailContext::load(const QString &pixPath, int pixelSize)
+ QBuffer buffer;
+ int previewRatio = 1;
+
++ bool useRawPlugin = QImageReader::imageFormat(pixPath) == QByteArray("raw");
++ if (useRawPlugin) { // make preview generation faster (same as KDcrawIface::KDcraw::loadHalfPreview)
++ reader.setQuality(1);
++ previewRatio = 2;
++ }
++
+ #ifdef KDCRAW_FOUND
+ // raw images deserve special treatment
+- if (KDcrawIface::KDcraw::rawFilesList().contains(QString::fromLatin1(formatHint))) {
++ if (!useRawPlugin && KDcrawIface::KDcraw::rawFilesList().contains(QString::fromLatin1(formatHint))) {
+ // use KDCraw to extract the preview
+ bool ret = KDcrawIface::KDcraw::loadEmbeddedPreview(data, pixPath);
+
+--
+GitLab
+
diff --git a/kde-apps/gwenview/gwenview-22.08.3-r2.ebuild b/kde-apps/gwenview/gwenview-22.08.3-r2.ebuild
new file mode 100644
index 000000000000..6ec7c9ce9c16
--- /dev/null
+++ b/kde-apps/gwenview/gwenview-22.08.3-r2.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+PVCUT=$(ver_cut 1-3)
+KFMIN=5.96.0
+QTMIN=5.15.5
+inherit ecm gear.kde.org optfeature
+
+DESCRIPTION="Image viewer by KDE"
+HOMEPAGE="https://apps.kde.org/gwenview/ https://userbase.kde.org/Gwenview"
+
+LICENSE="GPL-2+ handbook? ( FDL-1.2 )"
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="activities fits +mpris raw semantic-desktop share X"
+
+# requires running environment
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtsvg-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kguiaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemmodels-${KFMIN}:5
+ >=kde-frameworks/kitemviews-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/knotifications-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ >=kde-frameworks/solid-${KFMIN}:5
+ media-gfx/exiv2:=
+ media-libs/kcolorpicker
+ >=media-libs/kimageannotator-0.5.0
+ media-libs/lcms:2
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:0=
+ >=media-libs/phonon-4.11.0
+ media-libs/tiff:=
+ activities? ( >=kde-frameworks/kactivities-${KFMIN}:5 )
+ fits? ( sci-libs/cfitsio )
+ mpris? ( >=dev-qt/qtdbus-${QTMIN}:5 )
+ raw? ( >=kde-apps/libkdcraw-${PVCUT}:5 )
+ semantic-desktop? (
+ >=kde-frameworks/baloo-${KFMIN}:5
+ >=kde-frameworks/kfilemetadata-${KFMIN}:5
+ )
+ share? ( >=kde-frameworks/purpose-${KFMIN}:5 )
+ X? (
+ >=dev-qt/qtx11extras-${QTMIN}:5
+ x11-libs/libX11
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ >=dev-qt/qtconcurrent-${QTMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+"
+RDEPEND="${COMMON_DEPEND}
+ >=dev-qt/qtimageformats-${QTMIN}:5
+ >=kde-frameworks/kimageformats-${KFMIN}:5
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-without_x11.patch"
+ "${FILESDIR}/${P}-fix-raw-plugin-coexistence.patch" # KDE-bug 463132
+)
+
+src_prepare() {
+ ecm_src_prepare
+ if ! use mpris; then
+ # FIXME: upstream a better solution
+ sed -e "/set(HAVE_QTDBUS/s/\${Qt5DBus_FOUND}/0/" -i CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package activities KF5Activities)
+ $(cmake_use_find_package fits CFitsio)
+ $(cmake_use_find_package raw KF5KDcraw)
+ -DGWENVIEW_SEMANTICINFO_BACKEND=$(usex semantic-desktop Baloo None)
+ $(cmake_use_find_package share KF5Purpose)
+ -DWITHOUT_X11=$(usex !X)
+ )
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ optfeature "SVG support" kde-apps/svgpart:${SLOT}
+ fi
+ ecm_pkg_postinst
+}
diff --git a/kde-apps/gwenview/gwenview-22.12.1-r1.ebuild b/kde-apps/gwenview/gwenview-22.12.1-r1.ebuild
new file mode 100644
index 000000000000..e049d2beb5ae
--- /dev/null
+++ b/kde-apps/gwenview/gwenview-22.12.1-r1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+PVCUT=$(ver_cut 1-3)
+KFMIN=5.101.0
+QTMIN=5.15.5
+inherit ecm gear.kde.org optfeature
+
+DESCRIPTION="Image viewer by KDE"
+HOMEPAGE="https://apps.kde.org/gwenview/ https://userbase.kde.org/Gwenview"
+
+LICENSE="GPL-2+ handbook? ( FDL-1.2 )"
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="activities fits +mpris raw semantic-desktop share X"
+
+# requires running environment
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtsvg-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kguiaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemmodels-${KFMIN}:5
+ >=kde-frameworks/kitemviews-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/knotifications-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ >=kde-frameworks/solid-${KFMIN}:5
+ media-gfx/exiv2:=
+ media-libs/kcolorpicker
+ >=media-libs/kimageannotator-0.5.0
+ media-libs/lcms:2
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:0=
+ >=media-libs/phonon-4.11.0
+ media-libs/tiff:=
+ activities? ( >=kde-frameworks/kactivities-${KFMIN}:5 )
+ fits? ( sci-libs/cfitsio )
+ mpris? ( >=dev-qt/qtdbus-${QTMIN}:5 )
+ raw? ( >=kde-apps/libkdcraw-${PVCUT}:5 )
+ semantic-desktop? (
+ >=kde-frameworks/baloo-${KFMIN}:5
+ >=kde-frameworks/kfilemetadata-${KFMIN}:5
+ )
+ share? ( >=kde-frameworks/purpose-${KFMIN}:5 )
+ X? (
+ >=dev-qt/qtx11extras-${QTMIN}:5
+ x11-libs/libX11
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ >=dev-qt/qtconcurrent-${QTMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+"
+RDEPEND="${COMMON_DEPEND}
+ >=dev-qt/qtimageformats-${QTMIN}:5
+ >=kde-frameworks/kimageformats-${KFMIN}:5
+"
+PATCHES=( "${FILESDIR}/${PN}-22.08.3-fix-raw-plugin-coexistence.patch" ) # KDE-bug 463132
+
+src_prepare() {
+ ecm_src_prepare
+ if ! use mpris; then
+ # FIXME: upstream a better solution
+ sed -e "/set(HAVE_QTDBUS/s/\${Qt5DBus_FOUND}/0/" -i CMakeLists.txt || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package activities KF5Activities)
+ $(cmake_use_find_package fits CFitsio)
+ $(cmake_use_find_package raw KF5KDcraw)
+ -DGWENVIEW_SEMANTICINFO_BACKEND=$(usex semantic-desktop Baloo None)
+ $(cmake_use_find_package share KF5Purpose)
+ -DWITHOUT_X11=$(usex !X)
+ )
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ optfeature "SVG support" "kde-apps/svgpart:${SLOT}"
+ fi
+ ecm_pkg_postinst
+}