From ff8e372e08387ced70f35a2eee842e07b8170b75 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 3 Mar 2011 20:41:57 +0100 Subject: package wxwidgets: libpng 1.5 compatibility --- src/wxwidgets-1-png.patch | 39 +++++++++++++++++++++++++++++++++++++++ src/wxwidgets.mk | 6 ++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/wxwidgets-1-png.patch diff --git a/src/wxwidgets-1-png.patch b/src/wxwidgets-1-png.patch new file mode 100644 index 0000000..640c00e --- /dev/null +++ b/src/wxwidgets-1-png.patch @@ -0,0 +1,39 @@ +This file is part of mingw-cross-env. +See doc/index.html for further information. + +http://trac.wxwidgets.org/changeset/67009 +Index: /wxWidgets/branches/WX_2_8_BRANCH/src/common/imagpng.cpp +=================================================================== +--- a/src/common/imagpng.cpp (revision 60875) ++++ b/src/common/imagpng.cpp (revision 67009) +@@ -530,5 +530,5 @@ + ( + PNG_LIBPNG_VER_STRING, +- (voidp) NULL, ++ NULL, + wx_png_error, + wx_png_warning +@@ -587,14 +587,17 @@ + if (color_type == PNG_COLOR_TYPE_PALETTE) + { +- const size_t ncolors = info_ptr->num_palette; ++ int ncolors = 0; ++ png_colorp palette; ++ png_get_PLTE( png_ptr, info_ptr, &palette, &ncolors); + unsigned char* r = new unsigned char[ncolors]; + unsigned char* g = new unsigned char[ncolors]; + unsigned char* b = new unsigned char[ncolors]; +- +- for (size_t j = 0; j < ncolors; j++) ++ int j; ++ ++ for (j = 0; j < ncolors; j++) + { +- r[j] = info_ptr->palette[j].red; +- g[j] = info_ptr->palette[j].green; +- b[j] = info_ptr->palette[j].blue; ++ r[j] = palette[j].red; ++ g[j] = palette[j].green; ++ b[j] = palette[j].blue; + } + diff --git a/src/wxwidgets.mk b/src/wxwidgets.mk index 90f3497..aaa93c3 100644 --- a/src/wxwidgets.mk +++ b/src/wxwidgets.mk @@ -37,7 +37,7 @@ define $(PKG)_BUILD --with-themes=all \ --with-msw \ --with-opengl \ - --with-libpng=builtin \ + --with-libpng=sys \ --with-libjpeg=sys \ --with-libtiff=sys \ --with-regex=yes \ @@ -65,6 +65,8 @@ define $(PKG)_BUILD # build the wxWidgets variant without unicode support cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,wxwidgets) + $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/wxwidgets-*.patch)), + (cd '$(1)/$(wxwidgets_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH)) $(SED) -i 's,png_check_sig,png_sig_cmp,g' '$(1)/$(wxwidgets_SUBDIR)/configure' $(SED) -i 's,wx_cv_cflags_mthread=yes,wx_cv_cflags_mthread=no,' '$(1)/$(wxwidgets_SUBDIR)/configure' # wine confuses the cross-compiling detection, so set it explicitly @@ -83,7 +85,7 @@ define $(PKG)_BUILD --with-themes=all \ --with-msw \ --with-opengl \ - --with-libpng=builtin \ + --with-libpng=sys \ --with-libjpeg=sys \ --with-libtiff=sys \ --with-regex=yes \ -- cgit v0.12