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 thatdiff -r1.138 -r1.139 pkgsrc/graphics/gimp-ufraw/Makefile
(gdt)
@@ -1,38 +1,39 @@ | @@ -1,38 +1,39 @@ | |||
1 | # $NetBSD: Makefile,v 1.138 2023/07/01 22:16:36 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.139 2023/08/04 13:11:24 gdt Exp $ | |
2 | 2 | |||
3 | # Note that upstream has replaced tarballs without changing the | |||
4 | # version number (e.g., 0.19.2 had two different tarballs). | |||
5 | # Therefore, it is suggested to wait a week after a release before | |||
6 | # updating pkgsrc. | |||
7 | DISTNAME= ufraw-0.22 | 3 | DISTNAME= ufraw-0.22 | |
8 | PKGNAME= gimp-${DISTNAME} | 4 | PKGNAME= gimp-${DISTNAME} | |
9 | PKGREVISION= 34 | 5 | PKGREVISION= 35 | |
10 | CATEGORIES= graphics | 6 | CATEGORIES= graphics | |
11 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ufraw/} | 7 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ufraw/} | |
12 | 8 | |||
13 | # There have been issues with unstable OPENMP APIs. Therefore, | 9 | # There have been issues with unstable OPENMP APIs. Therefore, | |
14 | # updates must be tested on NetBSD 9 with gcc. | 10 | # updates must be tested on NetBSD 9 with gcc. | |
15 | MAINTAINER= gdt@NetBSD.org | 11 | MAINTAINER= gdt@NetBSD.org | |
16 | HOMEPAGE= http://ufraw.sourceforge.net/ | 12 | HOMEPAGE= http://ufraw.sourceforge.net/ | |
17 | COMMENT= GIMP plug-in for raw digicam import | 13 | COMMENT= GIMP plug-in for raw digicam import | |
18 | 14 | |||
19 | LICENSE= gnu-gpl-v2 | 15 | LICENSE= gnu-gpl-v2 | |
20 | 16 | |||
21 | GNU_CONFIGURE= yes | 17 | GNU_CONFIGURE= yes | |
22 | 18 | |||
23 | USE_TOOLS+= gmake pkg-config msgfmt | 19 | USE_TOOLS+= gmake pkg-config msgfmt | |
24 | USE_TOOLS+= perl:run pod2man | 20 | USE_TOOLS+= perl:run pod2man | |
25 | USE_LANGUAGES= c99 c++03 | 21 | USE_LANGUAGES= c99 c++ | |
22 | ||||
23 | # exiv2 is declared to need filesystem, but as of 2023-08 it fails if | |||
24 | # called with --std=c++03. We avoid forcing std. (pkgsrc lacks a | |||
25 | # mechanism to declare which --stds are acceptable and thus exiv2 | |||
26 | # doesn't declare this.) | |||
26 | 27 | |||
27 | CONFIGURE_ARGS+= --enable-mime | 28 | CONFIGURE_ARGS+= --enable-mime | |
28 | 29 | |||
29 | GCONF_SCHEMAS= ufraw.schemas | 30 | GCONF_SCHEMAS= ufraw.schemas | |
30 | 31 | |||
31 | PTHREAD_AUTO_VARS= yes | 32 | PTHREAD_AUTO_VARS= yes | |
32 | 33 | |||
33 | PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw | 34 | PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw | |
34 | PKG_SUPPORTED_OPTIONS= lensfun | 35 | PKG_SUPPORTED_OPTIONS= lensfun | |
35 | PKG_SUGGESTED_OPTIONS= lensfun | 36 | PKG_SUGGESTED_OPTIONS= lensfun | |
36 | .include "../../mk/bsd.options.mk" | 37 | .include "../../mk/bsd.options.mk" | |
37 | .if !empty(PKG_OPTIONS:Mlensfun) | 38 | .if !empty(PKG_OPTIONS:Mlensfun) | |
38 | .include "../../graphics/lensfun/buildlink3.mk" | 39 | .include "../../graphics/lensfun/buildlink3.mk" |
@@ -1,9 +1,10 @@ | @@ -1,9 +1,10 @@ | |||
1 | $NetBSD: distinfo,v 1.40 2023/05/13 11:55:55 gdt Exp $ | 1 | $NetBSD: distinfo,v 1.41 2023/08/04 13:11:24 gdt Exp $ | |
2 | 2 | |||
3 | BLAKE2s (ufraw-0.22.tar.gz) = 37f6aa87db1a0ccb0497364a8bf40eaf17cf0082b617b8603b74a8e7bc791cf2 | 3 | BLAKE2s (ufraw-0.22.tar.gz) = 37f6aa87db1a0ccb0497364a8bf40eaf17cf0082b617b8603b74a8e7bc791cf2 | |
4 | SHA512 (ufraw-0.22.tar.gz) = a42eff5052c18afec90245cf97ceeade78e3f288186cf697ac4abf2e8290d4081db8ac4de3ae47b3774f30a6cb4cbda392099e6fd2125fe751abb40d9b065ad2 | 4 | SHA512 (ufraw-0.22.tar.gz) = a42eff5052c18afec90245cf97ceeade78e3f288186cf697ac4abf2e8290d4081db8ac4de3ae47b3774f30a6cb4cbda392099e6fd2125fe751abb40d9b065ad2 | |
5 | Size (ufraw-0.22.tar.gz) = 1103554 bytes | 5 | Size (ufraw-0.22.tar.gz) = 1103554 bytes | |
6 | SHA1 (patch-dcraw.cc) = 5e9ff01930802b2f92ce28030313c60ef24e1897 | 6 | SHA1 (patch-dcraw.cc) = 5e9ff01930802b2f92ce28030313c60ef24e1897 | |
7 | SHA1 (patch-dcraw__api.cc) = 96220c6cca793684122839310883c5d5754916f4 | 7 | SHA1 (patch-dcraw__api.cc) = 96220c6cca793684122839310883c5d5754916f4 | |
8 | SHA1 (patch-dcraw__indi.c) = 48415d0d0e00f6652cb745e4f7a86ce71ed82739 | 8 | SHA1 (patch-dcraw__indi.c) = 48415d0d0e00f6652cb745e4f7a86ce71ed82739 | |
9 | SHA1 (patch-ufraw__exiv2.cc) = c6f3c6bd9ec8cdc3dee1801f9b1972bbe827cd8d | 9 | SHA1 (patch-uf__glib.h) = 522210acde32e1b363f5049628db80f97ff02f7a | |
10 | SHA1 (patch-ufraw__exiv2.cc) = cd0d6bd55672393650ecc327566ad27259b58197 |
$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__) \
@@ -1,27 +1,89 @@ | @@ -1,27 +1,89 @@ | |||
1 | $NetBSD: patch-ufraw__exiv2.cc,v 1.1 2019/08/20 14:31:03 gdt Exp $ | 1 | $NetBSD: patch-ufraw__exiv2.cc,v 1.2 2023/08/04 13:11:24 gdt Exp $ | |
2 | 2 | |||
3 | Adjust to newer exiv2. | 3 | Adjust to newer exiv2: | |
4 | - Change AutoPtr to UniquePtr. | |||
5 | - Increase specificity of thrown errors. | |||
6 | - Adapt from AnyError to the Error class. | |||
7 | - value() now has fixed-width accessors, and not toLong | |||
8 | ||||
9 | Not sent upstream because upstream does not seem to be maintaining | |||
10 | this. | |||
4 | 11 | |||
5 | Not yet sent upstream. | |||
6 | 12 | |||
7 | --- ufraw_exiv2.cc.orig 2015-06-16 03:58:38.000000000 +0000 | 13 | --- ufraw_exiv2.cc.orig 2015-06-16 03:58:38.000000000 +0000 | |
8 | +++ ufraw_exiv2.cc | 14 | +++ ufraw_exiv2.cc | |
9 | @@ -17,7 +17,9 @@ | 15 | @@ -17,7 +17,9 @@ | |
10 | #ifdef HAVE_EXIV2 | 16 | #ifdef HAVE_EXIV2 | |
11 | #include <exiv2/image.hpp> | 17 | #include <exiv2/image.hpp> | |
12 | #include <exiv2/easyaccess.hpp> | 18 | #include <exiv2/easyaccess.hpp> | |
13 | +#include <exiv2/error.hpp> | 19 | +#include <exiv2/error.hpp> | |
14 | #include <exiv2/exif.hpp> | 20 | #include <exiv2/exif.hpp> | |
15 | +#include <iostream> | 21 | +#include <iostream> | |
16 | #include <sstream> | 22 | #include <sstream> | |
17 | #include <cassert> | 23 | #include <cassert> | |
18 | 24 | |||
25 | @@ -51,7 +53,7 @@ extern "C" int ufraw_exif_read_input(ufr | |||
26 | uf->inputExifBuf = NULL; | |||
27 | uf->inputExifBufLen = 0; | |||
28 | ||||
29 | - Exiv2::Image::AutoPtr image; | |||
30 | + Exiv2::Image::UniquePtr image; | |||
31 | if (uf->unzippedBuf != NULL) { | |||
32 | image = Exiv2::ImageFactory::open( | |||
33 | (const Exiv2::byte*)uf->unzippedBuf, uf->unzippedBufLen); | |||
19 | @@ -67,7 +69,7 @@ extern "C" int ufraw_exif_read_input(ufr | 34 | @@ -67,7 +69,7 @@ extern "C" int ufraw_exif_read_input(ufr | |
20 | if (exifData.empty()) { | 35 | if (exifData.empty()) { | |
21 | std::string error(uf->filename); | 36 | std::string error(uf->filename); | |
22 | error += ": No Exif data found in the file"; | 37 | error += ": No Exif data found in the file"; | |
23 | - throw Exiv2::Error(1, error); | 38 | - throw Exiv2::Error(1, error); | |
24 | + throw Exiv2::Error(Exiv2::kerGeneralError, error); | 39 | + throw Exiv2::Error(Exiv2::ErrorCode::kerGeneralError, error); | |
25 | } | 40 | } | |
26 | 41 | |||
27 | /* List of tag names taken from exiv2's printSummary() in actions.cpp */ | 42 | /* List of tag names taken from exiv2's printSummary() in actions.cpp */ | |
43 | @@ -132,7 +134,7 @@ extern "C" int ufraw_exif_read_input(ufr | |||
44 | ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); | |||
45 | ||||
46 | return UFRAW_SUCCESS; | |||
47 | - } catch (Exiv2::AnyError& e) { | |||
48 | + } catch (Exiv2::Error& e) { | |||
49 | std::cerr.rdbuf(savecerr); | |||
50 | std::string s(e.what()); | |||
51 | ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); | |||
52 | @@ -152,8 +154,8 @@ static Exiv2::ExifData ufraw_prepare_exi | |||
53 | /* Reset orientation tag since UFRaw already rotates the image */ | |||
54 | if ((pos = exifData.findKey(Exiv2::ExifKey("Exif.Image.Orientation"))) | |||
55 | != exifData.end()) { | |||
56 | - ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%d' to '1'\n", | |||
57 | - pos->key().c_str(), pos->value().toLong()); | |||
58 | + ufraw_message(UFRAW_SET_LOG, "Resetting %s from '%" PRId64 "' to '1'\n", | |||
59 | + pos->key().c_str(), pos->value().toInt64()); | |||
60 | pos->setValue("1"); /* 1 = Normal orientation */ | |||
61 | } | |||
62 | } | |||
63 | @@ -324,7 +326,7 @@ extern "C" int ufraw_exif_prepare_output | |||
64 | ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); | |||
65 | ||||
66 | return UFRAW_SUCCESS; | |||
67 | - } catch (Exiv2::AnyError& e) { | |||
68 | + } catch (Exiv2::Error& e) { | |||
69 | std::cerr.rdbuf(savecerr); | |||
70 | std::string s(e.what()); | |||
71 | ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); | |||
72 | @@ -344,7 +346,7 @@ extern "C" int ufraw_exif_write(ufraw_da | |||
73 | ||||
74 | char *filename = | |||
75 | uf_win32_locale_filename_from_utf8(uf->conf->outputFilename); | |||
76 | - Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename); | |||
77 | + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(filename); | |||
78 | uf_win32_locale_filename_free(filename); | |||
79 | assert(image.get() != 0); | |||
80 | ||||
81 | @@ -364,7 +366,7 @@ extern "C" int ufraw_exif_write(ufraw_da | |||
82 | ufraw_message(UFRAW_SET_LOG, "%s\n", stderror.str().c_str()); | |||
83 | ||||
84 | return UFRAW_SUCCESS; | |||
85 | - } catch (Exiv2::AnyError& e) { | |||
86 | + } catch (Exiv2::Error& e) { | |||
87 | std::cerr.rdbuf(savecerr); | |||
88 | std::string s(e.what()); | |||
89 | ufraw_message(UFRAW_SET_WARNING, "%s\n", s.c_str()); |