diff options
author | Thomas Beierlein <tomjbe@gentoo.org> | 2011-09-14 18:53:42 +0000 |
---|---|---|
committer | Thomas Beierlein <tomjbe@gentoo.org> | 2011-09-14 18:53:42 +0000 |
commit | 0b07bcb5a1b61164ab5bfb1d4b48a5ab0f67077e (patch) | |
tree | 27f7597bc6de2692cf04ea007d7326974def226f /media-radio/tucnak2 | |
parent | x86 stable, thanks JD, bug 379089. (diff) | |
download | gentoo-2-0b07bcb5a1b61164ab5bfb1d4b48a5ab0f67077e.tar.gz gentoo-2-0b07bcb5a1b61164ab5bfb1d4b48a5ab0f67077e.tar.bz2 gentoo-2-0b07bcb5a1b61164ab5bfb1d4b48a5ab0f67077e.zip |
Fix building with libpng15 wrt #378521 by Diego Elio Pettenò
(Portage version: 2.1.10.16/cvs/Linux x86_64)
Diffstat (limited to 'media-radio/tucnak2')
-rw-r--r-- | media-radio/tucnak2/ChangeLog | 6 | ||||
-rw-r--r-- | media-radio/tucnak2/files/tucnak2-libpng15.patch | 90 | ||||
-rw-r--r-- | media-radio/tucnak2/tucnak2-2.43.ebuild | 5 |
3 files changed, 98 insertions, 3 deletions
diff --git a/media-radio/tucnak2/ChangeLog b/media-radio/tucnak2/ChangeLog index 618672a9d839..73d326fa5bbd 100644 --- a/media-radio/tucnak2/ChangeLog +++ b/media-radio/tucnak2/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-radio/tucnak2 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-radio/tucnak2/ChangeLog,v 1.31 2011/07/17 14:37:49 tomjbe Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-radio/tucnak2/ChangeLog,v 1.32 2011/09/14 18:53:42 tomjbe Exp $ + + 14 Sep 2011; Thomas Beierlein <tomjbe@gentoo.org> + +files/tucnak2-libpng15.patch, tucnak2-2.43.ebuild: + Fix building with libpng15 wrt #378521 by Diego Elio Pettenò *tucnak2-2.43 (17 Jul 2011) diff --git a/media-radio/tucnak2/files/tucnak2-libpng15.patch b/media-radio/tucnak2/files/tucnak2-libpng15.patch new file mode 100644 index 000000000000..7470765eaae6 --- /dev/null +++ b/media-radio/tucnak2/files/tucnak2-libpng15.patch @@ -0,0 +1,90 @@ +--- src/img_png.c.old 2011-09-14 17:20:02.000000000 +0000 ++++ src/img_png.c 2011-09-14 18:17:39.000000000 +0000 +@@ -112,6 +112,8 @@ + Uint32 Bmask; + Uint32 Amask; + SDL_Palette *palette; ++ png_colorp png_palette; ++ int png_num_palette; + png_bytep *volatile row_pointers; + int row, i; + volatile int ckey = -1; +@@ -144,7 +146,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)) ) { + IMG_SetError("Error reading the PNG file."); + goto done; + } +@@ -213,9 +215,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 = (info_ptr->channels == 4) ? 0 : 8; ++ int s = (png_get_channels(png_ptr, info_ptr) == 4) ++ ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; +@@ -223,7 +227,8 @@ + } + } + 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 ) { + IMG_SetError("Out of memory"); + goto done; +@@ -264,6 +269,8 @@ + */ + + /* Load the palette, if any */ ++ png_get_PLTE(png_ptr, info_ptr, &png_palette, &png_num_palette); ++ + palette = surface->format->palette; + if ( palette ) { + if(color_type == PNG_COLOR_TYPE_GRAY) { +@@ -273,12 +280,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; + } + } + } +--- src/gfx_png.c.old 2011-09-14 17:09:33.000000000 +0000 ++++ src/gfx_png.c 2011-09-14 17:14:05.000000000 +0000 +@@ -56,12 +56,9 @@ + + png_init_io(png_ptr, fi); + +- info_ptr->width = surf->w; +- info_ptr->height = surf->h; +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_RGB; +- info_ptr->interlace_type = 1; +- info_ptr->valid = 0; ++ png_set_IHDR(png_ptr, info_ptr, surf->w, surf->h, 8, ++ PNG_COLOR_TYPE_RGB, 1, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + + /* Set headers */ + diff --git a/media-radio/tucnak2/tucnak2-2.43.ebuild b/media-radio/tucnak2/tucnak2-2.43.ebuild index e297b2db50d3..c5b87b9901e4 100644 --- a/media-radio/tucnak2/tucnak2-2.43.ebuild +++ b/media-radio/tucnak2/tucnak2-2.43.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/media-radio/tucnak2/tucnak2-2.43.ebuild,v 1.1 2011/07/17 14:37:49 tomjbe Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-radio/tucnak2/tucnak2-2.43.ebuild,v 1.2 2011/09/14 18:53:42 tomjbe Exp $ EAPI=2 inherit eutils autotools @@ -28,7 +28,8 @@ DEPEND="${RDEPEND} src_prepare() { epatch "${FILESDIR}/${PN}-2.39-doc.diff" \ - "${FILESDIR}/${PN}-2.42-appname.diff" + "${FILESDIR}/${PN}-2.42-appname.diff" \ + "${FILESDIR}/${PN}-libpng15.patch" eautoreconf } |