From c0aa9d9644f5e359acb822209e6ada247bd1ca4e Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 3 Mar 2011 21:15:33 +0100 Subject: package fltk: libpng 1.5 compatibility --- src/fltk-1-png.patch | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/fltk.mk | 1 - 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/fltk-1-png.patch diff --git a/src/fltk-1-png.patch b/src/fltk-1-png.patch new file mode 100644 index 0000000..1268a33 --- /dev/null +++ b/src/fltk-1-png.patch @@ -0,0 +1,61 @@ +This file is part of mingw-cross-env. +See doc/index.html for further information. + +http://www.fltk.org/strfiles/2542/libpng-1.5.diff +Index: src/Fl_PNG_Image.cxx +=================================================================== +--- a/src/Fl_PNG_Image.cxx (Revision 8485) ++++ b/src/Fl_PNG_Image.cxx (Arbeitskopie) +@@ -66,6 +66,7 @@ + png_structp pp; // PNG read pointer + png_infop info; // PNG info pointers + png_bytep *rows; // PNG row pointers ++ int num_trans = 0; // PNG # of transp. colors + + + // Open the PNG file... +@@ -75,7 +76,7 @@ + pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info = png_create_info_struct(pp); + +- if (setjmp(pp->jmpbuf)) ++ if (setjmp(png_jmpbuf(pp))) + { + Fl::warning("PNG file \"%s\" contains errors!\n", png); + return; +@@ -87,27 +88,28 @@ + // Get the image dimensions and convert to grayscale or RGB... + png_read_info(pp, info); + +- if (info->color_type == PNG_COLOR_TYPE_PALETTE) ++ if (png_get_color_type(pp, info) == PNG_COLOR_TYPE_PALETTE) + png_set_expand(pp); + +- if (info->color_type & PNG_COLOR_MASK_COLOR) ++ if (png_get_color_type(pp, info) & PNG_COLOR_MASK_COLOR) + channels = 3; + else + channels = 1; + +- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans) ++ png_get_tRNS(pp, info, 0, &num_trans, 0); ++ if ((png_get_color_type(pp, info) & PNG_COLOR_MASK_ALPHA) || num_trans) + channels ++; + +- w((int)(info->width)); +- h((int)(info->height)); ++ w((int)(png_get_image_width(pp, info))); ++ h((int)(png_get_image_height(pp, info))); + d(channels); + +- if (info->bit_depth < 8) ++ if (png_get_bit_depth(pp, info) < 8) + { + png_set_packing(pp); + png_set_expand(pp); + } +- else if (info->bit_depth == 16) ++ else if (png_get_bit_depth(pp, info) == 16) + png_set_strip_16(pp); + + # if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA) diff --git a/src/fltk.mk b/src/fltk.mk index f443dd2..1b0409b 100644 --- a/src/fltk.mk +++ b/src/fltk.mk @@ -27,7 +27,6 @@ define $(PKG)_BUILD --disable-shared \ --prefix='$(PREFIX)/$(TARGET)' \ --enable-threads \ - --enable-localpng \ LIBS='-lws2_32' $(SED) -i 's,-fno-exceptions,,' '$(1)/makeinclude' $(MAKE) -C '$(1)' -j '$(JOBS)' install DIRS=src LIBCOMMAND='$(TARGET)-ar cr' -- cgit v0.12