1 |
commit: e64498a11278374b3ea04983586a0ab8f599406e |
2 |
Author: Sebastian Pipping <sping <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 11 19:10:43 2015 +0000 |
4 |
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 11 19:11:41 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e64498a1 |
7 |
|
8 |
media-gfx/optipng: Apply upstream patch for bug #561882 |
9 |
|
10 |
Package-Manager: portage-2.2.23 |
11 |
|
12 |
.../optipng/files/optipng-0.7.5-gifread.patch | 12 +++++ |
13 |
media-gfx/optipng/optipng-0.7.5-r1.ebuild | 57 ++++++++++++++++++++++ |
14 |
2 files changed, 69 insertions(+) |
15 |
|
16 |
diff --git a/media-gfx/optipng/files/optipng-0.7.5-gifread.patch b/media-gfx/optipng/files/optipng-0.7.5-gifread.patch |
17 |
new file mode 100644 |
18 |
index 0000000..14b3719 |
19 |
--- /dev/null |
20 |
+++ b/media-gfx/optipng/files/optipng-0.7.5-gifread.patch |
21 |
@@ -0,0 +1,12 @@ |
22 |
+diff --git a/src/gifread/gifread.c b/src/gifread/gifread.c |
23 |
+index b24aa6e..2896493 100644 |
24 |
+--- a/src/gifread/gifread.c |
25 |
++++ b/src/gifread/gifread.c |
26 |
+@@ -357,6 +357,7 @@ static int LZWGetCode(int code_size, int init_flag, FILE *stream) |
27 |
+ { |
28 |
+ curbit = 0; |
29 |
+ lastbit = 0; |
30 |
++ last_byte = 2; |
31 |
+ done = LZW_FALSE; |
32 |
+ return 0; |
33 |
+ } |
34 |
|
35 |
diff --git a/media-gfx/optipng/optipng-0.7.5-r1.ebuild b/media-gfx/optipng/optipng-0.7.5-r1.ebuild |
36 |
new file mode 100644 |
37 |
index 0000000..b3b4528 |
38 |
--- /dev/null |
39 |
+++ b/media-gfx/optipng/optipng-0.7.5-r1.ebuild |
40 |
@@ -0,0 +1,57 @@ |
41 |
+# Copyright 1999-2015 Gentoo Foundation |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+# $Id$ |
44 |
+ |
45 |
+EAPI=4 |
46 |
+ |
47 |
+inherit eutils toolchain-funcs |
48 |
+ |
49 |
+DESCRIPTION="Compress PNG files without affecting image quality" |
50 |
+HOMEPAGE="http://optipng.sourceforge.net/" |
51 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
52 |
+ |
53 |
+LICENSE="ZLIB" |
54 |
+SLOT="0" |
55 |
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris" |
56 |
+IUSE="" |
57 |
+ |
58 |
+RDEPEND="sys-libs/zlib |
59 |
+ media-libs/libpng:0" |
60 |
+DEPEND="${RDEPEND} |
61 |
+ sys-apps/findutils" |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ epatch "${FILESDIR}"/${P}-gifread.patch # bug #561882 |
65 |
+ epatch "${FILESDIR}"/${P}-estonian.patch |
66 |
+ |
67 |
+ rm -R src/{libpng,zlib} || die |
68 |
+ find . -type d -name build -exec rm -R {} + || die |
69 |
+ |
70 |
+ # next release is almost a complete rewrite, so plug this compilation |
71 |
+ # problem in anticipation of the much (c)leaner(?) rewrite |
72 |
+ sed -i \ |
73 |
+ -e 's/^#ifdef AT_FDCWD/#if defined(AT_FDCWD) \&\& !(defined (__SVR4) \&\& defined (__sun))/' \ |
74 |
+ src/optipng/osys.c || die |
75 |
+ |
76 |
+ tc-export CC AR RANLIB |
77 |
+ export LD=$(tc-getCC) |
78 |
+} |
79 |
+ |
80 |
+src_configure() { |
81 |
+ ./configure \ |
82 |
+ -with-system-libpng \ |
83 |
+ -with-system-zlib \ |
84 |
+ || die "configure failed" |
85 |
+} |
86 |
+ |
87 |
+src_compile() { |
88 |
+ emake -C src/optipng |
89 |
+} |
90 |
+ |
91 |
+src_install() { |
92 |
+ dodoc README.txt doc/*.txt |
93 |
+ dohtml doc/*.html |
94 |
+ doman src/${PN}/man/${PN}.1 |
95 |
+ |
96 |
+ dobin src/${PN}/${PN} |
97 |
+} |