Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package viewnior for openSUSE:Factory 
checked in at 2023-07-26 13:23:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/viewnior (Old)
 and      /work/SRC/openSUSE:Factory/.viewnior.new.15225 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "viewnior"

Wed Jul 26 13:23:47 2023 rev:18 rq:1100577 version:1.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/viewnior/viewnior.changes        2022-04-22 
21:56:22.350950819 +0200
+++ /work/SRC/openSUSE:Factory/.viewnior.new.15225/viewnior.changes     
2023-07-26 13:24:49.012315753 +0200
@@ -1,0 +2,7 @@
+Mon Jul 24 15:31:42 UTC 2023 - Christophe Marin <christo...@krop.fr>
+
+- Add patch to fix build failures with Exiv 0.28:
+  * 0001-change-exiv2-AutoPtr-to-unique_ptr.patch
+  * 0002-add-support-for-exiv-0.28.0-errors.patch
+
+-------------------------------------------------------------------

New:
----
  0001-change-exiv2-AutoPtr-to-unique_ptr.patch
  0002-add-support-for-exiv-0.28.0-errors.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ viewnior.spec ++++++
--- /var/tmp/diff_new_pack.6ACDfS/_old  2023-07-26 13:24:49.928321281 +0200
+++ /var/tmp/diff_new_pack.6ACDfS/_new  2023-07-26 13:24:49.932321305 +0200
@@ -24,6 +24,9 @@
 Group:          Productivity/Graphics/Viewers
 URL:            http://siyanpanayotov.com/project/viewnior/
 Source0:        
https://github.com/hellosiyan/Viewnior/archive/%{name}-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM -- Exiv 0.28 support - 
https://github.com/hellosiyan/Viewnior/pull/130
+Patch0:         0001-change-exiv2-AutoPtr-to-unique_ptr.patch
+Patch1:         0002-add-support-for-exiv-0.28.0-errors.patch
 BuildRequires:  gcc-c++
 BuildRequires:  meson >= 0.43.0
 BuildRequires:  ninja
@@ -31,7 +34,6 @@
 BuildRequires:  update-desktop-files
 BuildRequires:  pkgconfig(exiv2)
 BuildRequires:  pkgconfig(gtk+-2.0)
-Recommends:     %{name}-lang
 
 %description
 Viewnior is an image viewer program with a minimal interface.
@@ -48,7 +50,7 @@
 %lang_package
 
 %prep
