diff options
Diffstat (limited to 'media-libs/stimg')
-rw-r--r-- | media-libs/stimg/Manifest | 1 | ||||
-rw-r--r-- | media-libs/stimg/files/stimg-0.1.0-libpng15.patch | 37 | ||||
-rw-r--r-- | media-libs/stimg/metadata.xml | 5 | ||||
-rw-r--r-- | media-libs/stimg/stimg-0.1.0.ebuild | 37 |
4 files changed, 80 insertions, 0 deletions
diff --git a/media-libs/stimg/Manifest b/media-libs/stimg/Manifest new file mode 100644 index 000000000000..bd490c8eb44a --- /dev/null +++ b/media-libs/stimg/Manifest @@ -0,0 +1 @@ +DIST stimg-0.1.0.tar.gz 187172 SHA256 1098daac6fb37bd0135d700605d99cdbb8b8a9c9e16cdc892b3018a8534fb528 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/metadata.xml b/media-libs/stimg/metadata.xml new file mode 100644 index 000000000000..9be90a258970 --- /dev/null +++ b/media-libs/stimg/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>graphics</herd> +</pkgmetadata> diff --git a/media-libs/stimg/stimg-0.1.0.ebuild b/media-libs/stimg/stimg-0.1.0.ebuild new file mode 100644 index 000000000000..02b15e1de30a --- /dev/null +++ b/media-libs/stimg/stimg-0.1.0.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=4 +inherit eutils toolchain-funcs + +DESCRIPTION="Simple and tiny image loading library" +HOMEPAGE="http://homepage3.nifty.com/slokar/fb/" +SRC_URI="http://homepage3.nifty.com/slokar/stimg/${P}.tar.gz" + +LICENSE="LGPL-2+ MIT-with-advertising" +SLOT="0" +KEYWORDS="alpha amd64 ppc x86" +IUSE="linguas_ja static-libs" + +RDEPEND="media-libs/libpng + media-libs/tiff + virtual/jpeg" +DEPEND="${RDEPEND}" + +DOCS=( AUTHORS ) + +src_prepare() { + epatch "${FILESDIR}"/${P}-libpng15.patch +} + +src_configure() { + tc-export CC + econf $(use_enable static-libs static) +} + +src_install() { + default + find "${D}" -name '*.la' -exec rm -f {} + + use linguas_ja && dodoc README.ja +} |