ports/145102: [PATCH] fix build of graphics/netpbm (broken by update of libpng)
Christoph Moench-Tegeder
cmt at burggraben.net
Sun Mar 28 10:20:03 UTC 2010
>Number: 145102
>Category: ports
>Synopsis: [PATCH] fix build of graphics/netpbm (broken by update of libpng)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Mar 28 10:20:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Christoph Moench-Tegeder
>Release: FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD elch.exwg.net 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #8: Sat Feb 20 21:36:50 CET 2010 cmt at elch.exwg.net:/usr/obj/usr/src/sys/CMT amd64
png-1.4.1
netpbm-10.26.63_3 (upgrading from netpbm-10.26.63_2)
>Description:
libpng-1.4 renamed some fields in struct png_info (namely
png_info.trans_values to png_info.trans_color and png_info.trans to
png_info.trans_alpha) which leads to breakage in pnmtopng and pngtopnm
from netpbm, for example:
pnmtopng.c:1866: error: 'png_info' has no member named 'trans'
[...]
pnmtopng.c:1903: error: 'png_info' has no member named 'trans_values'
pnmtopng.c:1912: warning: 'valid' is deprecated (declared at /usr/local/include/png.h:635)
pnmtopng.c:1915: error: 'png_info' has no member named 'trans_values'
pnmtopng.c:1916: error: 'png_info' has no member named 'trans_values'
pnmtopng.c:1917: error: 'png_info' has no member named 'trans_values'
pnmtopng.c:1918: error: 'png_info' has no member named 'trans_values'
There are a lot of deprecationw arnings, but those seem to be
non-critical at the moment.
Included patches fix the problem for graphics/netpbm, I'll submit
patches for graphics/netpbm-devel later.
>How-To-Repeat:
Run portupgrade. (Why wasn't this spotted on pointyhat?)
>Fix:
Add the following to patches in graphics/netpbm/files/
In case they are mangled by some mail system they are available at
http://burggraben.net/hacks/patch-converter-other-pngtopnm and
http://burggraben.net/hacks/patch-converter-other-pnmtopng
graphics/netpbm/files/patch-converter-other-pngtopnm
--- converter/other/pngtopnm.c.orig 2010-03-28 11:32:58.000000000 +0200
+++ converter/other/pngtopnm.c 2010-03-28 11:36:11.000000000 +0200
@@ -494,7 +494,7 @@
case PNG_COLOR_TYPE_GRAY:
setXel(&xelrow[col], c, c, c,
((info_ptr->valid & PNG_INFO_tRNS) &&
- (c == gamma_correct(info_ptr->trans_values.gray,
+ (c == gamma_correct(info_ptr->trans_color.gray,
totalgamma))) ?
0 : maxval);
break;
@@ -511,7 +511,7 @@
info_ptr->palette[c].blue,
(info_ptr->valid & PNG_INFO_tRNS) &&
c < info_ptr->num_trans ?
- info_ptr->trans[c] : maxval);
+ info_ptr->trans_alpha[c] : maxval);
break;
case PNG_COLOR_TYPE_RGB: {
@@ -519,11 +519,11 @@
png_uint_16 const c3 = get_png_val(png_pixelP);
setXel(&xelrow[col], c, c2, c3,
((info_ptr->valid & PNG_INFO_tRNS) &&
- (c == gamma_correct(info_ptr->trans_values.red,
+ (c == gamma_correct(info_ptr->trans_color.red,
totalgamma)) &&
- (c2 == gamma_correct(info_ptr->trans_values.green,
+ (c2 == gamma_correct(info_ptr->trans_color.green,
totalgamma)) &&
- (c3 == gamma_correct(info_ptr->trans_values.blue,
+ (c3 == gamma_correct(info_ptr->trans_color.blue,
totalgamma))) ?
0 : maxval);
}
@@ -688,7 +688,7 @@
(info_ptr->valid & PNG_INFO_tRNS)) {
trans_mix = TRUE;
for (i = 0 ; i < info_ptr->num_trans ; i++)
- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != 255) {
+ if (info_ptr->trans_alpha[i] != 0 && info_ptr->trans_alpha[i] != 255) {
trans_mix = FALSE;
break;
}
@@ -841,7 +841,7 @@
pnm_type = PBM_TYPE;
if (info_ptr->valid & PNG_INFO_tRNS) {
for (i = 0 ; i < info_ptr->num_trans ; i++) {
- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != maxval) {
+ if (info_ptr->trans_alpha[i] != 0 && info_ptr->trans_alpha[i] != maxval) {
pnm_type = PGM_TYPE;
break;
}
graphics/netpbm/files/patch-converter-other-pnmtopng
--- converter/other/pnmtopng.c.orig 2010-03-28 11:19:55.000000000 +0200
+++ converter/other/pnmtopng.c 2010-03-28 11:22:32.000000000 +0200
@@ -1863,7 +1863,7 @@
info_ptr->num_palette = palette_size;
if (trans_size > 0) {
info_ptr->valid |= PNG_INFO_tRNS;
- info_ptr->trans = trans;
+ info_ptr->trans_alpha = trans;
info_ptr->num_trans = trans_size; /* omit opaque values */
}
/* creating hIST chunk */
@@ -1900,7 +1900,7 @@
info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
if (transparent > 0) {
info_ptr->valid |= PNG_INFO_tRNS;
- info_ptr->trans_values =
+ info_ptr->trans_color =
xelToPngColor_16(transcolor, maxval, png_maxval);
}
} else {
@@ -1912,10 +1912,10 @@
if (info_ptr->valid && PNG_INFO_tRNS)
pm_message("Transparent color {gray, red, green, blue} = "
"{%d, %d, %d, %d}",
- info_ptr->trans_values.gray,
- info_ptr->trans_values.red,
- info_ptr->trans_values.green,
- info_ptr->trans_values.blue);
+ info_ptr->trans_color.gray,
+ info_ptr->trans_color.red,
+ info_ptr->trans_color.green,
+ info_ptr->trans_color.blue);
else
pm_message("No transparent color");
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list