Sat May 13 11:55:55 2023 UTC ()
graphics/gimp-ufraw: Work around C++/stdint interactions

ufraw includes jasper headers from a C++ file, and jasper relies in
int_limit.h defines.  But NetBSD only defines the macros in C mode, or
in C++>=C11.  Ask for the defines explicitly.

Set ufraw to C99, and gc support for gcc before 3.


(gdt)
diff -r1.135 -r1.136 pkgsrc/graphics/gimp-ufraw/Makefile
diff -r1.39 -r1.40 pkgsrc/graphics/gimp-ufraw/distinfo
diff -r1.2 -r1.3 pkgsrc/graphics/gimp-ufraw/patches/patch-dcraw.cc

cvs diff -r1.135 -r1.136 pkgsrc/graphics/gimp-ufraw/Makefile (expand / switch to unified diff)

--- pkgsrc/graphics/gimp-ufraw/Makefile 2023/04/19 08:10:19 1.135
+++ pkgsrc/graphics/gimp-ufraw/Makefile 2023/05/13 11:55:55 1.136
@@ -1,49 +1,45 @@ @@ -1,49 +1,45 @@
1# $NetBSD: Makefile,v 1.135 2023/04/19 08:10:19 adam Exp $ 1# $NetBSD: Makefile,v 1.136 2023/05/13 11:55:55 gdt Exp $
2 2
3# Note that upstream has replaced tarballs without changing the 3# Note that upstream has replaced tarballs without changing the
4# version number (e.g., 0.19.2 had two different tarballs). 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 5# Therefore, it is suggested to wait a week after a release before
6# updating pkgsrc. 6# updating pkgsrc.
7DISTNAME= ufraw-0.22 7DISTNAME= ufraw-0.22
8PKGNAME= gimp-${DISTNAME} 8PKGNAME= gimp-${DISTNAME}
9PKGREVISION= 31 9PKGREVISION= 32
10CATEGORIES= graphics 10CATEGORIES= graphics
11MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ufraw/} 11MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ufraw/}
12 12
13# There have been issues with unstable OPENMP APIs. Therefore, 13# There have been issues with unstable OPENMP APIs. Therefore,
14# updates must be tested on NetBSD 8 with gcc. 14# updates must be tested on NetBSD 9 with gcc.
15MAINTAINER= gdt@NetBSD.org 15MAINTAINER= gdt@NetBSD.org
16HOMEPAGE= http://ufraw.sourceforge.net/ 16HOMEPAGE= http://ufraw.sourceforge.net/
17COMMENT= GIMP plug-in for raw digicam import 17COMMENT= GIMP plug-in for raw digicam import
18 18
19LICENSE= gnu-gpl-v2 19LICENSE= gnu-gpl-v2
20 20
21GNU_CONFIGURE= yes 21GNU_CONFIGURE= yes
22 22
23USE_TOOLS+= gmake pkg-config msgfmt 23USE_TOOLS+= gmake pkg-config msgfmt
24USE_TOOLS+= perl:run pod2man 24USE_TOOLS+= perl:run pod2man
25USE_LANGUAGES= c c++03 25USE_LANGUAGES= c99 c++03
26 26
27CONFIGURE_ARGS+= --enable-mime 27CONFIGURE_ARGS+= --enable-mime
28 28
29GCONF_SCHEMAS= ufraw.schemas 29GCONF_SCHEMAS= ufraw.schemas
30 30
31PTHREAD_AUTO_VARS= yes 31PTHREAD_AUTO_VARS= yes
32 32
33# This package uses too much C99 code to be patched. 
34GCC_REQD+= 3.0 
35BUILDLINK_TRANSFORM+= rm:-std=gnu99 
36 
37PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw 33PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw
38PKG_SUPPORTED_OPTIONS= lensfun 34PKG_SUPPORTED_OPTIONS= lensfun
39PKG_SUGGESTED_OPTIONS= lensfun 35PKG_SUGGESTED_OPTIONS= lensfun
40.include "../../mk/bsd.options.mk" 36.include "../../mk/bsd.options.mk"
41.if !empty(PKG_OPTIONS:Mlensfun) 37.if !empty(PKG_OPTIONS:Mlensfun)
42.include "../../graphics/lensfun/buildlink3.mk" 38.include "../../graphics/lensfun/buildlink3.mk"
43.endif 39.endif
44 40
45.include "../../sysutils/desktop-file-utils/desktopdb.mk" 41.include "../../sysutils/desktop-file-utils/desktopdb.mk"
46.include "../../devel/GConf/schemas.mk" 42.include "../../devel/GConf/schemas.mk"
47.include "../../graphics/exiv2/buildlink3.mk" 43.include "../../graphics/exiv2/buildlink3.mk"
48.include "../../graphics/gimp/buildlink3.mk" 44.include "../../graphics/gimp/buildlink3.mk"
49.include "../../graphics/gtkimageview/buildlink3.mk" 45.include "../../graphics/gtkimageview/buildlink3.mk"

cvs diff -r1.39 -r1.40 pkgsrc/graphics/gimp-ufraw/distinfo (expand / switch to unified diff)

