diff --git a/0001-Fix-build-with-exiv2-0.28.0-raise-minimum-to-0.27.0.patch b/0001-Fix-build-with-exiv2-0.28.0-raise-minimum-to-0.27.0.patch new file mode 100644 index 0000000..c8ed300 --- /dev/null +++ b/0001-Fix-build-with-exiv2-0.28.0-raise-minimum-to-0.27.0.patch @@ -0,0 +1,100 @@ +From 8767bc47c2cc9591745ee2b3214fff38eaab114f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Sat, 11 Nov 2023 18:17:04 +0100 +Subject: [PATCH] Fix build with >=exiv2-0.28.0, raise minimum to 0.27.0 + +- enables use of EXIV2_TEST_VERSION macro +- add compatibility for exiv2-0.28.0 +--- + meson.build | 2 +- + src/uni-exiv2.cpp | 21 +++++++++++++++------ + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/meson.build b/meson.build +index 8f91fb5..9ef9f09 100644 +--- a/meson.build ++++ b/meson.build +@@ -28,7 +28,7 @@ viewnior_deps = [ + dependency('gio-2.0', version: glib_ver), + dependency('shared-mime-info', version: '>= 0.20'), + dependency('gdk-pixbuf-2.0', version: '>= 0.21'), +- dependency('exiv2', version: '>= 0.21'), ++ dependency('exiv2', version: '>= 0.27'), + ] + # + +diff --git a/src/uni-exiv2.cpp b/src/uni-exiv2.cpp +index 0d14b9f..d03edd7 100644 +--- a/src/uni-exiv2.cpp ++++ b/src/uni-exiv2.cpp +@@ -22,12 +22,21 @@ + + #include + #include ++#include + + #include "uni-exiv2.hpp" + ++#if EXIV2_TEST_VERSION(0,28,0) ++ typedef Exiv2::Error Exiv2Error; ++ typedef Exiv2::Image::UniquePtr ImagePtr; ++#else ++ typedef Exiv2::AnyError Exiv2Error; ++ typedef Exiv2::Image::AutoPtr ImagePtr; ++#endif ++ + #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0])) + +-static Exiv2::Image::AutoPtr cached_image; ++static ImagePtr cached_image; + + extern "C" + void +@@ -35,7 +44,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(const char*, const char*, v + { + Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute); + try { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); ++ ImagePtr image = Exiv2::ImageFactory::open(uri); + if ( image.get() == 0 ) { + return; + } +@@ -80,7 +89,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(const char*, const char*, v + } + } + } +- } catch (Exiv2::AnyError& e) { ++ } catch (Exiv2Error& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + } +@@ -103,7 +112,7 @@ uni_read_exiv2_to_cache(const char *uri) + } + + cached_image->readMetadata(); +- } catch (Exiv2::AnyError& e) { ++ } catch (Exiv2Error& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + +@@ -121,7 +130,7 @@ uni_write_exiv2_from_cache(const char *uri) + } + + try { +- Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri); ++ ImagePtr image = Exiv2::ImageFactory::open(uri); + if ( image.get() == 0 ) { + return 2; + } +@@ -133,7 +142,7 @@ uni_write_exiv2_from_cache(const char *uri) + cached_image.reset(NULL); + + return 0; +- } catch (Exiv2::AnyError& e) { ++ } catch (Exiv2Error& e) { + std::cerr << "Exiv2: '" << e << "'\n"; + } + +-- +2.41.0 + diff --git a/viewnior.spec b/viewnior.spec index 37e039d..1432277 100644 --- a/viewnior.spec +++ b/viewnior.spec @@ -3,9 +3,10 @@ Version: 1.8 Release: %autorelease Summary: Elegant image viewer -License: GPLv3+ +License: GPL-3.0-or-later URL: http://siyanpanayotov.com/project/viewnior/ -Source0: https://github.com/hellosiyan/Viewnior/archive/%{name}-%{version}.tar.gz +Source: https://github.com/hellosiyan/Viewnior/archive/%{name}-%{version}.tar.gz +Patch: 0001-Fix-build-with-exiv2-0.28.0-raise-minimum-to-0.27.0.patch BuildRequires: pkgconfig(gtk+-2.0) >= 2.20 BuildRequires: pkgconfig(glib-2.0) >= 2.32