diff options
author | bapt <bapt@FreeBSD.org> | 2014-12-24 19:41:41 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2014-12-24 19:41:41 +0800 |
commit | 417051755ab77c5c0d69338e6d09d8ce756095ff (patch) | |
tree | 6fd5ed2fee0b650a3b6fe54f23480177313d13c4 | |
parent | 4fbf5f928af356850e8202c6169f3c83738529e5 (diff) | |
download | freebsd-ports-gnome-417051755ab77c5c0d69338e6d09d8ce756095ff.tar.gz freebsd-ports-gnome-417051755ab77c5c0d69338e6d09d8ce756095ff.tar.zst freebsd-ports-gnome-417051755ab77c5c0d69338e6d09d8ce756095ff.zip |
Properly support png 1.5
Obtained from: Gentoo
-rw-r--r-- | graphics/imlib/Makefile | 5 | ||||
-rw-r--r-- | graphics/imlib/files/patch-io-png.c | 46 | ||||
-rw-r--r-- | graphics/imlib/files/patch-libpng15 | 142 | ||||
-rw-r--r-- | graphics/imlib/files/patch-load.c | 28 | ||||
-rw-r--r-- | graphics/imlib/files/patch-save.c | 11 | ||||
-rw-r--r-- | graphics/imlib/files/patch-utils.c | 19 |
6 files changed, 145 insertions, 106 deletions
diff --git a/graphics/imlib/Makefile b/graphics/imlib/Makefile index 725c5158ae2f..c9f49949eec1 100644 --- a/graphics/imlib/Makefile +++ b/graphics/imlib/Makefile @@ -12,7 +12,7 @@ DIST_SUBDIR= gnome MAINTAINER= gnome@FreeBSD.org COMMENT= Graphic library for enlightenment package -LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png \ +LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png \ libtiff.so:${PORTSDIR}/graphics/tiff \ libgif.so:${PORTSDIR}/graphics/giflib @@ -22,7 +22,8 @@ USE_GNOME= gtk12 GNU_CONFIGURE= yes USE_LDCONFIG= yes CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/imlib --disable-modules -CPPFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng15 +CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib +INSTALL_TARGET= install-strip .include <bsd.port.mk> diff --git a/graphics/imlib/files/patch-io-png.c b/graphics/imlib/files/patch-io-png.c deleted file mode 100644 index c4f315a15f4d..000000000000 --- a/graphics/imlib/files/patch-io-png.c +++ /dev/null @@ -1,46 +0,0 @@ ---- gdk_imlib/io-png.c.orig 2002-03-04 18:06:29.000000000 +0100 -+++ gdk_imlib/io-png.c 2012-04-24 23:11:43.000000000 +0200 -@@ -5,6 +5,7 @@ - - #ifdef HAVE_LIBPNG - #include <png.h> -+#include <pngpriv.h> - - unsigned char * - loader_png (FILE * f, int *w, int *h, int *t) -@@ -40,7 +41,7 @@ - return NULL; - } - -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - return NULL; -@@ -275,7 +276,7 @@ - return NULL; - } - -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - return NULL; -@@ -440,7 +441,7 @@ - return NULL; - } - -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - return NULL; -@@ -635,7 +636,7 @@ - png_destroy_write_struct(&png_ptr, (png_infopp) NULL); - return 0; - } -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - fclose(f); - png_destroy_write_struct(&png_ptr, (png_infopp) NULL); diff --git a/graphics/imlib/files/patch-libpng15 b/graphics/imlib/files/patch-libpng15 new file mode 100644 index 000000000000..7837cd488cf2 --- /dev/null +++ b/graphics/imlib/files/patch-libpng15 @@ -0,0 +1,142 @@ +--- gdk_imlib/io-png.c ++++ gdk_imlib/io-png.c +@@ -40,13 +40,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- 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 NULL; +@@ -275,13 +275,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- 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 NULL; +@@ -301,6 +301,9 @@ + /* Setup Translators */ + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_expand(png_ptr); ++ if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) ++ png_set_expand(png_ptr); ++ + png_set_strip_16(png_ptr); + png_set_packing(png_ptr); + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) +@@ -440,13 +443,13 @@ + return NULL; + } + +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- 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 NULL; +@@ -635,7 +638,7 @@ + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); + return 0; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + fclose(f); + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); +--- Imlib/load.c ++++ Imlib/load.c +@@ -197,12 +197,12 @@ + png_destroy_read_struct(&png_ptr, NULL, NULL); + return NULL; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } +- 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 NULL; +@@ -260,7 +260,8 @@ + png_read_image(png_ptr, lines); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + ptr = data; +- if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ++ if (color_type == PNG_COLOR_TYPE_GRAY ++ || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + { + for (y = 0; y < *h; y++) + { +@@ -285,6 +286,7 @@ + } + } + } ++#if 0 + else if (color_type == PNG_COLOR_TYPE_GRAY) + { + for (y = 0; y < *h; y++) +@@ -300,6 +302,7 @@ + } + } + } ++#endif + else + { + for (y = 0; y < *h; y++) +--- Imlib/save.c ++++ Imlib/save.c +@@ -342,7 +342,7 @@ + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); + return 0; + } +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + fclose(f); + png_destroy_write_struct(&png_ptr, (png_infopp) NULL); +--- Imlib/utils.c ++++ Imlib/utils.c +@@ -1981,14 +1981,13 @@ + png_destroy_read_struct(&png_ptr, NULL, NULL); + return NULL; + } +- +- if (setjmp(png_ptr->jmpbuf)) ++ if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return NULL; + } + +- 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 NULL; diff --git a/graphics/imlib/files/patch-load.c b/graphics/imlib/files/patch-load.c deleted file mode 100644 index 471406402710..000000000000 --- a/graphics/imlib/files/patch-load.c +++ /dev/null @@ -1,28 +0,0 @@ ---- Imlib/load.c.orig 2004-09-21 02:23:20.000000000 +0200 -+++ Imlib/load.c 2010-03-28 16:23:13.000000000 +0200 -@@ -170,6 +176,7 @@ - #endif /* HAVE_LIBJPEG */ - - #ifdef HAVE_LIBPNG -+#include <pngpriv.h> - unsigned char * - _LoadPNG(ImlibData * id, FILE * f, int *w, int *h, int *t) - { -@@ -192,7 +198,7 @@ - png_destroy_read_struct(&png_ptr, NULL, NULL); - return NULL; - } -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - return NULL; -@@ -1619,7 +1619,7 @@ - return 0; - fread(buf, 1, 8, f); - rewind(f); -- return (int)png_check_sig(buf, 8); -+ return (int)!png_sig_cmp(buf, 0, 8); - #else - return 0; - #endif diff --git a/graphics/imlib/files/patch-save.c b/graphics/imlib/files/patch-save.c deleted file mode 100644 index 88a23c0426c8..000000000000 --- a/graphics/imlib/files/patch-save.c +++ /dev/null @@ -1,11 +0,0 @@ ---- Imlib/save.c.orig 2004-09-21 02:22:59.000000000 +0200 -+++ Imlib/save.c 2012-04-27 07:19:57.000000000 +0200 -@@ -342,7 +342,7 @@ - png_destroy_write_struct(&png_ptr, (png_infopp) NULL); - return 0; - } -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - fclose(f); - png_destroy_write_struct(&png_ptr, (png_infopp) NULL); diff --git a/graphics/imlib/files/patch-utils.c b/graphics/imlib/files/patch-utils.c deleted file mode 100644 index 0d59d7879b1f..000000000000 --- a/graphics/imlib/files/patch-utils.c +++ /dev/null @@ -1,19 +0,0 @@ ---- Imlib/utils.c.orig 2012-04-27 07:12:19.000000000 +0200 -+++ Imlib/utils.c 2012-04-27 07:15:39.000000000 +0200 -@@ -1899,6 +1899,7 @@ - }; - - #ifdef HAVE_LIBPNG -+#include "pngpriv.h" - static void - _png_io_read(png_structp png_ptr, - png_bytep data, png_uint_32 size) -@@ -1982,7 +1983,7 @@ - return NULL; - } - -- if (setjmp(png_ptr->jmpbuf)) -+ if (setjmp(png_jmpbuf(png_ptr))) - { - png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - return NULL; |