[97305] trunk/dports/graphics/xfig

ryandesign at macports.org ryandesign at macports.org
Mon Sep 3 01:04:37 PDT 2012


Revision: 97305
          https://trac.macports.org/changeset/97305
Author:   ryandesign at macports.org
Date:     2012-09-03 01:04:36 -0700 (Mon, 03 Sep 2012)
Log Message:
-----------
xfig: fix build with libpng 1.5, using patch from Debian

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

Added Paths:
-----------
    trunk/dports/graphics/xfig/files/patch-libpng-1.5.diff

Modified: trunk/dports/graphics/xfig/Portfile
===================================================================
--- trunk/dports/graphics/xfig/Portfile	2012-09-03 08:00:25 UTC (rev 97304)
+++ trunk/dports/graphics/xfig/Portfile	2012-09-03 08:04:36 UTC (rev 97305)
@@ -41,7 +41,8 @@
                 patch-w_export.c \
                 patch-w_print.c \
                 patch-w_util.c \
-                patch-main_c.diff
+                patch-main_c.diff \
+                patch-libpng-1.5.diff
 
 post-extract {
 	foreach d "${worksrcpath}/Doc ${worksrcpath}/Libraries" {

Added: trunk/dports/graphics/xfig/files/patch-libpng-1.5.diff
===================================================================
--- trunk/dports/graphics/xfig/files/patch-libpng-1.5.diff	                        (rev 0)
+++ trunk/dports/graphics/xfig/files/patch-libpng-1.5.diff	2012-09-03 08:04:36 UTC (rev 97305)
@@ -0,0 +1,72 @@
+--- f_readpng.c.orig
++++ f_readpng.c
+@@ -43,7 +43,7 @@
+     char	   *ptr;
+     int		    num_palette;
+     png_colorp	    palette;
+-    png_color_16    background;
++    png_color_16    background, *image_background;
+ 
+     /* make scale factor smaller for metric */
+     float scale = (appres.INCHES ?
+@@ -73,7 +73,7 @@
+     }
+ 
+     /* set long jump recovery here */
+-    if (setjmp(png_ptr->jmpbuf)) {
++    if (setjmp(png_jmpbuf((png_ptr)))) {
+ 	/* if we get here there was a problem reading the file */
+ 	png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
+ 	close_picfile(file,filetype);
+@@ -90,14 +90,18 @@
+     png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type,
+ 	&interlace_type, &compression_type, &filter_type);
+ 
+-    if (info_ptr->valid & PNG_INFO_gAMA)
+-	png_set_gamma(png_ptr, 2.2, info_ptr->gamma);
+-    else
++    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
++	double gamma;
++	png_get_gAMA(png_ptr, info_ptr, &gamma);
++	png_set_gamma(png_ptr, 2.2, gamma);
++	} else {
+ 	png_set_gamma(png_ptr, 2.2, 0.45);
++	}
+ 
+-    if (info_ptr->valid & PNG_INFO_bKGD)
++    if (png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD) && 
++        png_get_bKGD(png_ptr, info_ptr, &image_background))
+ 	/* set the background to the one supplied */
+-	png_set_background(png_ptr, &info_ptr->background,
++	png_set_background(png_ptr, image_background,
+ 		PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+     else {
+ 	/* blend the canvas background using the alpha channel */
+@@ -136,7 +140,7 @@
+ 
+ 	if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) {
+ 	    png_get_hIST(png_ptr, info_ptr, &histogram);
+-	    png_set_dither(png_ptr, palette, num_palette, 256, histogram, 0);
++	    png_set_quantize(png_ptr, palette, num_palette, 256, histogram, 0);
+ 	}
+     }
+     if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+--- f_wrpng.c.orig
++++ f_wrpng.c
+@@ -20,6 +20,7 @@
+ #include "w_msgpanel.h"
+ #include "w_setup.h"
+ #include <png.h>
++#include <zlib.h>
+ 
+ /*
+  * Write PNG file from rgb data
+@@ -59,7 +60,7 @@
+     }
+ 
+     /* set long jump recovery here */
+-    if (setjmp(png_ptr->jmpbuf)) {
++	if (setjmp(png_jmpbuf((png_ptr)))) {
+ 	/* if we get here there was a problem reading the file */
+ 	png_destroy_write_struct(&png_ptr, &info_ptr);
+ 	return False;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120903/ac5a088d/attachment-0001.html>


More information about the macports-changes mailing list