From 0193f43f068f5ac42ae99be17fa835a5facb884c Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 23 Dec 2014 22:40:21 +0000 Subject: [PATCH] Properly patch jbig2dec for png > 1.5 instead of exposing png internals --- graphics/jbig2dec/Makefile | 5 ++--- .../jbig2dec/files/patch-jbig2_image_png.c | 10 ---------- graphics/jbig2dec/files/patch-libpng15 | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) delete mode 100644 graphics/jbig2dec/files/patch-jbig2_image_png.c create mode 100644 graphics/jbig2dec/files/patch-libpng15 diff --git a/graphics/jbig2dec/Makefile b/graphics/jbig2dec/Makefile index 80d4531ae6ff..00265e259f4b 100644 --- a/graphics/jbig2dec/Makefile +++ b/graphics/jbig2dec/Makefile @@ -2,7 +2,7 @@ PORTNAME= jbig2dec PORTVERSION= 0.11 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= graphics devel MASTER_SITES= SF DISTFILES= ${DISTNAME}${EXTRACT_SUFX} @@ -25,9 +25,8 @@ TESTS_DESC= Download and use test-images for post-build testing EXTRACT_AFTER_ARGS+= --exclude sha1.h --exclude 'getopt*' -PNG_LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png +PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png PNG_CONFIGURE_ON= --with-libpng=${LOCALBASE} -PNG_CFLAGS= -I${LOCALBASE}/include/libpng15 .include diff --git a/graphics/jbig2dec/files/patch-jbig2_image_png.c b/graphics/jbig2dec/files/patch-jbig2_image_png.c deleted file mode 100644 index 1aa509b0f27a..000000000000 --- a/graphics/jbig2dec/files/patch-jbig2_image_png.c +++ /dev/null @@ -1,10 +0,0 @@ ---- jbig2_image_png.c.orig 2009-07-16 06:44:49.000000000 +0200 -+++ jbig2_image_png.c 2012-04-24 21:54:55.000000000 +0200 -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "jbig2.h" - #include "jbig2_priv.h" diff --git a/graphics/jbig2dec/files/patch-libpng15 b/graphics/jbig2dec/files/patch-libpng15 new file mode 100644 index 000000000000..2297c52d6f66 --- /dev/null +++ b/graphics/jbig2dec/files/patch-libpng15 @@ -0,0 +1,20 @@ +--- jbig2_image_png.c ++++ jbig2_image_png.c +@@ -33,7 +33,7 @@ + { + png_size_t check; + +- check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr); ++ check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr)); + if (check != length) { + png_error(png_ptr, "Write Error"); + } +@@ -43,7 +43,7 @@ + jbig2_png_flush(png_structp png_ptr) + { + png_FILE_p io_ptr; +- io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); ++ io_ptr = (png_FILE_p)png_get_io_ptr(png_ptr); + if (io_ptr != NULL) + fflush(io_ptr); + }