summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-09-30 22:11:48 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-09-30 22:11:48 +0000
commit6fc435fc4ca94eee6327b41404628200eb876119 (patch)
tree83c422f9db4cc95508fcf99ac0ffb03a6fa0b331 /x11-libs/fltk
parentDrop .la file (diff)
downloadgentoo-2-6fc435fc4ca94eee6327b41404628200eb876119.tar.gz
gentoo-2-6fc435fc4ca94eee6327b41404628200eb876119.tar.bz2
gentoo-2-6fc435fc4ca94eee6327b41404628200eb876119.zip
Fix building with libpng15 wrt #373521 by Stuart Longland
(Portage version: 2.2.0_alpha59/cvs/Linux x86_64)
Diffstat (limited to 'x11-libs/fltk')
-rw-r--r--x11-libs/fltk/ChangeLog6
-rw-r--r--x11-libs/fltk/files/fltk-1.1.10-libpng15.patch58
-rw-r--r--x11-libs/fltk/fltk-1.1.10-r2.ebuild3
3 files changed, 65 insertions, 2 deletions
diff --git a/x11-libs/fltk/ChangeLog b/x11-libs/fltk/ChangeLog
index 5f37c2146e22..2ae834892e01 100644
--- a/x11-libs/fltk/ChangeLog
+++ b/x11-libs/fltk/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for x11-libs/fltk
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.182 2011/08/11 09:13:00 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.183 2011/09/30 22:11:48 ssuominen Exp $
+
+ 30 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> fltk-1.1.10-r2.ebuild,
+ +files/fltk-1.1.10-libpng15.patch:
+ Fix building with libpng15 wrt #373521 by Stuart Longland
11 Aug 2011; Markos Chandras <hwoarang@gentoo.org>
+files/fltk-1.1.9-share.patch:
diff --git a/x11-libs/fltk/files/fltk-1.1.10-libpng15.patch b/x11-libs/fltk/files/fltk-1.1.10-libpng15.patch
new file mode 100644
index 000000000000..a240be99efb6
--- /dev/null
+++ b/x11-libs/fltk/files/fltk-1.1.10-libpng15.patch
@@ -0,0 +1,58 @@
+--- src/Fl_PNG_Image.cxx
++++ src/Fl_PNG_Image.cxx
+@@ -66,7 +66,8 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+ png_structp pp; // PNG read pointer
+ png_infop info; // PNG info pointers
+ png_bytep *rows; // PNG row pointers
+-
++ png_byte color_type; // PNG color type
++ png_byte bit_depth; // PNG bit depth
+
+ // Open the PNG file...
+ if ((fp = fopen(png, "rb")) == NULL) return;
+@@ -75,7 +76,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+ 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;
+@@ -86,28 +87,24 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
+
+ // Get the image dimensions and convert to grayscale or RGB...
+ png_read_info(pp, info);
++ color_type = png_get_color_type(pp, info);
+
+- if (info->color_type == PNG_COLOR_TYPE_PALETTE)
++ if (color_type == PNG_COLOR_TYPE_PALETTE)
+ png_set_expand(pp);
+
+- if (info->color_type & PNG_COLOR_MASK_COLOR)
+- channels = 3;
+- else
+- channels = 1;
+-
+- if ((info->color_type & PNG_COLOR_MASK_ALPHA) || info->num_trans)
+- channels ++;
++ channels = png_get_channels(pp, info);
+
+- 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)
++ bit_depth = png_get_bit_depth(pp, info);
++ if (bit_depth < 8)
+ {
+ png_set_packing(pp);
+ png_set_expand(pp);
+ }
+- else if (info->bit_depth == 16)
++ else if (bit_depth == 16)
+ png_set_strip_16(pp);
+
+ # if defined(HAVE_PNG_GET_VALID) && defined(HAVE_PNG_SET_TRNS_TO_ALPHA)
diff --git a/x11-libs/fltk/fltk-1.1.10-r2.ebuild b/x11-libs/fltk/fltk-1.1.10-r2.ebuild
index 7607e820ae3c..fc6b26240148 100644
--- a/x11-libs/fltk/fltk-1.1.10-r2.ebuild
+++ b/x11-libs/fltk/fltk-1.1.10-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/fltk-1.1.10-r2.ebuild,v 1.2 2011/05/01 17:14:33 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/fltk-1.1.10-r2.ebuild,v 1.3 2011/09/30 22:11:48 ssuominen Exp $
EAPI=3
@@ -37,6 +37,7 @@ INCDIR=${EPREFIX}/usr/include/fltk-${SLOT}
LIBDIR=${EPREFIX}/usr/$(get_libdir)/fltk-${SLOT}
src_prepare() {
+ epatch "${FILESDIR}"/${P}-libpng15.patch
# backported from 1.3.0
epatch "${FILESDIR}"/${P}-includedir.patch
epatch "${FILESDIR}"/fltk-1.1.9-share.patch