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.diff -r1.135 -r1.136 pkgsrc/graphics/gimp-ufraw/Makefile
(gdt)
@@ -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. | |
7 | DISTNAME= ufraw-0.22 | 7 | DISTNAME= ufraw-0.22 | |
8 | PKGNAME= gimp-${DISTNAME} | 8 | PKGNAME= gimp-${DISTNAME} | |
9 | PKGREVISION= 31 | 9 | PKGREVISION= 32 | |
10 | CATEGORIES= graphics | 10 | CATEGORIES= graphics | |
11 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ufraw/} | 11 | MASTER_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. | |
15 | MAINTAINER= gdt@NetBSD.org | 15 | MAINTAINER= gdt@NetBSD.org | |
16 | HOMEPAGE= http://ufraw.sourceforge.net/ | 16 | HOMEPAGE= http://ufraw.sourceforge.net/ | |
17 | COMMENT= GIMP plug-in for raw digicam import | 17 | COMMENT= GIMP plug-in for raw digicam import | |
18 | 18 | |||
19 | LICENSE= gnu-gpl-v2 | 19 | LICENSE= gnu-gpl-v2 | |
20 | 20 | |||
21 | GNU_CONFIGURE= yes | 21 | GNU_CONFIGURE= yes | |
22 | 22 | |||
23 | USE_TOOLS+= gmake pkg-config msgfmt | 23 | USE_TOOLS+= gmake pkg-config msgfmt | |
24 | USE_TOOLS+= perl:run pod2man | 24 | USE_TOOLS+= perl:run pod2man | |
25 | USE_LANGUAGES= c c++03 | 25 | USE_LANGUAGES= c99 c++03 | |
26 | 26 | |||
27 | CONFIGURE_ARGS+= --enable-mime | 27 | CONFIGURE_ARGS+= --enable-mime | |
28 | 28 | |||
29 | GCONF_SCHEMAS= ufraw.schemas | 29 | GCONF_SCHEMAS= ufraw.schemas | |
30 | 30 | |||
31 | PTHREAD_AUTO_VARS= yes | 31 | PTHREAD_AUTO_VARS= yes | |
32 | 32 | |||
33 | # This package uses too much C99 code to be patched. | |||
34 | GCC_REQD+= 3.0 | |||
35 | BUILDLINK_TRANSFORM+= rm:-std=gnu99 | |||
36 | ||||
37 | PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw | 33 | PKG_OPTIONS_VAR= PKG_OPTIONS.ufraw | |
38 | PKG_SUPPORTED_OPTIONS= lensfun | 34 | PKG_SUPPORTED_OPTIONS= lensfun | |
39 | PKG_SUGGESTED_OPTIONS= lensfun | 35 | PKG_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" |
@@ -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 | |||
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) = 1d379ffa2624ce24b8f7e523d0dcfe7a313ec9c7 | 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-ufraw__exiv2.cc) = c6f3c6bd9ec8cdc3dee1801f9b1972bbe827cd8d |
@@ -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. | 3 | The 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 | |||
8 | by 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 | |
11 | and 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; |