commit:     2b50bb6afe18817aca1fcf49b3c5321c9f3cca24
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 28 17:12:09 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun May 28 18:28:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b50bb6a

media-gfx/phototonic: update EAPI 7 -> 8, fix build with >=exiv2-0.28

Closes: https://bugs.gentoo.org/906492
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/phototonic-2.1-exiv2-0.28.patch          | 135 +++++++++++++++++++++
 media-gfx/phototonic/phototonic-2.1.ebuild         |  19 +--
 2 files changed, 141 insertions(+), 13 deletions(-)

diff --git a/media-gfx/phototonic/files/phototonic-2.1-exiv2-0.28.patch 
b/media-gfx/phototonic/files/phototonic-2.1-exiv2-0.28.patch
new file mode 100644
index 000000000000..1c75b628dab3
--- /dev/null
+++ b/media-gfx/phototonic/files/phototonic-2.1-exiv2-0.28.patch
@@ -0,0 +1,135 @@
+From 923a3fc14de0b779a45696c5f0aef34c74d84f13 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <ast...@gentoo.org>
+Date: Sun, 28 May 2023 18:54:10 +0200
+Subject: [PATCH] Fix build with exiv2-0.28
+
+Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org>
+---
+ ImageViewer.cpp   | 9 +++++++++
+ MetadataCache.cpp | 8 ++++++++
+ Phototonic.cpp    | 4 ++++
+ Tags.cpp          | 8 ++++++++
+ ThumbsViewer.cpp  | 4 ++++
+ 5 files changed, 33 insertions(+)
+
+diff --git a/ImageViewer.cpp b/ImageViewer.cpp
+index 357d223..df3ac43 100644
+--- a/ImageViewer.cpp
++++ b/ImageViewer.cpp
+@@ -945,7 +945,11 @@ void ImageViewer::keyMoveEvent(int direction) {
+ }
+ 
+ void ImageViewer::saveImage() {
++#if EXIV2_TEST_VERSION(0,28,0)
++    Exiv2::Image::UniquePtr image;
++#else
+     Exiv2::Image::AutoPtr image;
++#endif
+     bool exifError = false;
+ 
+     if (newImage) {
+@@ -985,8 +989,13 @@ void ImageViewer::saveImage() {
+ }
+ 
+ void ImageViewer::saveImageAs() {
++#if EXIV2_TEST_VERSION(0,28,0)
++    Exiv2::Image::UniquePtr exifImage;
++    Exiv2::Image::UniquePtr newExifImage;
++#else
+     Exiv2::Image::AutoPtr exifImage;
+     Exiv2::Image::AutoPtr newExifImage;
++#endif
+     bool exifError = false;
+ 
+     setCursorHiding(false);
+diff --git a/MetadataCache.cpp b/MetadataCache.cpp
+index 524ae74..5ddd4c8 100644
+--- a/MetadataCache.cpp
++++ b/MetadataCache.cpp
+@@ -64,7 +64,11 @@ void MetadataCache::clear() {
+ }
+ 
+ bool MetadataCache::loadImageMetadata(const QString &imageFullPath) {
++#if EXIV2_TEST_VERSION(0,28,0)
++    Exiv2::Image::UniquePtr exifImage;
++#else
+     Exiv2::Image::AutoPtr exifImage;
++#endif
+     QSet<QString> tags;
+     long orientation = 0;
+ 
+@@ -78,7 +82,11 @@ bool MetadataCache::loadImageMetadata(const QString 
&imageFullPath) {
+     try {
+         Exiv2::ExifData &exifData = exifImage->exifData();
+         if (!exifData.empty()) {
++#if EXIV2_TEST_VERSION(0,28,0)
++            orientation = 
exifData["Exif.Image.Orientation"].value().toUint32();
++#else
+             orientation = exifData["Exif.Image.Orientation"].value().toLong();
++#endif
+         }
+     } catch (Exiv2::Error &error) {
+         qWarning() << "Failed to read Exif metadata";
+diff --git a/Phototonic.cpp b/Phototonic.cpp
+index 6cc95b3..bd5497d 100644
+--- a/Phototonic.cpp
++++ b/Phototonic.cpp
+@@ -3151,7 +3151,11 @@ void Phototonic::removeMetadata() {
+ 
+     if (ret == MessageBox::Yes) {
+         for (int file = 0; file < fileList.size(); ++file) {
++#if EXIV2_TEST_VERSION(0,28,0)
++            Exiv2::Image::UniquePtr image;
++#else
+             Exiv2::Image::AutoPtr image;
++#endif
+             try {
+                 image = 
Exiv2::ImageFactory::open(fileList[file].toStdString());
+                 image->clearMetadata();
+diff --git a/Tags.cpp b/Tags.cpp
+index 84eea16..a62da9d 100644
+--- a/Tags.cpp
++++ b/Tags.cpp
+@@ -136,7 +136,11 @@ void ImageTags::addTag(QString tagName, bool tagChecked) {
+ 
+ bool ImageTags::writeTagsToImage(QString &imageFileName, QSet<QString> 
&newTags) {
+     QSet<QString> imageTags;
++#if EXIV2_TEST_VERSION(0,28,0)
++    Exiv2::Image::UniquePtr exifImage;
++#else
+     Exiv2::Image::AutoPtr exifImage;
++#endif
+ 
+     try {
+         exifImage = Exiv2::ImageFactory::open(imageFileName.toStdString());
+@@ -160,7 +164,11 @@ bool ImageTags::writeTagsToImage(QString &imageFileName, 
QSet<QString> &newTags)
+         QSetIterator<QString> newTagsIt(newTags);
+         while (newTagsIt.hasNext()) {
+             QString tag = newTagsIt.next();
++#if EXIV2_TEST_VERSION(0,28,0)
++            Exiv2::Value::UniquePtr value = 
Exiv2::Value::create(Exiv2::string);
++#else
+             Exiv2::Value::AutoPtr value = Exiv2::Value::create(Exiv2::string);
++#endif
+             value->read(tag.toStdString());
+             Exiv2::IptcKey key("Iptc.Application2.Keywords");
+             newIptcData.add(key, value.get());
+diff --git a/ThumbsViewer.cpp b/ThumbsViewer.cpp
+index 77a6189..4a11475 100644
+--- a/ThumbsViewer.cpp
++++ b/ThumbsViewer.cpp
+@@ -210,7 +210,11 @@ void ThumbsViewer::updateImageInfoViewer(QString 
imageFullPath) {
+         infoView->addEntry(key, val);
+     }
+ 
++#if EXIV2_TEST_VERSION(0,28,0)
++    Exiv2::Image::UniquePtr exifImage;
++#else
+     Exiv2::Image::AutoPtr exifImage;
++#endif
+     try {
+         exifImage = Exiv2::ImageFactory::open(imageFullPath.toStdString());
+         exifImage->readMetadata();
+-- 
+2.40.1
+

diff --git a/media-gfx/phototonic/phototonic-2.1.ebuild 
b/media-gfx/phototonic/phototonic-2.1.ebuild
index bb861a81715c..7e7667662223 100644
--- a/media-gfx/phototonic/phototonic-2.1.ebuild
+++ b/media-gfx/phototonic/phototonic-2.1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit qmake-utils xdg-utils
+inherit qmake-utils xdg
 
 DESCRIPTION="Image viewer and organizer"
 HOMEPAGE="https://github.com/oferkv/phototonic";
@@ -30,6 +30,9 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+# pending upstream: https://github.com/oferkv/phototonic/pull/274
+PATCHES=( "${FILESDIR}/${P}-exiv2-0.28.patch" ) # bug 906492
+
 src_configure() {
        eqmake5
 }
@@ -37,13 +40,3 @@ src_configure() {
 src_install() {
        emake install INSTALL_ROOT="${D}"
 }
-
-pkg_postinst() {
-       xdg_icon_cache_update
-       xdg_desktop_database_update
-}
-
-pkg_postrm() {
-       xdg_icon_cache_update
-       xdg_desktop_database_update
-}

Reply via email to