[75221] trunk/dports/graphics/netpbm

ryandesign at macports.org ryandesign at macports.org
Tue Jan 18 02:00:29 PST 2011


Revision: 75221
          http://trac.macports.org/changeset/75221
Author:   ryandesign at macports.org
Date:     2011-01-18 02:00:21 -0800 (Tue, 18 Jan 2011)
Log Message:
-----------
netpbm: fix build error with libpng 1.4.x; see #27997

Modified Paths:
--------------
    trunk/dports/graphics/netpbm/Portfile

Added Paths:
-----------
    trunk/dports/graphics/netpbm/files/libpng14.diff

Modified: trunk/dports/graphics/netpbm/Portfile
===================================================================
--- trunk/dports/graphics/netpbm/Portfile	2011-01-18 09:33:55 UTC (rev 75220)
+++ trunk/dports/graphics/netpbm/Portfile	2011-01-18 10:00:21 UTC (rev 75221)
@@ -36,7 +36,8 @@
                 rmd160  c3e922aaec320a5692fb0d71b5e34303d9dc2f9f
 
 patchfiles      patch-lib-Makefile.diff patch-pm_config.in.h.diff \
-                patch-jpeg7.diff
+                patch-jpeg7.diff \
+                libpng14.diff
 
 post-patch {
     reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/pm_config.in.h

Added: trunk/dports/graphics/netpbm/files/libpng14.diff
===================================================================
--- trunk/dports/graphics/netpbm/files/libpng14.diff	                        (rev 0)
+++ trunk/dports/graphics/netpbm/files/libpng14.diff	2011-01-18 10:00:21 UTC (rev 75221)
@@ -0,0 +1,113 @@
+http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2010-March/185101.html
+--- converter/other/pngtopnm.c.orig	2009-08-01 14:35:54.000000000 -0500
++++ converter/other/pngtopnm.c	2011-01-18 03:48:18.000000000 -0600
+@@ -43,11 +43,6 @@
+ #include "nstring.h"
+ #include "shhopt.h"
+ 
+-#if PNG_LIBPNG_VER >= 10400
+-#error Your PNG library (<png.h>) is incompatible with this Netpbm source code.
+-#error You need either an older PNG library (older than 1.4)
+-#error newer Netpbm source code (at least 10.48)
+-#endif
+ 
+ typedef struct _jmpbuf_wrapper {
+   jmp_buf jmpbuf;
+@@ -500,7 +495,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;
+@@ -517,7 +512,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: {
+@@ -525,11 +520,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);
+             }
+@@ -694,7 +689,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;
+             }
+@@ -847,7 +842,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;
+             }
+--- converter/other/pnmtopng.c.orig	2009-08-01 14:31:33.000000000 -0500
++++ converter/other/pnmtopng.c	2011-01-18 03:48:18.000000000 -0600
+@@ -63,11 +63,6 @@
+ #include "mallocvar.h"
+ #include "nstring.h"
+ 
+-#if PNG_LIBPNG_VER >= 10400
+-#error Your PNG library (<png.h>) is incompatible with this Netpbm source code.
+-#error You need either an older PNG library (older than 1.4)
+-#error newer Netpbm source code (at least 10.48)
+-#endif
+ 
+ struct zlib_compression {
+     /* These are parameters that describe a form of zlib compression. 
+@@ -1869,7 +1864,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 */
+@@ -1906,7 +1901,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 {
+@@ -1918,10 +1913,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");
+     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110118/4a183df1/attachment.html>


More information about the macports-changes mailing list