aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-12-24 21:12:15 +0800
committerbapt <bapt@FreeBSD.org>2014-12-24 21:12:15 +0800
commit68d556ac7e0c5e84fd16305623fe29fe07e058d5 (patch)
treebc23ec6eba36f9498fef403deead431fcd6eeee5
parentb5abe91f0f0209254907dea7675821da645b1a86 (diff)
downloadfreebsd-ports-gnome-68d556ac7e0c5e84fd16305623fe29fe07e058d5.tar.gz
freebsd-ports-gnome-68d556ac7e0c5e84fd16305623fe29fe07e058d5.tar.zst
freebsd-ports-gnome-68d556ac7e0c5e84fd16305623fe29fe07e058d5.zip
Properly support png 1.5
Obtained from: Gentoo
-rw-r--r--graphics/exact-image/Makefile4
-rw-r--r--graphics/exact-image/files/patch-libpng14 (renamed from graphics/exact-image/files/patch-codecs__png.cc)27
-rw-r--r--graphics/exact-image/files/patch-libpng1534
3 files changed, 45 insertions, 20 deletions
diff --git a/graphics/exact-image/Makefile b/graphics/exact-image/Makefile
index 9ab4bb95fd6d..c44470f1476c 100644
--- a/graphics/exact-image/Makefile
+++ b/graphics/exact-image/Makefile
@@ -16,7 +16,7 @@ BUILD_DEPENDS= swig:${PORTSDIR}/devel/swig13
LIB_DEPENDS= libagg.so:${PORTSDIR}/graphics/agg \
libjpeg.so:${PORTSDIR}/graphics/jpeg \
libtiff.so:${PORTSDIR}/graphics/tiff \
- libpng15.so:${PORTSDIR}/graphics/png \
+ libpng.so:${PORTSDIR}/graphics/png \
libgif.so:${PORTSDIR}/graphics/giflib \
libjasper.so:${PORTSDIR}/graphics/jasper \
libIlmImf.so:${PORTSDIR}/graphics/OpenEXR \
@@ -26,7 +26,7 @@ LIB_DEPENDS= libagg.so:${PORTSDIR}/graphics/agg \
#hack to get custom exactcode configure script to enable tiff support with
#broken headers on c++ in base system:
-CPPFLAGS+= -fpermissive -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng15
+CPPFLAGS+= -fpermissive -I${LOCALBASE}/include
USES= gmake perl5 pkgconfig python tar:bzip2
USE_XORG= x11
HAS_CONFIGURE= yes
diff --git a/graphics/exact-image/files/patch-codecs__png.cc b/graphics/exact-image/files/patch-libpng14
index a5fc65d2ad75..f25b9af02da9 100644
--- a/graphics/exact-image/files/patch-codecs__png.cc
+++ b/graphics/exact-image/files/patch-libpng14
@@ -1,15 +1,6 @@
---- codecs/png.cc.orig 2010-03-03 22:04:44.000000000 +0100
-+++ codecs/png.cc 2012-04-25 19:08:13.000000000 +0200
-@@ -17,6 +17,8 @@
-
- #include <stdlib.h>
- #include <png.h>
-+#include <zlib.h>
-+#include <pngpriv.h>
-
- #include <iostream>
-
-@@ -71,7 +73,7 @@
+--- codecs/png.cc
++++ codecs/png.cc
+@@ -71,7 +71,7 @@
/* Allocate/initialize the memory for image information. REQUIRED. */
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
@@ -18,7 +9,7 @@
return 0;
}
-@@ -82,7 +84,7 @@
+@@ -82,7 +82,7 @@
if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
@@ -27,7 +18,7 @@
/* If we get here, we had a problem reading the file */
return 0;
}
-@@ -99,7 +101,7 @@
+@@ -99,7 +99,7 @@
png_read_info (png_ptr, info_ptr);
png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
@@ -36,7 +27,7 @@
image.w = width;
image.h = height;
-@@ -132,7 +134,7 @@
+@@ -132,7 +132,7 @@
#if 0 // no longer needed
/* Expand grayscale images to the full 8 bits from 2, or 4 bits/pixel */
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth > 1 && bit_depth < 8) {
@@ -45,7 +36,7 @@
image.bps = 8;
}
#endif
-@@ -196,11 +198,11 @@
+@@ -196,11 +196,11 @@
for (int pass = 0; pass < number_passes; ++pass)
for (unsigned int y = 0; y < height; ++y) {
row_pointers[0] = image.getRawData() + y * stride;
@@ -59,7 +50,7 @@
/* that's it */
return true;
-@@ -224,7 +226,7 @@
+@@ -224,7 +224,7 @@
/* Allocate/initialize the memory for image information. REQUIRED. */
info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
@@ -68,7 +59,7 @@
return false;
}
-@@ -244,7 +246,6 @@
+@@ -244,7 +244,6 @@
else if (quality > Z_BEST_COMPRESSION) quality = Z_BEST_COMPRESSION;
png_set_compression_level(png_ptr, quality);
diff --git a/graphics/exact-image/files/patch-libpng15 b/graphics/exact-image/files/patch-libpng15
new file mode 100644
index 000000000000..44c94726e35c
--- /dev/null
+++ b/graphics/exact-image/files/patch-libpng15
@@ -0,0 +1,34 @@
+--- codecs/png.cc
++++ codecs/png.cc
+@@ -16,6 +16,7 @@
+ */
+
+ #include <stdlib.h>
++#include <zlib.h>
+ #include <png.h>
+
+ #include <iostream>
+@@ -104,7 +105,7 @@
+ image.w = width;
+ image.h = height;
+ image.bps = bit_depth;
+- image.spp = info_ptr->channels;
++ image.spp = png_get_channels(png_ptr, info_ptr);
+
+ png_uint_32 res_x, res_y;
+ res_x = png_get_x_pixels_per_meter(png_ptr, info_ptr);
+@@ -120,10 +121,13 @@
+ // png_set_packswap(png_ptr);
+
+ /* Expand paletted colors into true RGB triplets */
++
++ int num_trans;
++
+ if (color_type == PNG_COLOR_TYPE_PALETTE) {
+ png_set_palette_to_rgb(png_ptr);
+ image.bps = 8;
+- if (info_ptr->num_trans)
++ if (num_trans)
+ image.spp = 4;
+ else
+ image.spp = 3;