git: 75ccfcf996ef - main - graphics/viewnior: make compatible with exiv2 0.28

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sun, 09 Jul 2023 22:09:47 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=75ccfcf996ef3dc7f908a9e6ee97f2f18d47ab28

commit 75ccfcf996ef3dc7f908a9e6ee97f2f18d47ab28
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2023-07-02 22:01:06 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2023-07-09 22:08:11 +0000

    graphics/viewnior: make compatible with exiv2 0.28
    
    PR:             272311
---
 graphics/viewnior/Makefile                      |  2 +-
 graphics/viewnior/files/patch-src_uni-exiv2.cpp | 63 +++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/graphics/viewnior/Makefile b/graphics/viewnior/Makefile
index 0f9f8be8716d..b83909ce7860 100644
--- a/graphics/viewnior/Makefile
+++ b/graphics/viewnior/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	viewnior
 DISTVERSIONPREFIX=	${PORTNAME}-
 DISTVERSION=	1.8
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 
 MAINTAINER=	eduardo@FreeBSD.org
diff --git a/graphics/viewnior/files/patch-src_uni-exiv2.cpp b/graphics/viewnior/files/patch-src_uni-exiv2.cpp
new file mode 100644
index 000000000000..47456b5f246b
--- /dev/null
+++ b/graphics/viewnior/files/patch-src_uni-exiv2.cpp
@@ -0,0 +1,63 @@
+--- src/uni-exiv2.cpp.orig	2021-11-21 14:49:46 UTC
++++ src/uni-exiv2.cpp
+@@ -27,7 +27,7 @@
+ 
+ #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0]))
+ 
+-static Exiv2::Image::AutoPtr cached_image;
++static Exiv2::Image::UniquePtr cached_image;
+ 
+ extern "C"
+ void
+@@ -35,7 +35,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(c
+ {
+     Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
+     try {
+-        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri);
++        Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(uri) };
+         if ( image.get() == 0 ) {
+             return;
+         }
+@@ -80,7 +80,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(c
+                 }
+             }
+         }
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+ }
+@@ -97,13 +97,13 @@ uni_read_exiv2_to_cache(const char *uri)
+     }
+ 
+     try {
+-        cached_image = Exiv2::ImageFactory::open(uri);
++        cached_image = std::move(Exiv2::ImageFactory::open(uri));
+         if ( cached_image.get() == 0 ) {
+             return 1;
+         }
+ 
+         cached_image->readMetadata();
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+ 
+@@ -121,7 +121,7 @@ uni_write_exiv2_from_cache(const char *uri)
+     }
+ 
+     try {
+-        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri);
++        Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(uri) };
+         if ( image.get() == 0 ) {
+             return 2;
+         }
+@@ -133,7 +133,7 @@ uni_write_exiv2_from_cache(const char *uri)
+         cached_image.reset(NULL);
+ 
+         return 0;
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+