Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-office/scribus/files/, app-office/scribus/
Date: Sun, 06 Nov 2016 08:26:04
Message-Id: 1478420690.31e9ab607088bf9f7ec7308f2e601d6b933372e0.jlec@gentoo
1 commit: 31e9ab607088bf9f7ec7308f2e601d6b933372e0
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Thu Oct 27 01:31:50 2016 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 6 08:24:50 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31e9ab60
7
8 app-office/scribus: Fix build w/ Qt-5.7.0 and C++11
9
10 Use upstream's WANT_CPP11
11 Drop duplicate boost DEPEND.
12 Add missing || die's
13 Add subslot operators on boost and libpng
14 Require >=boost-1.62 for C++11 per dracwyrm+Soap's advice
15
16 Package-Manager: portage-2.3.0
17
18 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
19
20 .../scribus/files/scribus-1.5.2-cmake-qt57.patch | 31 +++
21 .../scribus/files/scribus-1.5.2-cxx-build.patch | 24 +++
22 .../scribus/files/scribus-1.5.2-gcc6-warn.patch | 87 ++++++++
23 .../scribus/files/scribus-1.5.2-qt57-build.patch | 21 ++
24 app-office/scribus/scribus-1.5.2-r2.ebuild | 218 +++++++++++++++++++++
25 5 files changed, 381 insertions(+)
26
27 diff --git a/app-office/scribus/files/scribus-1.5.2-cmake-qt57.patch b/app-office/scribus/files/scribus-1.5.2-cmake-qt57.patch
28 new file mode 100644
29 index 00000000..214fab4
30 --- /dev/null
31 +++ b/app-office/scribus/files/scribus-1.5.2-cmake-qt57.patch
32 @@ -0,0 +1,31 @@
33 +commit 413c8c8a0ded5aa4b0f8d85dbc335082e809f3b2
34 +Author: Craig Bradney <mrb@×××××××.info>
35 +Date: Thu Jun 16 20:01:34 2016 +0000
36 +
37 + Add better support for C++11/Qt 5.7.0. CMAKE minimum bumped to 3.2
38 +
39 + git-svn-id: svn://scribus.net/trunk/Scribus@21377 11d20701-8431-0410-a711-e3c959e3b870
40 +
41 +diff --git a/CMakeLists.txt b/CMakeLists.txt
42 +index bc1ec57..9e92a38 100644
43 +--- a/CMakeLists.txt
44 ++++ b/CMakeLists.txt
45 +@@ -3,8 +3,9 @@
46 +
47 + #Set our CMake minimum version
48 + #Require 2.8.9 for Qt5
49 ++#Require 3.1.0 for Qt 5.7 C++ 11 easy support
50 + #Require 3.2.0 for add_custom_target with byproducts
51 +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9 FATAL_ERROR)
52 ++CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0 FATAL_ERROR)
53 +
54 + #Pretty colors
55 + SET(CMAKE_COLOR_MAKEFILE ON)
56 +@@ -382,6 +383,7 @@ ADD_DEFINITIONS("-DLIBDIR=\\\"${CMAKE_INSTALL_PREFIX}/${LIBDIR}\\\"")
57 + #C++11 Support
58 + IF(WANT_CPP11)
59 + MESSAGE(STATUS "Enabling C++11 compiler features")
60 ++ set(CMAKE_CXX_STANDARD 11)
61 + ADD_DEFINITIONS("-std=c++11")
62 + ENDIF(WANT_CPP11)
63 +
64
65 diff --git a/app-office/scribus/files/scribus-1.5.2-cxx-build.patch b/app-office/scribus/files/scribus-1.5.2-cxx-build.patch
66 new file mode 100644
67 index 00000000..da8d50d
68 --- /dev/null
69 +++ b/app-office/scribus/files/scribus-1.5.2-cxx-build.patch
70 @@ -0,0 +1,24 @@
71 +commit 1a9bdbc7ab793b15e93f1ab29ce06dd69c061f58
72 +Author: Jean Ghali <jghali@×××××××××××.fr>
73 +Date: Sat Jun 18 12:49:45 2016 +0000
74 +
75 + fix build issue when not compiling with c++11 : std::isinf is c++11 only
76 +
77 + git-svn-id: svn://scribus.net/trunk/Scribus@21382 11d20701-8431-0410-a711-e3c959e3b870
78 +
79 +diff --git a/scribus/third_party/fparser/fpoptimizer.cc b/scribus/third_party/fparser/fpoptimizer.cc
80 +index 673e1b6..0c1bad5 100644
81 +--- a/scribus/third_party/fparser/fpoptimizer.cc
82 ++++ b/scribus/third_party/fparser/fpoptimizer.cc
83 +@@ -7296,7 +7296,11 @@ namespace FPoptimizer_CodeTree
84 + //if(imm >= 0.0)
85 + {
86 + double new_base_immed = std::pow(base_immed, imm);
87 ++#if __cplusplus < 201103L
88 ++ if(isinf(new_base_immed) || new_base_immed == 0.0)
89 ++#else
90 + if(std::isinf(new_base_immed) || new_base_immed == 0.0)
91 ++#endif
92 + {
93 + // It produced an infinity. Do not change.
94 + break;
95
96 diff --git a/app-office/scribus/files/scribus-1.5.2-gcc6-warn.patch b/app-office/scribus/files/scribus-1.5.2-gcc6-warn.patch
97 new file mode 100644
98 index 00000000..224ebe4
99 --- /dev/null
100 +++ b/app-office/scribus/files/scribus-1.5.2-gcc6-warn.patch
101 @@ -0,0 +1,87 @@
102 +commit bb3066704e987210c324ec7f3bfb2c8153d9710e
103 +Author: Jean Ghali <jghali@×××××××××××.fr>
104 +Date: Sat Aug 20 12:18:31 2016 +0000
105 +
106 + fix a few gcc 6 warnings related to auto_ptr deprecation in c++11 by replacing it with QScopedPointer
107 +
108 + git-svn-id: svn://scribus.net/trunk/Scribus@21430 11d20701-8431-0410-a711-e3c959e3b870
109 +
110 +diff --git a/scribus/sclistboxpixmap.h b/scribus/sclistboxpixmap.h
111 +index 044d45a..a067b79 100644
112 +--- a/scribus/sclistboxpixmap.h
113 ++++ b/scribus/sclistboxpixmap.h
114 +@@ -13,6 +13,7 @@ for which a new license (GPL+exception) is in place.
115 + #include <QDebug>
116 + #include <QPainter>
117 + #include <QPixmap>
118 ++#include <QScopedPointer>
119 + #include <QVariant>
120 +
121 + #include "scguardedptr.h"
122 +@@ -30,19 +31,19 @@ public:
123 + virtual QSize sizeHint (const QStyleOptionViewItem & option, const QModelIndex & index ) const;
124 + virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
125 + protected:
126 +- static std::auto_ptr<QPixmap> pmap;
127 ++ static QScopedPointer<QPixmap> pmap;
128 + // The drawPixmap function must not modify pixmap size
129 + virtual void redraw(const QVariant&) const = 0;
130 + };
131 +
132 + template<unsigned int pixWidth, unsigned int pixHeight>
133 +-std::auto_ptr<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
134 ++QScopedPointer<QPixmap> ScListBoxPixmap<pixWidth, pixHeight>::pmap;
135 +
136 +
137 + template<unsigned int pixWidth, unsigned int pixHeight>
138 + ScListBoxPixmap<pixWidth, pixHeight>::ScListBoxPixmap(void) : QAbstractItemDelegate()
139 + {
140 +- if (!pmap.get())
141 ++ if (pmap.isNull())
142 + {
143 + pmap.reset( new QPixmap(pixWidth, pixHeight) );
144 + }
145 +diff --git a/scribus/ui/colorlistbox.cpp b/scribus/ui/colorlistbox.cpp
146 +index 9f3897b..99f280f 100644
147 +--- a/scribus/ui/colorlistbox.cpp
148 ++++ b/scribus/ui/colorlistbox.cpp
149 +@@ -83,7 +83,7 @@ public:
150 +
151 + void ColorSmallItemDelegate::redraw(const QVariant& data) const
152 + {
153 +- QPixmap* pPixmap = ScListBoxPixmap<15,15>::pmap.get();
154 ++ QPixmap* pPixmap = ScListBoxPixmap<15,15>::pmap.data();
155 + pPixmap->fill(Qt::transparent);
156 + if (data.canConvert<ColorPixmapValue>())
157 + {
158 +@@ -101,7 +101,7 @@ void ColorSmallItemDelegate::redraw(const QVariant& data) const
159 +
160 + void ColorWideItemDelegate::redraw(const QVariant& data) const
161 + {
162 +- QPixmap* pPixmap = ScListBoxPixmap<30,15>::pmap.get();
163 ++ QPixmap* pPixmap = ScListBoxPixmap<30,15>::pmap.data();
164 + pPixmap->fill(Qt::transparent);
165 + if (data.canConvert<ColorPixmapValue>())
166 + {
167 +@@ -134,7 +134,7 @@ void ColorFancyItemDelegate::redraw(const QVariant& data) const
168 + iconsInitialized = true;
169 + }
170 +
171 +- QPixmap* pPixmap = ScListBoxPixmap<60,15>::pmap.get();
172 ++ QPixmap* pPixmap = ScListBoxPixmap<60,15>::pmap.data();
173 + pPixmap->fill(Qt::transparent);
174 +
175 + if (data.canConvert<ColorPixmapValue>())
176 +diff --git a/scribus/ui/propertiespalette_utils.cpp b/scribus/ui/propertiespalette_utils.cpp
177 +index f76743c..cadbb11 100644
178 +--- a/scribus/ui/propertiespalette_utils.cpp
179 ++++ b/scribus/ui/propertiespalette_utils.cpp
180 +@@ -66,7 +66,7 @@ void LineFormatItemDelegate::redraw(const QVariant& data) const
181 + QColor tmpf;
182 + pmap->fill(Qt::white);
183 + QPainter p;
184 +- p.begin(pmap.get());
185 ++ p.begin(pmap.data());
186 + for (int its = item.m_Line.size()-1; its > -1; its--)
187 + {
188 + const ScColor& col = item.m_doc->PageColors[item.m_Line[its].Color];
189
190 diff --git a/app-office/scribus/files/scribus-1.5.2-qt57-build.patch b/app-office/scribus/files/scribus-1.5.2-qt57-build.patch
191 new file mode 100644
192 index 00000000..0584c29
193 --- /dev/null
194 +++ b/app-office/scribus/files/scribus-1.5.2-qt57-build.patch
195 @@ -0,0 +1,21 @@
196 +commit ddb5688ae4f4ff40ba1204a413fcf15279b35f2b
197 +Author: Franz Schmid <Franz.Schmid@×××××××××××.de>
198 +Date: Sat Jun 18 09:14:21 2016 +0000
199 +
200 + Compile Fix for compiling with Qt-5.7
201 +
202 + git-svn-id: svn://scribus.net/trunk/Scribus@21381 11d20701-8431-0410-a711-e3c959e3b870
203 +
204 +diff --git a/scribus/third_party/fparser/fpoptimizer.cc b/scribus/third_party/fparser/fpoptimizer.cc
205 +index ae8c0f6..673e1b6 100644
206 +--- a/scribus/third_party/fparser/fpoptimizer.cc
207 ++++ b/scribus/third_party/fparser/fpoptimizer.cc
208 +@@ -7296,7 +7296,7 @@ namespace FPoptimizer_CodeTree
209 + //if(imm >= 0.0)
210 + {
211 + double new_base_immed = std::pow(base_immed, imm);
212 +- if(isinf(new_base_immed) || new_base_immed == 0.0)
213 ++ if(std::isinf(new_base_immed) || new_base_immed == 0.0)
214 + {
215 + // It produced an infinity. Do not change.
216 + break;
217
218 diff --git a/app-office/scribus/scribus-1.5.2-r2.ebuild b/app-office/scribus/scribus-1.5.2-r2.ebuild
219 new file mode 100644
220 index 00000000..ec8714e
221 --- /dev/null
222 +++ b/app-office/scribus/scribus-1.5.2-r2.ebuild
223 @@ -0,0 +1,218 @@
224 +# Copyright 1999-2016 Gentoo Foundation
225 +# Distributed under the terms of the GNU General Public License v2
226 +# $Id$
227 +
228 +EAPI=6
229 +
230 +CMAKE_MIN_VERSION="3.2"
231 +PYTHON_COMPAT=( python2_7 )
232 +PYTHON_REQ_USE="tk?"
233 +CMAKE_MAKEFILE_GENERATOR=ninja
234 +
235 +inherit cmake-utils fdo-mime flag-o-matic multilib python-single-r1
236 +
237 +DESCRIPTION="Desktop publishing (DTP) and layout program"
238 +HOMEPAGE="http://www.scribus.net/"
239 +SRC_URI="mirror://sourceforge/project/${PN}/${PN}-devel/${PV}/${P}.tar.xz"
240 +
241 +LICENSE="GPL-2"
242 +SLOT="0"
243 +KEYWORDS="~amd64 ~x86"
244 +IUSE="+boost debug examples graphicsmagick hunspell +minimal osg +pdf scripts templates tk"
245 +
246 +#a=$((ls resources/translations/scribus.*ts | sed -e 's:\.: :g' | awk '{print $2}'; ls resources/loremipsum/*xml | sed -e 's:\.: :g' -e 's:loremipsum\/: :g'| awk '{print $2}'; ls resources/dicts/hyph*dic | sed -e 's:\.: :g' -e 's:hyph_: :g' | awk '{print $2}'; ls resources/dicts/README_*txt | sed -e 's:_hyph::g' -e 's:\.: :g' -e 's:README_: :g' | awk '{print $2}') | sort | uniq); echo $a
247 +IUSE_LINGUAS=" af ar bg br ca ca_ES cs cs_CZ cy cy_GB da da_DK de de@1901 de_CH de_DE el en_AU en_GB en_US eo es es_ES et eu fi fi_FI fr gl he hr hu hu_HU ia id id_ID is is_IS it ja ko ku la lt lt_LT nb_NO nl nn_NO pl pl_PL pt pt_BR pt_PT ro ro_RO ru ru_RU sa sk sk_SK sl sl_SI sq sr sv sv_SE th_TH tr uk uk_UA zh_CN zh_TW"
248 +IUSE+=" ${IUSE_LINGUAS// / linguas_}"
249 +
250 +REQUIRED_USE="
251 + ${PYTHON_REQUIRED_USE}
252 + tk? ( scripts )"
253 +
254 +# osg
255 +# couple of third_party libs bundled
256 +COMMON_DEPEND="
257 + ${PYTHON_DEPS}
258 + app-text/libmspub
259 + app-text/poppler:=
260 + dev-libs/hyphen
261 + dev-libs/librevenge
262 + dev-libs/libxml2
263 + dev-qt/qtcore:5
264 + dev-qt/qtgui:5
265 + dev-qt/qtnetwork:5
266 + dev-qt/qtopengl:5
267 + dev-qt/qtprintsupport:5
268 + dev-qt/qtquickcontrols:5
269 + dev-qt/qtwidgets:5
270 + dev-qt/qtxml:5
271 + media-libs/fontconfig
272 + media-libs/freetype:2
273 + media-libs/lcms:2
274 + media-libs/libcdr
275 + media-libs/libpagemaker
276 + media-libs/libpng:0=
277 + media-libs/libvisio
278 + media-libs/tiff:0
279 + net-print/cups
280 + sys-libs/zlib[minizip]
281 + virtual/jpeg:0=
282 + >=x11-libs/cairo-1.10.0[X,svg]
283 + boost? ( >=dev-libs/boost-1.62:= )
284 + hunspell? ( app-text/hunspell )
285 + graphicsmagick? ( media-gfx/graphicsmagick )
286 + osg? ( dev-games/openscenegraph )
287 + pdf? ( app-text/podofo:0= )
288 + scripts? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
289 + tk? ( dev-python/pillow[tk?,${PYTHON_USEDEP}] )
290 +"
291 +RDEPEND="${COMMON_DEPEND}
292 + app-text/ghostscript-gpl"
293 +DEPEND="${COMMON_DEPEND}
294 + dev-qt/linguist-tools:5
295 + virtual/pkgconfig"
296 +
297 +PATCHES=(
298 + "${FILESDIR}"/${PN}-1.5.0-docdir.patch
299 + "${FILESDIR}"/${P}-fpic.patch
300 + "${FILESDIR}"/${P}-cmake-qt57.patch
301 + "${FILESDIR}"/${P}-qt57-build.patch
302 + "${FILESDIR}"/${P}-cxx-build.patch
303 + "${FILESDIR}"/${P}-gcc6-warn.patch
304 +)
305 +
306 +src_prepare() {
307 + rm -r codegen/cheetah || die
308 + cat > cmake/modules/FindZLIB.cmake <<- EOF || die
309 + find_package(PkgConfig)
310 + pkg_check_modules(ZLIB minizip zlib)
311 + SET( ZLIB_LIBRARY \${ZLIB_LIBRARIES} )
312 + SET( ZLIB_INCLUDE_DIR \${ZLIB_INCLUDE_DIRS} )
313 + MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR )
314 + EOF
315 +
316 + sed \
317 + -e "/^\s*unzip\.[ch]/d" \
318 + -e "/^\s*ioapi\.[ch]/d" \
319 + -i scribus/CMakeLists.txt Scribus.pro || die
320 + rm scribus/ioapi.[ch] || die
321 +
322 + sed \
323 + -e 's:\(${CMAKE_INSTALL_PREFIX}\):./\1:g' \
324 + -i resources/templates/CMakeLists.txt || die
325 +
326 + cmake-utils_src_prepare
327 +}
328 +
329 +src_configure() {
330 + local _lang lang langs
331 + for lang in ${IUSE_LINGUAS}; do
332 + _lang=$(translate_lang ${lang})
333 + if use linguas_${lang} || [[ ${lang} == "en" ]]; then
334 + # From the CMakeLists.txt
335 + # "#Bit of a hack, preprocess all the filenames to generate our language string, needed for -DWANT_GUI_LANG=en_GB;de_DE , etc"
336 + langs+=";${_lang}"
337 + else
338 + # Don't install localized documentation
339 + sed -e "/${_lang}/d" -i doc/CMakeLists.txt || die
340 + safe_delete \
341 + ./resources/dicts/README_${_lang}.txt \
342 + ./resources/dicts/README_hyph_${_lang}.txt \
343 + ./resources/dicts/hyph_${_lang}.dic \
344 + ./resources/loremipsum/${_lang}.xml
345 + fi
346 + sed -e "/en_EN/d" -i doc/CMakeLists.txt || die
347 + safe_delete \
348 + ./resources/dicts/README_en_EN.txt \
349 + ./resources/dicts/README_hyph_en_EN.txt \
350 + ./resources/dicts/hyph_en_EN.dic \
351 + ./resources/loremipsum/en_EN.xml
352 + done
353 +
354 + local mycmakeargs=(
355 + -DHAVE_PYTHON=ON
356 + -DPYTHON_INCLUDE_PATH="$(python_get_includedir)"
357 + -DPYTHON_LIBRARY="$(python_get_library_path)"
358 + -DWANT_DISTROBUILD=ON
359 + -DDOCDIR="${EPREFIX%/}/usr/share/doc/${PF}/"
360 + -DWANT_GUI_LANG="${langs#;};en"
361 + -DWANT_CPP11=ON
362 + -DWITH_PODOFO="$(usex pdf)"
363 + -DWITH_BOOST="$(usex boost)"
364 + -DWANT_GRAPHICSMAGICK="$(usex graphicsmagick)"
365 + -DWANT_NOOSG="$(usex !osg)"
366 + -DWANT_DEBUG="$(usex debug)"
367 + -DWANT_NOHEADERINSTALL="$(usex minimal)"
368 + -DWANT_HUNSPELL="$(usex hunspell)"
369 + -DWANT_NOEXAMPLES="$(usex !examples)"
370 + -DWANT_NOTEMPLATES="$(usex !templates)"
371 + )
372 + cmake-utils_src_configure
373 +}
374 +
375 +src_install() {
376 + cmake-utils_src_install
377 +
378 + local lang _lang
379 + # en_EN can be deleted always
380 + for lang in ${IUSE_LINGUAS}; do
381 + if ! use linguas_${lang}; then
382 + _lang=$(translate_lang)
383 + safe_delete "${ED%/}"/usr/share/man/${_lang}
384 + fi
385 + done
386 +
387 + if ! use scripts; then
388 + rm "${ED%/}"/usr/share/scribus/scripts/*.py || die
389 + elif ! use tk; then
390 + rm "${ED%/}"/usr/share/scribus/scripts/{FontSample,CalendarWizard}.py || die
391 + fi
392 +
393 + use scripts && \
394 + python_fix_shebang "${ED%/}"/usr/share/scribus/scripts && \
395 + python_optimize "${ED%/}"/usr/share/scribus/scripts
396 +
397 + mv "${ED%/}"/usr/share/doc/${PF}/{en,html} || die
398 + ln -sf html "${ED%/}"/usr/share/doc/${PF}/en || die
399 + cat >> "${T}"/COPYING <<- EOF || die
400 + ${PN} is licensed under the "${LICENSE}".
401 + Please visit https://www.gnu.org/licenses/gpl-2.0.html for the complete license text.
402 + EOF
403 + dodoc "${T}"/COPYING
404 + docompress -x /usr/share/doc/${PF}/en /usr/share/doc/${PF}/{AUTHORS,TRANSLATION,LINKS,COPYING}
405 + doicon resources/iconsets/*/scribus.png
406 + domenu scribus.desktop
407 +}
408 +
409 +pkg_postinst() {
410 + fdo-mime_desktop_database_update
411 + fdo-mime_mime_database_update
412 +}
413 +
414 +pkg_postrm() {
415 + fdo-mime_desktop_database_update
416 + fdo-mime_mime_database_update
417 +}
418 +
419 +safe_delete () {
420 + local x
421 + for x in ${@}; do
422 + if [[ -d "${x}" ]]; then
423 + ebegin "Deleting ${x} recursively"
424 + rm -r "${x}" || die
425 + eend $?
426 + elif [[ -f "${x}" ]]; then
427 + ebegin "Deleting ${x}"
428 + rm "${x}" || die
429 + eend $?
430 + else
431 + ewarn "${x} not found"
432 + fi
433 + done
434 +}
435 +
436 +translate_lang() {
437 + _lang=${1}
438 + [[ ${1} == "ru_RU" ]] && _lang+=_0
439 + [[ ${1} == "de@1901" ]] && _lang=de_1901
440 + echo ${_lang}
441 +}