Fri Aug 4 13:11:24 2023 UTC ()
gimp-ufraw: Adapt to newer glib and exiv2

  - patch ufraw for newer error and pointer (AutoPtr to UniquePtr) types
  - avoid extern C around glib includes
  - don't force --std=c++03, because exiv2 fails with that


(gdt)
diff -r1.138 -r1.139 pkgsrc/graphics/gimp-ufraw/Makefile
diff -r1.40 -r1.41 pkgsrc/graphics/gimp-ufraw/distinfo
diff -r0 -r1.1 pkgsrc/graphics/gimp-ufraw/patches/patch-uf__glib.h
diff -r1.1 -r1.2 pkgsrc/graphics/gimp-ufraw/patches/patch-ufraw__exiv2.cc

cvs diff -r1.138 -r1.139 pkgsrc/graphics/gimp-ufraw/Makefile (expand / switch to context diff)
--- pkgsrc/graphics/gimp-ufraw/Makefile 2023/07/01 22:16:36 1.138
+++ pkgsrc/graphics/gimp-ufraw/Makefile 2023/08/04 13:11:24 1.139
@@ -1,12 +1,8 @@
-# $NetBSD: Makefile,v 1.138 2023/07/01 22:16:36 wiz Exp $
+# $NetBSD: Makefile,v 1.139 2023/08/04 13:11:24 gdt Exp $
 
-# Note that upstream has replaced tarballs without changing the
-# version number (e.g., 0.19.2 had two different tarballs).
-# Therefore, it is suggested to wait a week after a release before
-# updating pkgsrc.
 DISTNAME=		ufraw-0.22
 PKGNAME=		gimp-${DISTNAME}
-PKGREVISION=		34
+PKGREVISION=		35
 CATEGORIES=		graphics
 MASTER_SITES=		${MASTER_SITE_SOURCEFORGE:=ufraw/}
 
@@ -22,7 +18,12 @@
 
 USE_TOOLS+=		gmake pkg-config msgfmt
 USE_TOOLS+=		perl:run pod2man
-USE_LANGUAGES=		c99 c++03
+USE_LANGUAGES=		c99 c++
+
+# exiv2 is declared to need filesystem, but as of 2023-08 it fails if
+# called with --std=c++03.  We avoid forcing std.  (pkgsrc lacks a
+# mechanism to declare which --stds are acceptable and thus exiv2
+# doesn't declare this.)
 
 CONFIGURE_ARGS+=	--enable-mime
 

cvs diff -r1.40 -r1.41 pkgsrc/graphics/gimp-ufraw/distinfo (expand / switch to context diff)
--- pkgsrc/graphics/gimp-ufraw/distinfo 2023/05/13 11:55:55 1.40
+++ pkgsrc/graphics/gimp-ufraw/distinfo 2023/08/04 13:11:24 1.41
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.40 2023/05/13 11:55:55 gdt Exp $
+$NetBSD: distinfo,v 1.41 2023/08/04 13:11:24 gdt Exp $
 
 BLAKE2s (ufraw-0.22.tar.gz) = 37f6aa87db1a0ccb0497364a8bf40eaf17cf0082b617b8603b74a8e7bc791cf2
 SHA512 (ufraw-0.22.tar.gz) = a42eff5052c18afec90245cf97ceeade78e3f288186cf697ac4abf2e8290d4081db8ac4de3ae47b3774f30a6cb4cbda392099e6fd2125fe751abb40d9b065ad2
@@ -6,4 +6,5 @@
 SHA1 (patch-dcraw.cc) = 5e9ff01930802b2f92ce28030313c60ef24e1897
 SHA1 (patch-dcraw__api.cc) = 96220c6cca793684122839310883c5d5754916f4
 SHA1 (patch-dcraw__indi.c) = 48415d0d0e00f6652cb745e4f7a86ce71ed82739
-SHA1 (patch-ufraw__exiv2.cc) = c6f3c6bd9ec8cdc3dee1801f9b1972bbe827cd8d
+SHA1 (patch-uf__glib.h) = 522210acde32e1b363f5049628db80f97ff02f7a
+SHA1 (patch-ufraw__exiv2.cc) = cd0d6bd55672393650ecc327566ad27259b58197

File Added: pkgsrc/graphics/gimp-ufraw/patches/patch-uf__glib.h
$NetBSD: patch-uf__glib.h,v 1.1 2023/08/04 13:11:24 gdt Exp $

Avoid extern C around glib includes.  Apparently they do C++ things
when compiled in C++ mode and this causes gcc10 to complain.

Not sent upstream because upstream does not seem to be maintaining
this.