-%setup -q -n Viewnior-%{name}-%{version}
+%autosetup -p1 -n Viewnior-%{name}-%{version}
 # fix spurious executable perms
 chmod 0644 AUTHORS COPYING NEWS src/* data/icons/scalable/apps/viewnior.svg
 
@@ -61,16 +63,6 @@
 %find_lang %{name} %{?no_lang_C}
 %suse_update_desktop_file -r -G "Elegant Image Viewer" %{name} Graphics Viewer 
GTK
 
-%if 0%{?suse_version} && 0%{?suse_version} < 1500
-%post
-%desktop_database_post
-%icon_theme_cache_post
-
-%postun
-%desktop_database_postun
-%icon_theme_cache_postun
-%endif
-
 %files
 %license COPYING
 %doc AUTHORS NEWS README.md TODO

++++++ 0001-change-exiv2-AutoPtr-to-unique_ptr.patch ++++++
>From b7f90fedb8778d659c5e083cc06ee9ca9e0fd323 Mon Sep 17 00:00:00 2001
From: tastytea <tasty...@tastytea.de>
Date: Tue, 16 May 2023 10:54:40 +0200
Subject: [PATCH 1/2] change exiv2 AutoPtr to unique_ptr

exiv2-0.28.0 removed Exiv2::Image::AutoPtr and added
Exiv2::Image::UniquePtr instead. since it's a typedef for
std::unique_ptr<Image>, i'm using that directly instead of adding a
condition on the exiv2 version.
---
 src/uni-exiv2.cpp | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/uni-exiv2.cpp b/src/uni-exiv2.cpp
index 0d14b9f..77064c2 100644
--- a/src/uni-exiv2.cpp
+++ b/src/uni-exiv2.cpp
@@ -22,12 +22,13 @@
 
 #include <exiv2/exiv2.hpp>
 #include <iostream>
+#include <memory>
 
 #include "uni-exiv2.hpp"
 
 #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0]))
 
-static Exiv2::Image::AutoPtr cached_image;
+static std::unique_ptr<Exiv2::Image> cached_image;
 
 extern "C"
 void
@@ -35,8 +36,8 @@ 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);
-        if ( image.get() == 0 ) {
+        std::unique_ptr<Exiv2::Image> image = Exiv2::ImageFactory::open(uri);
+        if (image == nullptr) {
             return;
         }
 
@@ -91,14 +92,14 @@ uni_read_exiv2_to_cache(const char *uri)
 {
     Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
 
-    if ( cached_image.get() != NULL ) {
+    if (cached_image != nullptr) {
         cached_image->clearMetadata();
-        cached_image.reset(NULL);
+        cached_image.reset(nullptr);
     }
 
     try {
         cached_image = Exiv2::ImageFactory::open(uri);
-        if ( cached_image.get() == 0 ) {
+        if (cached_image == nullptr) {
             return 1;
         }
 
@@ -116,13 +117,13 @@ uni_write_exiv2_from_cache(const char *uri)
 {
     Exiv2::LogMsg::setLevel(Exiv2::LogMsg::mute);
 
-    if ( cached_image.get() == NULL ) {
+    if (cached_image == nullptr) {
         return 1;
     }
 
     try {
-        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(uri);
-        if ( image.get() == 0 ) {
+        std::unique_ptr<Exiv2::Image> image = Exiv2::ImageFactory::open(uri);
+        if (image == nullptr) {
             return 2;
         }
 
@@ -130,7 +131,7 @@ uni_write_exiv2_from_cache(const char *uri)
         image->writeMetadata();
 
         cached_image->clearMetadata();
-        cached_image.reset(NULL);
+        cached_image.reset(nullptr);
 
         return 0;
     } catch (Exiv2::AnyError& e) {
-- 
2.41.0


++++++ 0002-add-support-for-exiv-0.28.0-errors.patch ++++++
>From e75487ceb0b4e53ea10b6c1682728b603b4ccca1 Mon Sep 17 00:00:00 2001
From: tastytea <tasty...@tastytea.de>
Date: Tue, 16 May 2023 11:17:00 +0200
Subject: [PATCH 2/2] add support for exiv-0.28.0 errors

exiv2-0.28.0 changed Exiv2::AnyError to Exiv2::Error.
---
 src/uni-exiv2.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/uni-exiv2.cpp b/src/uni-exiv2.cpp
index 77064c2..567a50f 100644
--- a/src/uni-exiv2.cpp
+++ b/src/uni-exiv2.cpp
@@ -28,6 +28,15 @@
 
 #define ARRAY_SIZE(array) (sizeof array/sizeof(array[0]))
 
+#define EXIV_ERROR Exiv2::AnyError
+#ifdef EXIV2_VERSION
+    #ifdef EXIV2_TEST_VERSION
+        #if EXIV2_TEST_VERSION(0,28,0)
+            #define EXIV_ERROR Exiv2::Error
+        #endif
+    #endif
+#endif
+
 static std::unique_ptr<Exiv2::Image> cached_image;
 
 extern "C"
@@ -81,7 +90,7 @@ uni_read_exiv2_map(const char *uri, void (*callback)(const 
char*, const char*, v
                 }
             }
         }
-    } catch (Exiv2::AnyError& e) {
+    } catch (EXIV_ERROR& e) {
         std::cerr << "Exiv2: '" << e << "'\n";
     }
 }
@@ -104,7 +113,7 @@ uni_read_exiv2_to_cache(const char *uri)
         }
 
         cached_image->readMetadata();
-    } catch (Exiv2::AnyError& e) {
+    } catch (EXIV_ERROR& e) {
         std::cerr << "Exiv2: '" << e << "'\n";
     }
 
@@ -134,7 +143,7 @@ uni_write_exiv2_from_cache(const char *uri)
         cached_image.reset(nullptr);
 
         return 0;
-    } catch (Exiv2::AnyError& e) {
+    } catch (EXIV_ERROR& e) {
         std::cerr << "Exiv2: '" << e << "'\n";
     }
 
-- 
2.41.0

Reply via email to