--- pkgsrc/graphics/gimp-ufraw/distinfo 2021/10/26 10:46:12 1.39
+++ pkgsrc/graphics/gimp-ufraw/distinfo 2023/05/13 11:55:55 1.40
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1$NetBSD: distinfo,v 1.39 2021/10/26 10:46:12 nia Exp $ 1$NetBSD: distinfo,v 1.40 2023/05/13 11:55:55 gdt Exp $
2 2
3BLAKE2s (ufraw-0.22.tar.gz) = 37f6aa87db1a0ccb0497364a8bf40eaf17cf0082b617b8603b74a8e7bc791cf2 3BLAKE2s (ufraw-0.22.tar.gz) = 37f6aa87db1a0ccb0497364a8bf40eaf17cf0082b617b8603b74a8e7bc791cf2
4SHA512 (ufraw-0.22.tar.gz) = a42eff5052c18afec90245cf97ceeade78e3f288186cf697ac4abf2e8290d4081db8ac4de3ae47b3774f30a6cb4cbda392099e6fd2125fe751abb40d9b065ad2 4SHA512 (ufraw-0.22.tar.gz) = a42eff5052c18afec90245cf97ceeade78e3f288186cf697ac4abf2e8290d4081db8ac4de3ae47b3774f30a6cb4cbda392099e6fd2125fe751abb40d9b065ad2
5Size (ufraw-0.22.tar.gz) = 1103554 bytes 5Size (ufraw-0.22.tar.gz) = 1103554 bytes
6SHA1 (patch-dcraw.cc) = 1d379ffa2624ce24b8f7e523d0dcfe7a313ec9c7 6SHA1 (patch-dcraw.cc) = 5e9ff01930802b2f92ce28030313c60ef24e1897
7SHA1 (patch-dcraw__api.cc) = 96220c6cca793684122839310883c5d5754916f4 7SHA1 (patch-dcraw__api.cc) = 96220c6cca793684122839310883c5d5754916f4
8SHA1 (patch-dcraw__indi.c) = 48415d0d0e00f6652cb745e4f7a86ce71ed82739 8SHA1 (patch-dcraw__indi.c) = 48415d0d0e00f6652cb745e4f7a86ce71ed82739
9SHA1 (patch-ufraw__exiv2.cc) = c6f3c6bd9ec8cdc3dee1801f9b1972bbe827cd8d 9SHA1 (patch-ufraw__exiv2.cc) = c6f3c6bd9ec8cdc3dee1801f9b1972bbe827cd8d

cvs diff -r1.2 -r1.3 pkgsrc/graphics/gimp-ufraw/patches/patch-dcraw.cc (expand / switch to unified diff)

--- pkgsrc/graphics/gimp-ufraw/patches/patch-dcraw.cc 2020/06/01 00:14:21 1.2
+++ pkgsrc/graphics/gimp-ufraw/patches/patch-dcraw.cc 2023/05/13 11:55:55 1.3
@@ -1,20 +1,38 @@ @@ -1,20 +1,38 @@
1$NetBSD: patch-dcraw.cc,v 1.2 2020/06/01 00:14:21 gdt Exp $ 1$NetBSD: patch-dcraw.cc,v 1.3 2023/05/13 11:55:55 gdt Exp $
2 2
3\todo Explain this patch. 3The first hunk works around the combination of:
 4 - NetBSD stdint.h/int_limit.sh not defining UINT_LEAST64_MAX in c++
 5 mode before C++11
 6 - ufraw including C headers in C++ mode
 7 - ufraw being C++03
 8by just asking for the limit macros to be defined.
4 9
5--- dcraw.cc.orig 2020-04-19 19:55:05.713900482 +0000 10\todo Explain second hunk. This seems to be about avoiding a SWAP macro
 11and is likely not very interesting.
 12
 13--- dcraw.cc.orig 2015-06-16 03:58:38.000000000 +0000
6+++ dcraw.cc 14+++ dcraw.cc
7@@ -9240,11 +9240,15 @@ canon_a5: 15@@ -24,6 +24,9 @@ extern "C" {
 16
 17 #define DCRAW_VERSION "9.26"
 18
 19+/* Obtain UINT32_LEAST_MAX even in C++ mode. */
 20+#define __STDC_LIMIT_MACROS
 21+
 22 #ifndef _GNU_SOURCE
 23 #define _GNU_SOURCE
 24 #endif
 25@@ -9240,11 +9243,15 @@ canon_a5:
8 filters = 0x16161616; 26 filters = 0x16161616;
9 } 27 }
10 if (make[0] == 'O') { 28 if (make[0] == 'O') {
11- i = find_green (12, 32, 1188864, 3576832); 29- i = find_green (12, 32, 1188864, 3576832);
12- c = find_green (12, 32, 2383920, 2387016); 30- c = find_green (12, 32, 2383920, 2387016);
13- if (abs(i) < abs(c)) { 31- if (abs(i) < abs(c)) {
14- SWAP(i,c); 32- SWAP(i,c);
15+ float i_ = find_green (12, 32, 1188864, 3576832); 33+ float i_ = find_green (12, 32, 1188864, 3576832);
16+ float c_ = find_green (12, 32, 2383920, 2387016); 34+ float c_ = find_green (12, 32, 2383920, 2387016);
17+ if (abs(i_) < abs(c_)) { 35+ if (abs(i_) < abs(c_)) {
18+ c = i_; 36+ c = i_;
19+ i = c_; 37+ i = c_;
20 load_flags = 24; 38 load_flags = 24;