--- uf_glib.h.orig	2015-06-16 03:58:38.000000000 +0000
+++ uf_glib.h
@@ -13,13 +13,13 @@
 #ifndef _UF_GLIB_H
 #define _UF_GLIB_H
 
+#include <glib.h>
+#include <glib/gstdio.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <glib.h>
-#include <glib/gstdio.h>
-
 // g_win32_locale_filename_from_utf8 is needed only on win32
 #ifdef _WIN32
 #define uf_win32_locale_filename_from_utf8(__some_string__) \

cvs diff -r1.1 -r1.2 pkgsrc/graphics/gimp-ufraw/patches/patch-ufraw__exiv2.cc (expand / switch to context diff)
--- pkgsrc/graphics/gimp-ufraw/patches/patch-ufraw__exiv2.cc 2019/08/20 14:31:03 1.1
+++ pkgsrc/graphics/gimp-ufraw/patches/patch-ufraw__exiv2.cc 2023/08/04 13:11:24 1.2
@@ -1,9 +1,15 @@
-$NetBSD: patch-ufraw__exiv2.cc,v 1.1 2019/08/20 14:31:03 gdt Exp $
+$NetBSD: patch-ufraw__exiv2.cc,v 1.2 2023/08/04 13:11:24 gdt Exp $
 
-Adjust to newer exiv2.
+Adjust to newer exiv2:
+  - Change AutoPtr to UniquePtr.
+  - Increase specificity of thrown errors.
+  - Adapt from AnyError to the Error class.
+  - value() now has fixed-width accessors, and not toLong
 
-Not yet sent upstream.
+Not sent upstream because upstream does not seem to be maintaining
+this.
 
+
 --- ufraw_exiv2.cc.orig	2015-06-16 03:58:38.000000000 +0000
 +++ ufraw_exiv2.cc
 @@ -17,7 +17,9 @@
@@ -16,12 +22,68 @@
  #include <sstream>
  #include <cassert>
  
+@@ -51,7 +53,7 @@ extern "C" int ufraw_exif_read_input(ufr
+         uf->inputExifBuf = NULL;
+         uf->inputExifBufLen = 0;
+ 
+-        Exiv2::Image::AutoPtr image;
++        Exiv2::Image::UniquePtr image;
+         if (uf->unzippedBuf != NULL) {
+             image = Exiv2::ImageFactory::open(
+                         (const Exiv2::byte*)uf->unzippedBuf, uf->unzippedBufLen);
 @@ -67,7 +69,7 @@ extern "C" int ufraw_exif_read_input(ufr
          if (exifData.empty()) {
              std::string error(uf->filename);
              error += ": No Exif data found in the file";
 -            throw Exiv2::Error(1, error);
-+            throw Exiv2::Error(Exiv2::kerGeneralError, error);
++            throw Exiv2::Error(Exiv2::ErrorCode::kerGeneralError, error);
          }
  
          /* List of tag names taken from exiv2's printSummary() in actions.cpp */
+@@ -132,7 +134,7 @@ extern "C" int ufraw_exif_read_input(ufr
+         ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
+ 
+         return UFRAW_SUCCESS;
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr.rdbuf(savecerr);
+         std::string s(e.what());
+         ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());
+@@ -152,8 +154,8 @@ static Exiv2::ExifData ufraw_prepare_exi
+         /* Reset orientation tag since UFRaw already rotates the image */
+         if ((pos = exifData.findKey(Exiv2::ExifKey("Exif.Image.Orientation")))
+                 != exifData.end()) {
+-            ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%d' to '1'\n",
+-                          pos->key().c_str(), pos->value().toLong());
++            ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%" PRId64 "' to '1'\n",
++                          pos->key().c_str(), pos->value().toInt64());
+             pos->setValue("1"); /* 1 = Normal orientation */
+         }
+     }
+@@ -324,7 +326,7 @@ extern "C" int ufraw_exif_prepare_output
+         ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
+ 
+         return UFRAW_SUCCESS;
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr.rdbuf(savecerr);
+         std::string s(e.what());
+         ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());
+@@ -344,7 +346,7 @@ extern "C" int ufraw_exif_write(ufraw_da
+ 
+         char *filename =
+             uf_win32_locale_filename_from_utf8(uf->conf->outputFilename);
+-        Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
++        Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename);
+         uf_win32_locale_filename_free(filename);
+         assert(image.get() != 0);
+ 
+@@ -364,7 +366,7 @@ extern "C" int ufraw_exif_write(ufraw_da
+         ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str());
+ 
+         return UFRAW_SUCCESS;
+-    } catch (Exiv2::AnyError& e) {
++    } catch (Exiv2::Error& e) {
+         std::cerr.rdbuf(savecerr);
+         std::string s(e.what());
+         ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str());