diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2011-08-09 09:10:30 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2011-08-09 09:10:30 +0000 |
commit | c725502778b8f221d77c8b1dd3d4a2d3bb27c18e (patch) | |
tree | 14293a881f9181f46dbc28417b32822be221e6a4 /media-libs/stimg | |
parent | Missing -lz since for example, gzopen is used. Missing zlib.h include wrt #37... (diff) | |
download | gentoo-2-c725502778b8f221d77c8b1dd3d4a2d3bb27c18e.tar.gz gentoo-2-c725502778b8f221d77c8b1dd3d4a2d3bb27c18e.tar.bz2 gentoo-2-c725502778b8f221d77c8b1dd3d4a2d3bb27c18e.zip |
Fix building with libpng15 wrt #378355 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha50/cvs/Linux x86_64)
Diffstat (limited to 'media-libs/stimg')
-rw-r--r-- | media-libs/stimg/ChangeLog | 8 | ||||
-rw-r--r-- | media-libs/stimg/files/stimg-0.1.0-libpng15.patch | 37 | ||||
-rw-r--r-- | media-libs/stimg/stimg-0.1.0.ebuild | 23 |
3 files changed, 56 insertions, 12 deletions
diff --git a/media-libs/stimg/ChangeLog b/media-libs/stimg/ChangeLog index a33f6b55b0c2..ddbb7d2ea94f 100644 --- a/media-libs/stimg/ChangeLog +++ b/media-libs/stimg/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-libs/stimg -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/stimg/ChangeLog,v 1.11 2010/11/08 23:20:19 maekke Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/stimg/ChangeLog,v 1.12 2011/08/09 09:10:30 ssuominen Exp $ + + 09 Aug 2011; Samuli Suominen <ssuominen@gentoo.org> stimg-0.1.0.ebuild, + +files/stimg-0.1.0-libpng15.patch: + Fix building with libpng15 wrt #378355 by Diego Elio Pettenò 08 Nov 2010; Markus Meier <maekke@gentoo.org> stimg-0.1.0.ebuild: change jpeg dep to virtual/jpeg diff --git a/media-libs/stimg/files/stimg-0.1.0-libpng15.patch b/media-libs/stimg/files/stimg-0.1.0-libpng15.patch new file mode 100644 index 000000000000..41ae138f1b1f --- /dev/null +++ b/media-libs/stimg/files/stimg-0.1.0-libpng15.patch @@ -0,0 +1,37 @@ +--- src/png.c ++++ src/png.c +@@ -102,8 +102,8 @@ + 0x00, + NULL); + +- alpha = (info_ptr->channels == 4 || info_ptr->channels == 2) ? 1: 0; +- image = stimg_new(info_ptr->width, info_ptr->height, alpha); ++ alpha = (png_get_channels(png_ptr, info_ptr) == 4 || png_get_channels(png_ptr, info_ptr) == 2) ? 1: 0; ++ image = stimg_new(png_get_image_width(png_ptr, info_ptr), png_get_image_height(png_ptr, info_ptr), alpha); + + if (image == NULL) { + png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); +@@ -112,18 +112,18 @@ + } + + row_pointers = png_get_rows(png_ptr, info_ptr); +- row_size = info_ptr->width * (3 + alpha); ++ row_size = png_get_image_width(png_ptr, info_ptr) * (3 + alpha); + data = stimg_get_data(image); +- if (info_ptr->channels > 2) { +- for (i = 0; i < info_ptr->height; i++) { ++ if (png_get_channels(png_ptr, info_ptr) > 2) { ++ for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) { + memcpy(data + row_size * i, row_pointers[i], row_size); + } + } else { + unsigned char *buf = data; + int x; +- for (i = 0; i < info_ptr->height; i++) { ++ for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) { + x = 0; +- for (j = 0; j < info_ptr->width; j++) { ++ for (j = 0; j < png_get_image_width(png_ptr, info_ptr); j++) { + buf[0] = buf[1] = buf[2] = row_pointers[i][x]; + if (alpha) { + buf[3] = row_pointers[i][++x]; diff --git a/media-libs/stimg/stimg-0.1.0.ebuild b/media-libs/stimg/stimg-0.1.0.ebuild index 6bc501d5c0d4..bb9c448dd956 100644 --- a/media-libs/stimg/stimg-0.1.0.ebuild +++ b/media-libs/stimg/stimg-0.1.0.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/stimg/stimg-0.1.0.ebuild,v 1.11 2010/11/08 23:20:19 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/stimg/stimg-0.1.0.ebuild,v 1.12 2011/08/09 09:10:30 ssuominen Exp $ -EAPI=2 -inherit toolchain-funcs +EAPI=4 +inherit eutils toolchain-funcs DESCRIPTION="Simple and tiny image loading library" HOMEPAGE="http://homepage3.nifty.com/slokar/fb/" @@ -19,16 +19,19 @@ RDEPEND="media-libs/libpng virtual/jpeg" DEPEND="${RDEPEND}" +DOCS=( AUTHORS ) + +src_prepare() { + epatch "${FILESDIR}"/${P}-libpng15.patch +} + src_configure() { tc-export CC - econf \ - $(use_enable static-libs static) + econf $(use_enable static-libs static) } src_install() { - emake DESTDIR="${D}" install || die - find "${D}" -name '*.la' -delete - - dodoc AUTHORS + default + find "${D}" -name '*.la' -exec rm -f {} + use linguas_ja && dodoc README.ja } |