commit:     e64498a11278374b3ea04983586a0ab8f599406e
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 19:10:43 2015 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sun Oct 11 19:11:41 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e64498a1

media-gfx/optipng: Apply upstream patch for bug #561882

Package-Manager: portage-2.2.23

 .../optipng/files/optipng-0.7.5-gifread.patch      | 12 +++++
 media-gfx/optipng/optipng-0.7.5-r1.ebuild          | 57 ++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/media-gfx/optipng/files/optipng-0.7.5-gifread.patch 
b/media-gfx/optipng/files/optipng-0.7.5-gifread.patch
new file mode 100644
index 0000000..14b3719
--- /dev/null
+++ b/media-gfx/optipng/files/optipng-0.7.5-gifread.patch
@@ -0,0 +1,12 @@
+diff --git a/src/gifread/gifread.c b/src/gifread/gifread.c
+index b24aa6e..2896493 100644
+--- a/src/gifread/gifread.c
++++ b/src/gifread/gifread.c
+@@ -357,6 +357,7 @@ static int LZWGetCode(int code_size, int init_flag, FILE 
*stream)
+     {
+         curbit = 0;
+         lastbit = 0;
++        last_byte = 2;
+         done = LZW_FALSE;
+         return 0;
+     }

diff --git a/media-gfx/optipng/optipng-0.7.5-r1.ebuild 
b/media-gfx/optipng/optipng-0.7.5-r1.ebuild
new file mode 100644
index 0000000..b3b4528
--- /dev/null
+++ b/media-gfx/optipng/optipng-0.7.5-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Compress PNG files without affecting image quality"
+HOMEPAGE="http://optipng.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux 
~ppc-macos ~x86-macos ~x86-solaris"
+IUSE=""
+
+RDEPEND="sys-libs/zlib
+       media-libs/libpng:0"
+DEPEND="${RDEPEND}
+       sys-apps/findutils"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-gifread.patch  # bug #561882
+       epatch "${FILESDIR}"/${P}-estonian.patch
+
+       rm -R src/{libpng,zlib} || die
+       find . -type d -name build -exec rm -R {} + || die
+
+       # next release is almost a complete rewrite, so plug this compilation
+       # problem in anticipation of the much (c)leaner(?) rewrite
+       sed -i \
+               -e 's/^#ifdef AT_FDCWD/#if defined(AT_FDCWD) \&\& !(defined 
(__SVR4) \&\& defined (__sun))/' \
+               src/optipng/osys.c || die
+
+       tc-export CC AR RANLIB
+       export LD=$(tc-getCC)
+}
+
+src_configure() {
+       ./configure \
+               -with-system-libpng \
+               -with-system-zlib \
+               || die "configure failed"
+}
+
+src_compile() {
+       emake -C src/optipng
+}
+
+src_install() {
+       dodoc README.txt doc/*.txt
+       dohtml doc/*.html
+       doman src/${PN}/man/${PN}.1
+
+       dobin src/${PN}/${PN}
+}

Reply via email to