summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2011-09-15 03:32:59 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2011-09-15 03:32:59 +0000
commit07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2 (patch)
tree8cd562ac1669a820146dc5cacd1dd5a521272927 /games-strategy/widelands
parentAdd multilib deps for USE="mp3 scanner" #382125 by Jonathan-Christofer Demay. (diff)
downloadgentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.tar.gz
gentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.tar.bz2
gentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.zip
Fix building with libpng15 wrt #378181 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
Diffstat (limited to 'games-strategy/widelands')
-rw-r--r--games-strategy/widelands/ChangeLog6
-rw-r--r--games-strategy/widelands/files/widelands-0.16-libpng15.patch61
-rw-r--r--games-strategy/widelands/widelands-0.16.ebuild6
3 files changed, 70 insertions, 3 deletions
diff --git a/games-strategy/widelands/ChangeLog b/games-strategy/widelands/ChangeLog
index bb02fc10fa78..575929d93c83 100644
--- a/games-strategy/widelands/ChangeLog
+++ b/games-strategy/widelands/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for games-strategy/widelands
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-strategy/widelands/ChangeLog,v 1.35 2011/08/11 21:40:00 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/widelands/ChangeLog,v 1.36 2011/09/15 03:32:59 ssuominen Exp $
+
+ 15 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> widelands-0.16.ebuild,
+ +files/widelands-0.16-libpng15.patch:
+ Fix building with libpng15 wrt #378181 by Diego Elio Pettenò
11 Aug 2011; Michael Sterrett <mr_bones_@gentoo.org> widelands-0.16.ebuild:
games goes last on inherit line; tidy
diff --git a/games-strategy/widelands/files/widelands-0.16-libpng15.patch b/games-strategy/widelands/files/widelands-0.16-libpng15.patch
new file mode 100644
index 000000000000..9f733e7b97aa
--- /dev/null
+++ b/games-strategy/widelands/files/widelands-0.16-libpng15.patch
@@ -0,0 +1,61 @@
+--- src/graphic/SDL_mng.cc
++++ src/graphic/SDL_mng.cc
+@@ -276,7 +276,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))) {
+ SDL_SetError("Error reading the PNG file.");
+ goto done;
+ }
+@@ -356,9 +356,9 @@
+ 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 const s = (info_ptr->channels == 4) ? 0 : 8;
++ int const s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8;
+ Rmask = 0xFF000000 >> s;
+ Gmask = 0x00FF0000 >> s;
+ Bmask = 0x0000FF00 >> s;
+@@ -369,7 +369,7 @@
+ SDL_AllocSurface
+ (SDL_SWSURFACE,
+ width, height,
+- bit_depth * info_ptr->channels,
++ bit_depth * png_get_channels(png_ptr, info_ptr),
+ Rmask, Gmask, Bmask, Amask);
+ if (not surface) {
+ SDL_SetError("Out of memory");
+@@ -407,6 +407,9 @@
+ /* read rest of file, get additional chunks in info_ptr - REQUIRED */
+ png_read_end(png_ptr, info_ptr);
+
++ png_colorp png_palette;
++ int png_num_palette;
++
+ /* Load the palette, if any */
+ if ((palette = surface->format->palette)) {
+ if (color_type == PNG_COLOR_TYPE_GRAY) {
+@@ -416,12 +419,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 (uint32_t 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 (uint32_t 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;
+ }
+ }
+ }
diff --git a/games-strategy/widelands/widelands-0.16.ebuild b/games-strategy/widelands/widelands-0.16.ebuild
index bb9ed1e33041..375d7efe757c 100644
--- a/games-strategy/widelands/widelands-0.16.ebuild
+++ b/games-strategy/widelands/widelands-0.16.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/games-strategy/widelands/widelands-0.16.ebuild,v 1.2 2011/08/11 21:40:00 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/widelands/widelands-0.16.ebuild,v 1.3 2011/09/15 03:32:59 ssuominen Exp $
EAPI=3
inherit versionator cmake-utils games
@@ -36,7 +36,9 @@ src_prepare() {
sed -i \
-e 's:__ppc__:__PPC__:' src/s2map.cc \
|| die "sed s2map.cc failed"
- epatch "${FILESDIR}"/${P}-goldmine.patch
+ epatch \
+ "${FILESDIR}"/${P}-goldmine.patch \
+ "${FILESDIR}"/${P}-libpng15.patch
}
src_configure() {