aboutsummaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-12-25 21:26:41 +0800
committerbapt <bapt@FreeBSD.org>2014-12-25 21:26:41 +0800
commita23d9b1a66fcc02f5555bc28a67bb8f2cdf9d15c (patch)
treed488a9f0dd67d1302d62821967e602166490a314 /graphics
parentd7e0b9c428c5714b080132f470ba04e9e6b3fd33 (diff)
downloadfreebsd-ports-gnome-a23d9b1a66fcc02f5555bc28a67bb8f2cdf9d15c.tar.gz
freebsd-ports-gnome-a23d9b1a66fcc02f5555bc28a67bb8f2cdf9d15c.tar.zst
freebsd-ports-gnome-a23d9b1a66fcc02f5555bc28a67bb8f2cdf9d15c.zip
Properly support png 1.5
Diffstat (limited to 'graphics')
-rw-r--r--graphics/EZWGL/Makefile4
-rw-r--r--graphics/EZWGL/files/patch-lib_EZ__Png.c58
-rw-r--r--graphics/EZWGL/files/patch-lib__EZ_Png.c19
3 files changed, 60 insertions, 21 deletions
diff --git a/graphics/EZWGL/Makefile b/graphics/EZWGL/Makefile
index 2a2c72303822..e1b941d065ed 100644
--- a/graphics/EZWGL/Makefile
+++ b/graphics/EZWGL/Makefile
@@ -12,12 +12,12 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= EZ Widget and Graphics Library
LIB_DEPENDS= libtiff.so:${PORTSDIR}/graphics/tiff \
- libpng15.so:${PORTSDIR}/graphics/png
+ libpng.so:${PORTSDIR}/graphics/png
USE_XORG= x11 xext
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
-CPPFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng15
+CPPFLAGS+= -I${LOCALBASE}/include
LIBS+= -L${LOCALBASE}/lib
PORTDOCS= *
PORTEXAMPLES= *
diff --git a/graphics/EZWGL/files/patch-lib_EZ__Png.c b/graphics/EZWGL/files/patch-lib_EZ__Png.c
new file mode 100644
index 000000000000..bf1a0272634f
--- /dev/null
+++ b/graphics/EZWGL/files/patch-lib_EZ__Png.c
@@ -0,0 +1,58 @@
+--- lib/EZ_Png.c.orig 1999-12-03 21:49:22 UTC
++++ lib/EZ_Png.c
+@@ -61,14 +61,14 @@ static int EZ_ReadPng(fname, w_ret, h_re
+ fclose(fp);
+ return(0);
+ }
+- if(setjmp(png_ptr->jmpbuf))
++ if(setjmp(png_jmpbuf(png_ptr)))
+ {
+ fclose(fp);
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+ return(0);
+ }
+
+- if(info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
++ if(png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
+ {
+ png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+ return(0);
+@@ -77,15 +77,22 @@ static int EZ_ReadPng(fname, w_ret, h_re
+ png_read_info(png_ptr, info_ptr); /* header */
+ png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type, &interlace_type, NULL, NULL);
+
+- if(info_ptr->bit_depth < 8) png_set_packing(png_ptr);
++ if(png_get_bit_depth(png_ptr, info_ptr) < 8) png_set_packing(png_ptr);
+ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_expand(png_ptr);
+ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
+
+- if(info_ptr->valid & PNG_INFO_gAMA) png_set_gamma(png_ptr, 2.2, info_ptr->gamma);
++ 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)
+- png_set_background(png_ptr, &info_ptr->background, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
++ if(png_get_valid(png_ptr, info_ptr, PNG_INFO_bKGD)) {
++ png_color_16 my_background;
++ png_get_bKGD(png_ptr, info_ptr, &my_background);
++ png_set_background(png_ptr, &my_background, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
++ }
+ else
+ {
+ png_color_16 my_background;
+@@ -93,9 +100,9 @@ static int EZ_ReadPng(fname, w_ret, h_re
+ png_set_background(png_ptr, &my_background, PNG_BACKGROUND_GAMMA_SCREEN, 0, 2.2);
+ }
+
+- if(info_ptr->bit_depth == 16) png_set_strip_16(png_ptr);
++ if(png_get_bit_depth(png_ptr, info_ptr) == 16) png_set_strip_16(png_ptr);
+
+- if(info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ if(png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
+ png_set_expand(png_ptr);
+
+ if((data = (unsigned char *)my_malloc( 4 * w * (h+1)* sizeof(unsigned char), _PNG_IMAGE_)) == NULL)
diff --git a/graphics/EZWGL/files/patch-lib__EZ_Png.c b/graphics/EZWGL/files/patch-lib__EZ_Png.c
deleted file mode 100644
index 9e93ff97d34c..000000000000
--- a/graphics/EZWGL/files/patch-lib__EZ_Png.c
+++ /dev/null
@@ -1,19 +0,0 @@
---- lib/EZ_Png.c.orig 1999-12-03 21:49:22 UTC
-+++ lib/EZ_Png.c
-@@ -37,6 +37,7 @@
- #if defined(HAVE_LIBPNG) && defined(PNG_SUPPORT)
- #undef EXTERN
- #include <png.h>
-+#include <pngpriv.h>
-
- static int EZ_ReadPng(fname, w_ret, h_ret, p_ret, rgb_return)
- char *fname;
-@@ -61,7 +62,7 @@
- fclose(fp);
- return(0);
- }
-- if(setjmp(png_ptr->jmpbuf))
-+ if(setjmp(png_jmpbuf(png_ptr)))
- {
- fclose(fp);
- png_destroy_read_struct(&png_ptr, &info_ptr, NULL);