pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/graphics/viewnior



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Jul 19 07:53:38 UTC 2023

Modified Files:
        pkgsrc/graphics/viewnior: Makefile distinfo
Added Files:
        pkgsrc/graphics/viewnior/patches: patch-src_uni-exiv2.cpp

Log Message:
viewnior: fix build with exiv2 0.28


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 pkgsrc/graphics/viewnior/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/graphics/viewnior/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/graphics/viewnior/patches/patch-src_uni-exiv2.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/graphics/viewnior/Makefile
diff -u pkgsrc/graphics/viewnior/Makefile:1.41 pkgsrc/graphics/viewnior/Makefile:1.42
--- pkgsrc/graphics/viewnior/Makefile:1.41      Sat Jul  1 22:16:38 2023
+++ pkgsrc/graphics/viewnior/Makefile   Wed Jul 19 07:53:37 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2023/07/01 22:16:38 wiz Exp $
+# $NetBSD: Makefile,v 1.42 2023/07/19 07:53:37 wiz Exp $
 
 DISTNAME=      viewnior-1.7
 PKGREVISION=   6
@@ -9,7 +9,7 @@ GITHUB_TAG=     ${DISTNAME}
 
 MAINTAINER=    ryoon%NetBSD.org@localhost
 HOMEPAGE=      http://siyanpanayotov.com/project/viewnior
-COMMENT=       Viewnior is a fast and simple image viewer
+COMMENT=       Fast and simple image viewer
 LICENSE=       gnu-gpl-v3
 
 WRKSRC=                ${WRKDIR}/Viewnior-${DISTNAME}
@@ -24,6 +24,7 @@ PYTHON_FOR_BUILD_ONLY=        tool
 .include "../../databases/shared-mime-info/buildlink3.mk"
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../graphics/exiv2/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
 .include "../../x11/gtk2/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/graphics/viewnior/distinfo
diff -u pkgsrc/graphics/viewnior/distinfo:1.6 pkgsrc/graphics/viewnior/distinfo:1.7
--- pkgsrc/graphics/viewnior/distinfo:1.6       Tue Oct 26 10:47:22 2021
+++ pkgsrc/graphics/viewnior/distinfo   Wed Jul 19 07:53:37 2023
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.6 2021/10/26 10:47:22 nia Exp $
+$NetBSD: distinfo,v 1.7 2023/07/19 07:53:37 wiz Exp $
 
 BLAKE2s (viewnior-1.7.tar.gz) = 0c04f7c700d7f6b76465a0e49322ddbfd9c5e48f46062e439a20179e8c729cd3
 SHA512 (viewnior-1.7.tar.gz) = 5ba17d7b5ceeffa65b04213f179c1439b09ac44e412e0750dde159b118a714f28d3a290509a402b234e4e7ba5b185fc73eef65d418598f344911e4e2c1373fe5
 Size (viewnior-1.7.tar.gz) = 165719 bytes
+SHA1 (patch-src_uni-exiv2.cpp) = e5a02ccce78ecc6e79fd249b0beb8d089e9f90fa

Added files:

Index: pkgsrc/graphics/viewnior/patches/patch-src_uni-exiv2.cpp
diff -u /dev/null pkgsrc/graphics/viewnior/patches/patch-src_uni-exiv2.cpp:1.1
--- /dev/null   Wed Jul 19 07:53:38 2023
+++ pkgsrc/graphics/viewnior/patches/patch-src_uni-exiv2.cpp    Wed Jul 19 07:53:38 2023
@@ -0,0 +1,107 @@
+$NetBSD: patch-src_uni-exiv2.cpp,v 1.1 2023/07/19 07:53:38 wiz Exp $
+
+Fix build with exiv2 0.28.
+https://github.com/hellosiyan/Viewnior/pull/130
+
+--- src/uni-exiv2.cpp.orig     2018-05-13 09:40:40.000000000 +0000
++++ src/uni-exiv2.cpp
+@@ -22,10 +22,20 @@
+ 
+ #include <exiv2/exiv2.hpp>
+ #include <iostream>
++#include <memory>
+ 
+ #include "uni-exiv2.hpp"
+ 
+-static Exiv2::Image::AutoPtr cached_image;
++#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"
+ void 
+@@ -47,8 +57,8 @@ uni_read_exiv2_map(const char *uri, void
+ {
+     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,7 +101,7 @@ uni_read_exiv2_map(const char *uri, void
+                 }
+             }
+         }
+-    } catch (Exiv2::AnyError& e) {
++    } catch (EXIV_ERROR& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+ }
+@@ -102,19 +112,19 @@ 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;
+         }
+ 
+         cached_image->readMetadata();
+-    } catch (Exiv2::AnyError& e) {
++    } catch (EXIV_ERROR& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+ 
+@@ -127,13 +137,13 @@ uni_write_exiv2_from_cache(const char *u
+ {
+     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;
+         }
+ 
+@@ -141,12 +151,12 @@ uni_write_exiv2_from_cache(const char *u
+         image->writeMetadata();
+         
+         cached_image->clearMetadata();
+-        cached_image.reset(NULL);
++        cached_image.reset(nullptr);
+ 
+         return 0;
+-    } catch (Exiv2::AnyError& e) {
++    } catch (EXIV_ERROR& e) {
+         std::cerr << "Exiv2: '" << e << "'\n";
+     }
+ 
+     return 0;
+-}
+\ No newline at end of file
++}



Home | Main Index | Thread Index | Old Index