diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2011-09-17 16:50:03 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2011-09-17 16:50:03 +0000 |
commit | b56639f0304b17948809db12cc6ffdb0acdad983 (patch) | |
tree | 018d30c8dbeb04dc2d603c227eb6930a444bab0b /games-engines/stratagus | |
parent | alpha/ia64/sparc stable wrt #382301 (diff) | |
download | gentoo-2-b56639f0304b17948809db12cc6ffdb0acdad983.tar.gz gentoo-2-b56639f0304b17948809db12cc6ffdb0acdad983.tar.bz2 gentoo-2-b56639f0304b17948809db12cc6ffdb0acdad983.zip |
Fix building with libpng15 wrt #383197 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
Diffstat (limited to 'games-engines/stratagus')
-rw-r--r-- | games-engines/stratagus/ChangeLog | 6 | ||||
-rw-r--r-- | games-engines/stratagus/files/stratagus-2.2.5.5-libpng15.patch | 71 | ||||
-rw-r--r-- | games-engines/stratagus/stratagus-2.2.5.5.ebuild | 5 |
3 files changed, 79 insertions, 3 deletions
diff --git a/games-engines/stratagus/ChangeLog b/games-engines/stratagus/ChangeLog index e2ac95536fa7..1289793b6afe 100644 --- a/games-engines/stratagus/ChangeLog +++ b/games-engines/stratagus/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-engines/stratagus # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/ChangeLog,v 1.20 2011/02/03 19:59:57 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/ChangeLog,v 1.21 2011/09/17 16:50:03 ssuominen Exp $ + + 17 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> stratagus-2.2.5.5.ebuild, + +files/stratagus-2.2.5.5-libpng15.patch: + Fix building with libpng15 wrt #383197 by Diego Elio Pettenò 03 Feb 2011; Michael Sterrett <mr_bones_@gentoo.org> stratagus-2.2.5.5.ebuild: diff --git a/games-engines/stratagus/files/stratagus-2.2.5.5-libpng15.patch b/games-engines/stratagus/files/stratagus-2.2.5.5-libpng15.patch new file mode 100644 index 000000000000..cc0a7380ce9b --- /dev/null +++ b/games-engines/stratagus/files/stratagus-2.2.5.5-libpng15.patch @@ -0,0 +1,71 @@ +--- src/video/png.cpp ++++ src/video/png.cpp +@@ -147,7 +147,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in png_create_read_struct() earlier. + */ +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + fprintf(stderr, "Error reading the PNG file.\n"); + ret = -1; + goto done; +@@ -227,11 +227,11 @@ + Rmask = 0x000000FF; + Gmask = 0x0000FF00; + Bmask = 0x00FF0000; +- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; ++ Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0; + } else { + int s; + +- s = (info_ptr->channels == 4) ? 0 : 8; ++ s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; +@@ -239,7 +239,7 @@ + } + } + surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, +- bit_depth * info_ptr->channels, Rmask, Gmask, Bmask, Amask); ++ bit_depth * png_get_channels(png_ptr, info_ptr), Rmask, Gmask, Bmask, Amask); + if (surface == NULL) { + fprintf(stderr, "Out of memory"); + goto done; +@@ -276,6 +276,8 @@ + png_read_end(png_ptr, info_ptr); + + /* Load the palette, if any */ ++ int png_num_palette; ++ png_colorp png_palette; + palette = surface->format->palette; + if (palette) { + if (color_type == PNG_COLOR_TYPE_GRAY) { +@@ -285,12 +287,12 @@ + palette->colors[i].g = i; + palette->colors[i].b = i; + } +- } else if (info_ptr->num_palette > 0) { +- palette->ncolors = info_ptr->num_palette; +- for (i = 0; i < info_ptr->num_palette; ++i) { +- palette->colors[i].b = info_ptr->palette[i].blue; +- palette->colors[i].g = info_ptr->palette[i].green; +- palette->colors[i].r = info_ptr->palette[i].red; ++ } else if (png_num_palette > 0) { ++ palette->ncolors = png_num_palette; ++ for (i = 0; i < png_num_palette; ++i) { ++ palette->colors[i].b = png_palette[i].blue; ++ palette->colors[i].g = png_palette[i].green; ++ palette->colors[i].r = png_palette[i].red; + } + } + } +@@ -343,7 +345,7 @@ + return; + } + +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + /* If we get here, we had a problem reading the file */ + fclose(fp); + png_destroy_write_struct(&png_ptr, &info_ptr); diff --git a/games-engines/stratagus/stratagus-2.2.5.5.ebuild b/games-engines/stratagus/stratagus-2.2.5.5.ebuild index 16d9a0802e4d..c3cdfe952e56 100644 --- a/games-engines/stratagus/stratagus-2.2.5.5.ebuild +++ b/games-engines/stratagus/stratagus-2.2.5.5.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/stratagus-2.2.5.5.ebuild,v 1.6 2011/03/09 22:54:42 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-engines/stratagus/stratagus-2.2.5.5.ebuild,v 1.7 2011/09/17 16:50:03 ssuominen Exp $ EAPI=2 -inherit autotools games +inherit autotools eutils games DESCRIPTION="A realtime strategy game engine" HOMEPAGE="http://stratagus.sourceforge.net/" @@ -28,6 +28,7 @@ DEPEND="${RDEPEND} doc? ( app-doc/doxygen )" src_prepare() { + epatch "${FILESDIR}"/${P}-libpng15.patch sed -i \ -e 's/-O.*\(-fsigned-char\).*/\1"/' \ configure.in \ |