Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/poppler/files/, app-text/poppler/
Date: Tue, 30 May 2017 19:47:48
Message-Id: 1496173658.6376e44deab97a83ce365b4b71b1a5db468f52a6.dilfridge@gentoo
1 commit: 6376e44deab97a83ce365b4b71b1a5db468f52a6
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 30 19:47:26 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Tue May 30 19:47:38 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6376e44d
7
8 app-text/poppler: Revision bump for bug 620198
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 .../files/poppler-0.55.0-CVE-2017-7511.patch | 57 +++++++++
13 app-text/poppler/poppler-0.55.0-r1.ebuild | 137 +++++++++++++++++++++
14 2 files changed, 194 insertions(+)
15
16 diff --git a/app-text/poppler/files/poppler-0.55.0-CVE-2017-7511.patch b/app-text/poppler/files/poppler-0.55.0-CVE-2017-7511.patch
17 new file mode 100644
18 index 00000000000..64df1cfde43
19 --- /dev/null
20 +++ b/app-text/poppler/files/poppler-0.55.0-CVE-2017-7511.patch
21 @@ -0,0 +1,57 @@
22 +From 5c9b08a875b07853be6c44e43ff5f7f059df666a Mon Sep 17 00:00:00 2001
23 +From: Albert Astals Cid <aacid@×××.org>
24 +Date: Sat, 27 May 2017 00:09:17 +0200
25 +Subject: pdfunite: Fix crash with broken documents
26 +
27 +Sometimes we can't parse pages so check before accessing them
28 +
29 +Thanks to Jiaqi Peng for the report
30 +
31 +Fixes bugs #101153 and #101149
32 +
33 +diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
34 +index dfe48bf..c32e201 100644
35 +--- a/utils/pdfunite.cc
36 ++++ b/utils/pdfunite.cc
37 +@@ -7,7 +7,7 @@
38 + // Copyright (C) 2011-2015, 2017 Thomas Freitag <Thomas.Freitag@××××.de>
39 + // Copyright (C) 2012 Arseny Solokha <asolokha@×××.com>
40 + // Copyright (C) 2012 Fabio D'Urso <fabiodurso@×××××××.it>
41 +-// Copyright (C) 2012, 2014 Albert Astals Cid <aacid@×××.org>
42 ++// Copyright (C) 2012, 2014, 2017 Albert Astals Cid <aacid@×××.org>
43 + // Copyright (C) 2013 Adrian Johnson <ajohnson@×××××××.com>
44 + // Copyright (C) 2013 Hib Eris <hib@×××××××.nl>
45 + // Copyright (C) 2015 Arthur Stavisky <vovodroid@×××××.com>
46 +@@ -268,15 +268,15 @@ int main (int argc, char *argv[])
47 + catDict->lookup("OutputIntents", &intents);
48 + catDict->lookupNF("AcroForm", &afObj);
49 + Ref *refPage = docs[0]->getCatalog()->getPageRef(1);
50 +- if (!afObj.isNull()) {
51 ++ if (!afObj.isNull() && refPage) {
52 + docs[0]->markAcroForm(&afObj, yRef, countRef, 0, refPage->num, refPage->num);
53 + }
54 + catDict->lookupNF("OCProperties", &ocObj);
55 +- if (!ocObj.isNull() && ocObj.isDict()) {
56 ++ if (!ocObj.isNull() && ocObj.isDict() && refPage) {
57 + docs[0]->markPageObjects(ocObj.getDict(), yRef, countRef, 0, refPage->num, refPage->num);
58 + }
59 + catDict->lookup("Names", &names);
60 +- if (!names.isNull() && names.isDict()) {
61 ++ if (!names.isNull() && names.isDict() && refPage) {
62 + docs[0]->markPageObjects(names.getDict(), yRef, countRef, 0, refPage->num, refPage->num);
63 + }
64 + if (intents.isArray() && intents.arrayGetLength() > 0) {
65 +@@ -353,6 +353,10 @@ int main (int argc, char *argv[])
66 +
67 + for (i = 0; i < (int) docs.size(); i++) {
68 + for (j = 1; j <= docs[i]->getNumPages(); j++) {
69 ++ if (!docs[i]->getCatalog()->getPage(j)) {
70 ++ continue;
71 ++ }
72 ++
73 + PDFRectangle *cropBox = NULL;
74 + if (docs[i]->getCatalog()->getPage(j)->isCropped())
75 + cropBox = docs[i]->getCatalog()->getPage(j)->getCropBox();
76 +--
77 +cgit v0.10.2
78 +
79
80 diff --git a/app-text/poppler/poppler-0.55.0-r1.ebuild b/app-text/poppler/poppler-0.55.0-r1.ebuild
81 new file mode 100644
82 index 00000000000..df90008fc25
83 --- /dev/null
84 +++ b/app-text/poppler/poppler-0.55.0-r1.ebuild
85 @@ -0,0 +1,137 @@
86 +# Copyright 1999-2017 Gentoo Foundation
87 +# Distributed under the terms of the GNU General Public License v2
88 +
89 +EAPI=6
90 +
91 +inherit cmake-utils toolchain-funcs xdg-utils
92 +
93 +if [[ "${PV}" == "9999" ]] ; then
94 + inherit git-r3
95 + EGIT_REPO_URI="git://git.freedesktop.org/git/${PN}/${PN}"
96 + SLOT="0/9999"
97 +else
98 + SRC_URI="https://poppler.freedesktop.org/${P}.tar.xz"
99 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
100 + SLOT="0/67" # CHECK THIS WHEN BUMPING!!! SUBSLOT IS libpoppler.so SOVERSION
101 +fi
102 +
103 +DESCRIPTION="PDF rendering library based on the xpdf-3.0 code base"
104 +HOMEPAGE="https://poppler.freedesktop.org/"
105 +
106 +LICENSE="GPL-2"
107 +IUSE="cairo cjk curl cxx debug doc +introspection +jpeg +jpeg2k +lcms nss png qt4 qt5 tiff +utils"
108 +
109 +# No test data provided
110 +RESTRICT="test"
111 +
112 +COMMON_DEPEND="
113 + >=media-libs/fontconfig-2.6.0
114 + >=media-libs/freetype-2.3.9
115 + sys-libs/zlib
116 + cairo? (
117 + dev-libs/glib:2
118 + >=x11-libs/cairo-1.10.0
119 + introspection? ( >=dev-libs/gobject-introspection-1.32.1:= )
120 + )
121 + curl? ( net-misc/curl )
122 + jpeg? ( virtual/jpeg:0 )
123 + jpeg2k? ( media-libs/openjpeg:2= )
124 + lcms? ( media-libs/lcms:2 )
125 + nss? ( >=dev-libs/nss-3.19:0 )
126 + png? ( media-libs/libpng:0= )
127 + qt4? (
128 + dev-qt/qtcore:4
129 + dev-qt/qtgui:4
130 + )
131 + qt5? (
132 + dev-qt/qtcore:5
133 + dev-qt/qtgui:5
134 + dev-qt/qtxml:5
135 + )
136 + tiff? ( media-libs/tiff:0 )
137 +"
138 +DEPEND="${COMMON_DEPEND}
139 + virtual/pkgconfig
140 +"
141 +RDEPEND="${COMMON_DEPEND}
142 + cjk? ( >=app-text/poppler-data-0.4.7 )
143 +"
144 +
145 +DOCS=(AUTHORS NEWS README README-XPDF TODO)
146 +
147 +PATCHES=(
148 + "${FILESDIR}/${PN}-0.26.0-qt5-dependencies.patch"
149 + "${FILESDIR}/${PN}-0.28.1-fix-multilib-configuration.patch"
150 + "${FILESDIR}/${PN}-0.53.0-respect-cflags.patch"
151 + "${FILESDIR}/${PN}-0.33.0-openjpeg2.patch"
152 + "${FILESDIR}/${PN}-0.40-FindQt4.patch"
153 + "${FILESDIR}/${PN}-0.55.0-CVE-2017-7511.patch"
154 +)
155 +
156 +src_prepare() {
157 + cmake-utils_src_prepare
158 +
159 + # Clang doesn't grok this flag, the configure nicely tests that, but
160 + # cmake just uses it, so remove it if we use clang
161 + if [[ ${CC} == clang ]] ; then
162 + sed -i -e 's/-fno-check-new//' cmake/modules/PopplerMacros.cmake || die
163 + fi
164 +
165 + if ! grep -Fq 'cmake_policy(SET CMP0002 OLD)' CMakeLists.txt ; then
166 + sed '/^cmake_minimum_required/acmake_policy(SET CMP0002 OLD)' \
167 + -i CMakeLists.txt || die
168 + else
169 + einfo "policy(SET CMP0002 OLD) - workaround can be removed"
170 + fi
171 +}
172 +
173 +src_configure() {
174 + xdg_environment_reset
175 + local mycmakeargs=(
176 + -DBUILD_GTK_TESTS=OFF
177 + -DBUILD_QT4_TESTS=OFF
178 + -DBUILD_QT5_TESTS=OFF
179 + -DBUILD_CPP_TESTS=OFF
180 + -DENABLE_SPLASH=ON
181 + -DENABLE_ZLIB=ON
182 + -DENABLE_ZLIB_UNCOMPRESS=OFF
183 + -DENABLE_XPDF_HEADERS=ON
184 + -DENABLE_LIBCURL="$(usex curl)"
185 + -DENABLE_CPP="$(usex cxx)"
186 + -DENABLE_UTILS="$(usex utils)"
187 + -DSPLASH_CMYK=OFF
188 + -DUSE_FIXEDPOINT=OFF
189 + -DUSE_FLOAT=OFF
190 + -DWITH_Cairo="$(usex cairo)"
191 + -DWITH_GObjectIntrospection="$(usex introspection)"
192 + -DWITH_JPEG="$(usex jpeg)"
193 + -DWITH_NSS3="$(usex nss)"
194 + -DWITH_PNG="$(usex png)"
195 + -DWITH_Qt4="$(usex qt4)"
196 + $(cmake-utils_use_find_package qt5 Qt5Core)
197 + -DWITH_TIFF="$(usex tiff)"
198 + )
199 + if use jpeg2k; then
200 + mycmakeargs+=(-DENABLE_LIBOPENJPEG=openjpeg2)
201 + else
202 + mycmakeargs+=(-DENABLE_LIBOPENJPEG=)
203 + fi
204 + if use lcms; then
205 + mycmakeargs+=(-DENABLE_CMS=lcms2)
206 + else
207 + mycmakeargs+=(-DENABLE_CMS=)
208 + fi
209 +
210 + cmake-utils_src_configure
211 +}
212 +
213 +src_install() {
214 + cmake-utils_src_install
215 +
216 + # live version doesn't provide html documentation
217 + if use cairo && use doc && [[ ${PV} != 9999 ]]; then
218 + # For now install gtk-doc there
219 + insinto /usr/share/gtk-doc/html/poppler
220 + doins -r "${S}"/glib/reference/html/*
221 + fi
222 +}