1 |
commit: cba3797d92767648c2a35c431a38a5ec8300b923 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 31 20:51:02 2016 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 31 20:51:02 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cba3797d |
7 |
|
8 |
app-text/poppler: Backport two crash fixes from upstream git |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
.../poppler/files/poppler-0.46.0-crashfix-1.patch | 36 +++++ |
13 |
.../poppler/files/poppler-0.46.0-crashfix-2.patch | 41 ++++++ |
14 |
app-text/poppler/poppler-0.46.0-r1.ebuild | 145 +++++++++++++++++++++ |
15 |
3 files changed, 222 insertions(+) |
16 |
|
17 |
diff --git a/app-text/poppler/files/poppler-0.46.0-crashfix-1.patch b/app-text/poppler/files/poppler-0.46.0-crashfix-1.patch |
18 |
new file mode 100644 |
19 |
index 0000000..6d2352b |
20 |
--- /dev/null |
21 |
+++ b/app-text/poppler/files/poppler-0.46.0-crashfix-1.patch |
22 |
@@ -0,0 +1,36 @@ |
23 |
+From 7d3aea760a14a73962e429059f73d97391660367 Mon Sep 17 00:00:00 2001 |
24 |
+From: Albert Astals Cid <aacid@×××.org> |
25 |
+Date: Sat, 30 Jul 2016 17:32:59 +0200 |
26 |
+Subject: [PATCH 1/2] Fix abort on documents where the docinfo obj is not a |
27 |
+ dict |
28 |
+ |
29 |
+Bug #97134 |
30 |
+--- |
31 |
+ poppler/PDFDoc.cc | 4 ++-- |
32 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
33 |
+ |
34 |
+diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc |
35 |
+index c91d6e4..a51d8b6 100644 |
36 |
+--- a/poppler/PDFDoc.cc |
37 |
++++ b/poppler/PDFDoc.cc |
38 |
+@@ -14,7 +14,7 @@ |
39 |
+ // under GPL version 2 or later |
40 |
+ // |
41 |
+ // Copyright (C) 2005, 2006, 2008 Brad Hards <bradh@×××××××××.net> |
42 |
+-// Copyright (C) 2005, 2007-2009, 2011-2015 Albert Astals Cid <aacid@×××.org> |
43 |
++// Copyright (C) 2005, 2007-2009, 2011-2016 Albert Astals Cid <aacid@×××.org> |
44 |
+ // Copyright (C) 2008 Julien Rebetez <julienr@×××××××××.org> |
45 |
+ // Copyright (C) 2008, 2010 Pino Toscano <pino@×××.org> |
46 |
+ // Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <carlosgc@×××××.org> |
47 |
+@@ -646,7 +646,7 @@ void PDFDoc::setDocInfoStringEntry(const char *key, GooString *value) |
48 |
+ GooString *PDFDoc::getDocInfoStringEntry(const char *key) { |
49 |
+ Object infoObj; |
50 |
+ getDocInfo(&infoObj); |
51 |
+- if (infoObj.isNull()) { |
52 |
++ if (!infoObj.isDict()) { |
53 |
+ return NULL; |
54 |
+ } |
55 |
+ |
56 |
+-- |
57 |
+2.9.1 |
58 |
+ |
59 |
|
60 |
diff --git a/app-text/poppler/files/poppler-0.46.0-crashfix-2.patch b/app-text/poppler/files/poppler-0.46.0-crashfix-2.patch |
61 |
new file mode 100644 |
62 |
index 0000000..3c2aa0a |
63 |
--- /dev/null |
64 |
+++ b/app-text/poppler/files/poppler-0.46.0-crashfix-2.patch |
65 |
@@ -0,0 +1,41 @@ |
66 |
+From 3f5c84e17acfa71dfd44514384398f5a4c449630 Mon Sep 17 00:00:00 2001 |
67 |
+From: Albert Astals Cid <aacid@×××.org> |
68 |
+Date: Sat, 30 Jul 2016 17:50:42 +0200 |
69 |
+Subject: [PATCH 2/2] Check for XRefEntry existing before using it |
70 |
+ |
71 |
+Bug #97005 |
72 |
+--- |
73 |
+ poppler/Hints.cc | 10 ++++++++-- |
74 |
+ 1 file changed, 8 insertions(+), 2 deletions(-) |
75 |
+ |
76 |
+diff --git a/poppler/Hints.cc b/poppler/Hints.cc |
77 |
+index bdd0d32..6c2fc25 100644 |
78 |
+--- a/poppler/Hints.cc |
79 |
++++ b/poppler/Hints.cc |
80 |
+@@ -5,7 +5,7 @@ |
81 |
+ // This file is licensed under the GPLv2 or later |
82 |
+ // |
83 |
+ // Copyright 2010, 2012 Hib Eris <hib@×××××××.nl> |
84 |
+-// Copyright 2010, 2011, 2013, 2014 Albert Astals Cid <aacid@×××.org> |
85 |
++// Copyright 2010, 2011, 2013, 2014, 2016 Albert Astals Cid <aacid@×××.org> |
86 |
+ // Copyright 2010, 2013 Pino Toscano <pino@×××.org> |
87 |
+ // Copyright 2013 Adrian Johnson <ajohnson@×××××××.com> |
88 |
+ // Copyright 2014 Fabio D'Urso <fabiodurso@×××××××.it> |
89 |
+@@ -43,7 +43,13 @@ Hints::Hints(BaseStream *str, Linearization *linearization, XRef *xref, Security |
90 |
+ pageObjectFirst); |
91 |
+ pageObjectFirst = 0; |
92 |
+ } |
93 |
+- pageOffsetFirst = xref->getEntry(pageObjectFirst)->offset; |
94 |
++ XRefEntry *pageObjectFirstXRefEntry = xref->getEntry(pageObjectFirst); |
95 |
++ if (!pageObjectFirstXRefEntry) { |
96 |
++ error(errSyntaxWarning, -1, "No XRef entry for first page object"); |
97 |
++ pageOffsetFirst = 0; |
98 |
++ } else { |
99 |
++ pageOffsetFirst = pageObjectFirstXRefEntry->offset; |
100 |
++ } |
101 |
+ |
102 |
+ if (nPages >= INT_MAX / (int)sizeof(Guint)) { |
103 |
+ error(errSyntaxWarning, -1, "Invalid number of pages ({0:d}) for hints table", nPages); |
104 |
+-- |
105 |
+2.9.1 |
106 |
+ |
107 |
|
108 |
diff --git a/app-text/poppler/poppler-0.46.0-r1.ebuild b/app-text/poppler/poppler-0.46.0-r1.ebuild |
109 |
new file mode 100644 |
110 |
index 0000000..fcc7008 |
111 |
--- /dev/null |
112 |
+++ b/app-text/poppler/poppler-0.46.0-r1.ebuild |
113 |
@@ -0,0 +1,145 @@ |
114 |
+# Copyright 1999-2016 Gentoo Foundation |
115 |
+# Distributed under the terms of the GNU General Public License v2 |
116 |
+# $Id$ |
117 |
+ |
118 |
+EAPI=6 |
119 |
+ |
120 |
+inherit cmake-utils toolchain-funcs xdg-utils |
121 |
+ |
122 |
+if [[ "${PV}" == "9999" ]] ; then |
123 |
+ inherit git-r3 |
124 |
+ EGIT_REPO_URI="git://git.freedesktop.org/git/${PN}/${PN}" |
125 |
+ SLOT="0/9999" |
126 |
+else |
127 |
+ SRC_URI="https://poppler.freedesktop.org/${P}.tar.xz" |
128 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
129 |
+ SLOT="0/63" # CHECK THIS WHEN BUMPING!!! SUBSLOT IS libpoppler.so SOVERSION |
130 |
+fi |
131 |
+ |
132 |
+DESCRIPTION="PDF rendering library based on the xpdf-3.0 code base" |
133 |
+HOMEPAGE="https://poppler.freedesktop.org/" |
134 |
+ |
135 |
+LICENSE="GPL-2" |
136 |
+IUSE="cairo cairo-qt cjk curl cxx debug doc +introspection +jpeg +jpeg2k +lcms nss png qt4 qt5 tiff +utils" |
137 |
+ |
138 |
+REQUIRED_USE="cairo-qt? ( qt4 )" |
139 |
+ |
140 |
+# No test data provided |
141 |
+RESTRICT="test" |
142 |
+ |
143 |
+COMMON_DEPEND=" |
144 |
+ >=media-libs/fontconfig-2.6.0 |
145 |
+ >=media-libs/freetype-2.3.9 |
146 |
+ sys-libs/zlib |
147 |
+ cairo? ( |
148 |
+ dev-libs/glib:2 |
149 |
+ >=x11-libs/cairo-1.10.0 |
150 |
+ introspection? ( >=dev-libs/gobject-introspection-1.32.1:= ) |
151 |
+ ) |
152 |
+ cairo-qt? ( >=x11-libs/cairo-1.10.0 ) |
153 |
+ curl? ( net-misc/curl ) |
154 |
+ jpeg? ( virtual/jpeg:0 ) |
155 |
+ jpeg2k? ( media-libs/openjpeg:2= ) |
156 |
+ lcms? ( media-libs/lcms:2 ) |
157 |
+ nss? ( >=dev-libs/nss-3.19:0 ) |
158 |
+ png? ( media-libs/libpng:0= ) |
159 |
+ qt4? ( |
160 |
+ dev-qt/qtcore:4 |
161 |
+ dev-qt/qtgui:4 |
162 |
+ ) |
163 |
+ qt5? ( |
164 |
+ dev-qt/qtcore:5 |
165 |
+ dev-qt/qtgui:5 |
166 |
+ dev-qt/qtxml:5 |
167 |
+ ) |
168 |
+ tiff? ( media-libs/tiff:0 ) |
169 |
+" |
170 |
+DEPEND="${COMMON_DEPEND} |
171 |
+ virtual/pkgconfig |
172 |
+" |
173 |
+RDEPEND="${COMMON_DEPEND} |
174 |
+ cjk? ( >=app-text/poppler-data-0.4.7 ) |
175 |
+" |
176 |
+ |
177 |
+DOCS=(AUTHORS NEWS README README-XPDF TODO) |
178 |
+ |
179 |
+PATCHES=( |
180 |
+ "${FILESDIR}/${PN}-0.26.0-qt5-dependencies.patch" |
181 |
+ "${FILESDIR}/${PN}-0.28.1-fix-multilib-configuration.patch" |
182 |
+ "${FILESDIR}/${PN}-0.28.1-respect-cflags.patch" |
183 |
+ "${FILESDIR}/${PN}-0.33.0-openjpeg2.patch" |
184 |
+ "${FILESDIR}/${PN}-0.40-FindQt4.patch" |
185 |
+ "${FILESDIR}/${P}-crashfix-1.patch" |
186 |
+ "${FILESDIR}/${P}-crashfix-2.patch" |
187 |
+) |
188 |
+ |
189 |
+src_prepare() { |
190 |
+ cmake-utils_src_prepare |
191 |
+ |
192 |
+ # Clang doesn't grok this flag, the configure nicely tests that, but |
193 |
+ # cmake just uses it, so remove it if we use clang |
194 |
+ if [[ ${CC} == clang ]] ; then |
195 |
+ sed -i -e 's/-fno-check-new//' cmake/modules/PopplerMacros.cmake || die |
196 |
+ fi |
197 |
+ |
198 |
+ # Enable experimental patchset for subpixel font rendering using cairo |
199 |
+ # backend for poppler-qt4 from https://github.com/giddie/poppler-qt4-cairo-backend. |
200 |
+ if use cairo-qt; then |
201 |
+ ewarn "Enabling unsupported, experimental cairo-qt patchset. Please do not report bugs." |
202 |
+ epatch "${FILESDIR}/cairo-qt-experimental/0001-Cairo-backend-added-to-Qt4-wrapper.patch" |
203 |
+ epatch "${FILESDIR}/cairo-qt-experimental/0002-Setting-default-Qt4-backend-to-Cairo.patch" |
204 |
+ epatch "${FILESDIR}/cairo-qt-experimental/0003-Forcing-subpixel-rendering-in-Cairo-backend.patch" |
205 |
+ epatch "${FILESDIR}/cairo-qt-experimental/0004-Enabling-slight-hinting-in-Cairo-Backend.patch" |
206 |
+ fi |
207 |
+} |
208 |
+ |
209 |
+src_configure() { |
210 |
+ xdg_environment_reset |
211 |
+ local mycmakeargs=( |
212 |
+ -DBUILD_GTK_TESTS=OFF |
213 |
+ -DBUILD_QT4_TESTS=OFF |
214 |
+ -DBUILD_QT5_TESTS=OFF |
215 |
+ -DBUILD_CPP_TESTS=OFF |
216 |
+ -DENABLE_SPLASH=ON |
217 |
+ -DENABLE_ZLIB=ON |
218 |
+ -DENABLE_ZLIB_UNCOMPRESS=OFF |
219 |
+ -DENABLE_XPDF_HEADERS=ON |
220 |
+ -DENABLE_LIBCURL="$(usex curl)" |
221 |
+ -DENABLE_CPP="$(usex cxx)" |
222 |
+ -DENABLE_UTILS="$(usex utils)" |
223 |
+ -DSPLASH_CMYK=OFF |
224 |
+ -DUSE_FIXEDPOINT=OFF |
225 |
+ -DUSE_FLOAT=OFF |
226 |
+ -DWITH_Cairo="$(usex cairo)" |
227 |
+ -DWITH_GObjectIntrospection="$(usex introspection)" |
228 |
+ -DWITH_JPEG="$(usex jpeg)" |
229 |
+ -DWITH_NSS3="$(usex nss)" |
230 |
+ -DWITH_PNG="$(usex png)" |
231 |
+ -DWITH_Qt4="$(usex qt4)" |
232 |
+ $(cmake-utils_use_find_package qt5 Qt5Core) |
233 |
+ -DWITH_TIFF="$(usex tiff)" |
234 |
+ ) |
235 |
+ if use jpeg2k; then |
236 |
+ mycmakeargs+=(-DENABLE_LIBOPENJPEG=openjpeg2) |
237 |
+ else |
238 |
+ mycmakeargs+=(-DENABLE_LIBOPENJPEG=) |
239 |
+ fi |
240 |
+ if use lcms; then |
241 |
+ mycmakeargs+=(-DENABLE_CMS=lcms2) |
242 |
+ else |
243 |
+ mycmakeargs+=(-DENABLE_CMS=) |
244 |
+ fi |
245 |
+ |
246 |
+ cmake-utils_src_configure |
247 |
+} |
248 |
+ |
249 |
+src_install() { |
250 |
+ cmake-utils_src_install |
251 |
+ |
252 |
+ # live version doesn't provide html documentation |
253 |
+ if use cairo && use doc && [[ ${PV} != 9999 ]]; then |
254 |
+ # For now install gtk-doc there |
255 |
+ insinto /usr/share/gtk-doc/html/poppler |
256 |
+ doins -r "${S}"/glib/reference/html/* |
257 |
+ fi |
258 |
+} |