Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde-sunset:master commit in: x11-libs/qwt/files/, x11-libs/qwt/
Date: Sat, 30 Jun 2018 08:45:24
Message-Id: 1530348302.85a61ec97842ace18e8d7b3a33a6e5e658c684ed.asturm@gentoo
1 commit: 85a61ec97842ace18e8d7b3a33a6e5e658c684ed
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Sat Jun 30 08:44:23 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 30 08:45:02 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=85a61ec9
7
8 x11-libs/qwt: Import from Gentoo ebuild repository
9
10 x11-libs/qwt/files/qwt-5.2.3-install_qt.patch | 28 +++
11 x11-libs/qwt/files/qwt-6.0.2-invalid-read.patch | 250 ++++++++++++++++++++++++
12 x11-libs/qwt/files/qwt-6.1.1-pc-destdir.patch | 15 ++
13 x11-libs/qwt/metadata.xml | 22 +++
14 x11-libs/qwt/qwt-5.2.3-r2.ebuild | 101 ++++++++++
15 x11-libs/qwt/qwt-6.1.3-r1.ebuild | 213 ++++++++++++++++++++
16 6 files changed, 629 insertions(+)
17
18 diff --git a/x11-libs/qwt/files/qwt-5.2.3-install_qt.patch b/x11-libs/qwt/files/qwt-5.2.3-install_qt.patch
19 new file mode 100644
20 index 0000000..48e9385
21 --- /dev/null
22 +++ b/x11-libs/qwt/files/qwt-5.2.3-install_qt.patch
23 @@ -0,0 +1,28 @@
24 +diff -up qwt-5.2.2/designer/designer.pro.install_qt qwt-5.2.2/designer/designer.pro
25 +--- qwt-5.2.2/designer/designer.pro.install_qt 2011-08-01 04:28:22.000000000 -0500
26 ++++ qwt-5.2.2/designer/designer.pro 2012-08-14 11:11:22.569229749 -0500
27 +@@ -36,6 +37,7 @@ contains(CONFIG, QwtDesigner) {
28 + else {
29 + SUFFIX_STR = $${RELEASE_SUFFIX}
30 + }
31 ++ LIBNAME = qwt$${SUFFIX_STR}
32 + }
33 +
34 + TEMPLATE = lib
35 +@@ -45,7 +47,6 @@ contains(CONFIG, QwtDesigner) {
36 + INCLUDEPATH += $${QWT_ROOT}/src
37 + DEPENDPATH += $${QWT_ROOT}/src
38 +
39 +- LIBNAME = qwt$${SUFFIX_STR}
40 + contains(CONFIG, QwtDll) {
41 + win32 {
42 + DEFINES += QT_DLL QWT_DLL
43 +@@ -103,7 +104,7 @@ contains(CONFIG, QwtDesigner) {
44 +
45 + # Qt 4
46 +
47 +- TARGET = qwt_designer_plugin$${SUFFIX_STR}
48 ++ TARGET = qwt5_designer_plugin$${SUFFIX_STR}
49 + CONFIG += qt designer plugin
50 +
51 + RCC_DIR = resources
52
53 diff --git a/x11-libs/qwt/files/qwt-6.0.2-invalid-read.patch b/x11-libs/qwt/files/qwt-6.0.2-invalid-read.patch
54 new file mode 100644
55 index 0000000..a225350
56 --- /dev/null
57 +++ b/x11-libs/qwt/files/qwt-6.0.2-invalid-read.patch
58 @@ -0,0 +1,250 @@
59 +--- qwt-6.0.2-orig/textengines/mathml/qwt_mml_document.cpp 2012-12-01 00:22:46.752106265 +1100
60 ++++ qwt-6.0.2/textengines/mathml/qwt_mml_document.cpp 2013-01-31 14:29:30.590197611 +1100
61 +@@ -4421,7 +4421,10 @@
62 + if ( ok )
63 + return value;
64 + else
65 +- qWarning( "Could not convert %s to form", value_str.toLatin1().data() );
66 ++ {
67 ++ QByteArray value_str_ba = value_str.toLatin1();
68 ++ qWarning( "Could not convert %s to form", value_str_ba.data() );
69 ++ }
70 +
71 + }
72 +
73 +@@ -4658,7 +4661,10 @@
74 + continue;
75 + }
76 + else
77 +- qWarning( "MmlMtableNode::layoutSymbol(): could not parse value %s%%", value.toLatin1().data() );
78 ++ {
79 ++ QByteArray value_ba = value.toLatin1();
80 ++ qWarning( "MmlMtableNode::layoutSymbol(): could not parse value %s%%", value_ba.data() );
81 ++ }
82 + }
83 +
84 + // Relatively sized column, but we failed to parse the factor. Treat is like an auto
85 +@@ -5167,7 +5173,8 @@
86 + double factor = factor_str.toFloat( &float_ok );
87 + if ( !float_ok || factor < 0 )
88 + {
89 +- qWarning( "MmlMpaddedNode::interpretSpacing(): could not parse \"%s\"", value.toLatin1().data() );
90 ++ QByteArray value_ba = value.toLatin1();
91 ++ qWarning( "MmlMpaddedNode::interpretSpacing(): could not parse \"%s\"", value_ba.data() );
92 + return 0;
93 + }
94 +
95 +@@ -5196,7 +5203,8 @@
96 + unit_size = QwtMmlNode::interpretSpacing( "1" + pseudo_unit, &unit_ok );
97 + if ( !unit_ok )
98 + {
99 +- qWarning( "MmlMpaddedNode::interpretSpacing(): could not parse \"%s\"", value.toLatin1().data() );
100 ++ QByteArray value_ba = value.toLatin1();
101 ++ qWarning( "MmlMpaddedNode::interpretSpacing(): could not parse \"%s\"", value_ba.data() );
102 + return 0;
103 + }
104 + }
105 +@@ -5368,7 +5376,8 @@
106 + return ( int )( em * factor );
107 + else
108 + {
109 +- qWarning( "interpretSpacing(): could not parse \"%sem\"", value.toLatin1().data() );
110 ++ QByteArray value_ba = value.toLatin1();
111 ++ qWarning( "interpretSpacing(): could not parse \"%sem\"", value_ba.data() );
112 + if ( ok != 0 )
113 + *ok = false;
114 + return 0;
115 +@@ -5384,7 +5393,8 @@
116 + return ( int )( ex * factor );
117 + else
118 + {
119 +- qWarning( "interpretSpacing(): could not parse \"%sex\"", value.toLatin1().data() );
120 ++ QByteArray value_ba = value.toLatin1();
121 ++ qWarning( "interpretSpacing(): could not parse \"%sex\"", value_ba.data() );
122 + if ( ok != 0 )
123 + *ok = false;
124 + return 0;
125 +@@ -5406,7 +5416,8 @@
126 + }
127 + else
128 + {
129 +- qWarning( "interpretSpacing(): could not parse \"%scm\"", value.toLatin1().data() );
130 ++ QByteArray value_ba = value.toLatin1();
131 ++ qWarning( "interpretSpacing(): could not parse \"%scm\"", value_ba.data() );
132 + if ( ok != 0 )
133 + *ok = false;
134 + return 0;
135 +@@ -5428,7 +5439,8 @@
136 + }
137 + else
138 + {
139 +- qWarning( "interpretSpacing(): could not parse \"%smm\"", value.toLatin1().data() );
140 ++ QByteArray value_ba = value.toLatin1();
141 ++ qWarning( "interpretSpacing(): could not parse \"%smm\"", value_ba.data() );
142 + if ( ok != 0 )
143 + *ok = false;
144 + return 0;
145 +@@ -5450,7 +5462,8 @@
146 + }
147 + else
148 + {
149 +- qWarning( "interpretSpacing(): could not parse \"%sin\"", value.toLatin1().data() );
150 ++ QByteArray value_ba = value.toLatin1();
151 ++ qWarning( "interpretSpacing(): could not parse \"%sin\"", value_ba.data() );
152 + if ( ok != 0 )
153 + *ok = false;
154 + return 0;
155 +@@ -5466,7 +5479,8 @@
156 + return i;
157 + else
158 + {
159 +- qWarning( "interpretSpacing(): could not parse \"%spx\"", value.toLatin1().data() );
160 ++ QByteArray value_ba = value.toLatin1();
161 ++ qWarning( "interpretSpacing(): could not parse \"%spx\"", value_ba.data() );
162 + if ( ok != 0 )
163 + *ok = false;
164 + return 0;
165 +@@ -5478,7 +5492,8 @@
166 + if ( float_ok && i >= 0 )
167 + return i;
168 +
169 +- qWarning( "interpretSpacing(): could not parse \"%s\"", value.toLatin1().data() );
170 ++ QByteArray value_ba = value.toLatin1();
171 ++ qWarning( "interpretSpacing(): could not parse \"%s\"", value_ba.data() );
172 + if ( ok != 0 )
173 + *ok = false;
174 + return 0;
175 +@@ -5503,7 +5518,8 @@
176 + return ( int )( base * factor / 100.0 );
177 + }
178 +
179 +- qWarning( "interpretPercentSpacing(): could not parse \"%s%%\"", value.toLatin1().data() );
180 ++ QByteArray value_ba = value.toLatin1();
181 ++ qWarning( "interpretPercentSpacing(): could not parse \"%s%%\"", value_ba.data() );
182 + if ( ok != 0 )
183 + *ok = false;
184 + return 0;
185 +@@ -5528,7 +5544,8 @@
186 + return pt_size;
187 + }
188 +
189 +- qWarning( "interpretPointSize(): could not parse \"%spt\"", value.toLatin1().data() );
190 ++ QByteArray value_ba = value.toLatin1();
191 ++ qWarning( "interpretPointSize(): could not parse \"%spt\"", value_ba.data() );
192 + if ( ok != 0 )
193 + *ok = false;
194 + return 0;
195 +@@ -5737,7 +5754,8 @@
196 + */
197 + static const QwtMmlOperSpec *searchOperSpecData( const QString &name )
198 + {
199 +- const char *name_latin1 = name.toLatin1().data();
200 ++ QByteArray name_latin1_ba = name.toLatin1();
201 ++ const char *name_latin1 = name_latin1_ba.data();
202 +
203 + // binary search
204 + // establish invariant g_oper_spec_data[begin].name < name < g_oper_spec_data[end].name
205 +@@ -5789,7 +5807,8 @@
206 + if ( spec == 0 )
207 + continue;
208 +
209 +- const char *name_latin1 = name.toLatin1().data();
210 ++ QByteArray name_ba = name.toLatin1();
211 ++ const char *name_latin1 = name_ba.data();
212 +
213 + // backtrack to the first instance of name
214 + while ( spec > g_oper_spec_data && qstrcmp( ( spec - 1 )->name, name_latin1 ) == 0 )
215 +@@ -5918,7 +5937,8 @@
216 + if ( ok != 0 )
217 + *ok = false;
218 +
219 +- qWarning( "interpretMathVariant(): could not parse value: \"%s\"", value.toLatin1().data() );
220 ++ QByteArray value_ba = value.toLatin1();
221 ++ qWarning( "interpretMathVariant(): could not parse value: \"%s\"", value_ba.data() );
222 +
223 + return QwtMml::NormalMV;
224 + }
225 +@@ -5938,7 +5958,8 @@
226 + if ( ok != 0 )
227 + *ok = false;
228 +
229 +- qWarning( "interpretForm(): could not parse value \"%s\"", value.toLatin1().data() );
230 ++ QByteArray value_ba = value.toLatin1();
231 ++ qWarning( "interpretForm(): could not parse value \"%s\"", value_ba.data() );
232 + return QwtMml::InfixForm;
233 + }
234 +
235 +@@ -5959,7 +5980,8 @@
236 + if ( ok != 0 )
237 + *ok = false;
238 +
239 +- qWarning( "interpretColAlign(): could not parse value \"%s\"", value.toLatin1().data() );
240 ++ QByteArray value_ba = value.toLatin1();
241 ++ qWarning( "interpretColAlign(): could not parse value \"%s\"", value_ba.data() );
242 + return QwtMml::ColAlignCenter;
243 + }
244 +
245 +@@ -5984,7 +6006,8 @@
246 + if ( ok != 0 )
247 + *ok = false;
248 +
249 +- qWarning( "interpretRowAlign(): could not parse value \"%s\"", value.toLatin1().data() );
250 ++ QByteArray value_ba = value.toLatin1();
251 ++ qWarning( "interpretRowAlign(): could not parse value \"%s\"", value_ba.data() );
252 + return QwtMml::RowAlignAxis;
253 + }
254 +
255 +@@ -6018,7 +6041,8 @@
256 + if ( ok != 0 )
257 + *ok = false;
258 +
259 +- qWarning( "interpretFrameType(): could not parse value \"%s\"", value.toLatin1().data() );
260 ++ QByteArray value_ba = value.toLatin1();
261 ++ qWarning( "interpretFrameType(): could not parse value \"%s\"", value_ba.data() );
262 + return QwtMml::FrameNone;
263 + }
264 +
265 +@@ -6030,7 +6054,8 @@
266 + QStringList l = value_list.split( ' ' );
267 + if ( l.count() != 2 )
268 + {
269 +- qWarning( "interpretFrameSpacing: could not parse value \"%s\"", value_list.toLatin1().data() );
270 ++ QByteArray value_list_ba = value_list.toLatin1();
271 ++ qWarning( "interpretFrameSpacing: could not parse value \"%s\"", value_list_ba.data() );
272 + if ( ok != 0 )
273 + *ok = false;
274 + return QwtMml::FrameSpacing( ( int )( 0.4 * em ), ( int )( 0.5 * ex ) );
275 +@@ -6089,7 +6114,10 @@
276 + else if ( value == "bold" )
277 + fn.setBold( true );
278 + else
279 +- qWarning( "interpretDepreciatedFontAttr(): could not parse fontweight \"%s\"", value.toLatin1().data() );
280 ++ {
281 ++ QByteArray value_ba = value.toLatin1();
282 ++ qWarning( "interpretDepreciatedFontAttr(): could not parse fontweight \"%s\"", value_ba.data() );
283 ++ }
284 + }
285 +
286 + if ( font_attr.contains( "fontstyle" ) )
287 +@@ -6100,7 +6128,10 @@
288 + else if ( value == "italic" )
289 + fn.setItalic( true );
290 + else
291 +- qWarning( "interpretDepreciatedFontAttr(): could not parse fontstyle \"%s\"", value.toLatin1().data() );
292 ++ {
293 ++ QByteArray value_ba = value.toLatin1();
294 ++ qWarning( "interpretDepreciatedFontAttr(): could not parse fontstyle \"%s\"", value_ba.data() );
295 ++ }
296 + }
297 +
298 + if ( font_attr.contains( "fontfamily" ) )
299 +@@ -6150,7 +6181,8 @@
300 +
301 + if ( ok != 0 )
302 + *ok = false;
303 +- qWarning( "interpretMathSize(): could not parse mathsize \"%s\"", value.toLatin1().data() );
304 ++ QByteArray value_ba = value.toLatin1();
305 ++ qWarning( "interpretMathSize(): could not parse mathsize \"%s\"", value_ba.data() );
306 + return fn;
307 + }
308 +
309
310 diff --git a/x11-libs/qwt/files/qwt-6.1.1-pc-destdir.patch b/x11-libs/qwt/files/qwt-6.1.1-pc-destdir.patch
311 new file mode 100644
312 index 0000000..f00ea60
313 --- /dev/null
314 +++ b/x11-libs/qwt/files/qwt-6.1.1-pc-destdir.patch
315 @@ -0,0 +1,15 @@
316 + textengines/mathml/mathml.pro | 1 +
317 + 1 file changed, 1 insertion(+)
318 +
319 +diff --git a/textengines/mathml/mathml.pro b/textengines/mathml/mathml.pro
320 +index 7032366..b1372f7 100644
321 +--- a/textengines/mathml/mathml.pro
322 ++++ b/textengines/mathml/mathml.pro
323 +@@ -63,6 +63,7 @@ contains(QWT_CONFIG, QwtPkgConfig) {
324 +
325 + # QMAKE_PKGCONFIG_DESTDIR is buggy, in combination
326 + # with including pri files: better don't use it
327 ++ QMAKE_PKGCONFIG_DESTDIR = pkgconfig
328 +
329 + greaterThan(QT_MAJOR_VERSION, 4) {
330 +
331
332 diff --git a/x11-libs/qwt/metadata.xml b/x11-libs/qwt/metadata.xml
333 new file mode 100644
334 index 0000000..5fa8612
335 --- /dev/null
336 +++ b/x11-libs/qwt/metadata.xml
337 @@ -0,0 +1,22 @@
338 +<?xml version="1.0" encoding="UTF-8"?>
339 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
340 +<pkgmetadata>
341 + <maintainer type="project">
342 + <email>sci@g.o</email>
343 + <name>Gentoo Science Project</name>
344 + </maintainer>
345 + <longdescription lang="en">
346 + The Qwt library contains GUI Components and utility classes which are
347 + primarily useful for programs with a technical background.
348 + Besides a 2D plot widget it provides scales, sliders, dials,
349 + compasses, thermometers, wheels and knobs to control or display
350 + values, arrays or ranges of type double.
351 +</longdescription>
352 + <use>
353 + <flag name="designer">Installs <pkg>dev-qt/designer</pkg> plugin.</flag>
354 + <flag name="mathml">Use the MathML renderer of the Qt solutions package.</flag>
355 + </use>
356 + <upstream>
357 + <remote-id type="sourceforge">qwt</remote-id>
358 + </upstream>
359 +</pkgmetadata>
360
361 diff --git a/x11-libs/qwt/qwt-5.2.3-r2.ebuild b/x11-libs/qwt/qwt-5.2.3-r2.ebuild
362 new file mode 100644
363 index 0000000..73b753b
364 --- /dev/null
365 +++ b/x11-libs/qwt/qwt-5.2.3-r2.ebuild
366 @@ -0,0 +1,101 @@
367 +# Copyright 1999-2017 Gentoo Foundation
368 +# Distributed under the terms of the GNU General Public License v2
369 +
370 +EAPI=5
371 +
372 +inherit eutils multibuild qt4-r2
373 +
374 +DESCRIPTION="2D plotting library for Qt4"
375 +HOMEPAGE="http://qwt.sourceforge.net/"
376 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
377 +
378 +LICENSE="qwt"
379 +KEYWORDS="~alpha amd64 arm ia64 ppc ppc64 sparc x86 ~x86-macos"
380 +SLOT="5"
381 +IUSE="doc examples static-libs svg"
382 +
383 +DEPEND="
384 + dev-qt/designer:4
385 + dev-qt/qtgui:4
386 + doc? ( !<media-libs/coin-3.1.3[doc] )
387 + svg? ( dev-qt/qtsvg:4 )"
388 +RDEPEND="${DEPEND}"
389 +
390 +DOCS="CHANGES README"
391 +
392 +src_prepare() {
393 + epatch "${FILESDIR}"/${P}-install_qt.patch
394 + sed -e "/QwtVersion/s:5.2.2.:${PV}:g" -i ${PN}.prf || die
395 +
396 + cat > qwtconfig.pri <<-EOF
397 + target.path = "${EPREFIX}/usr/$(get_libdir)"
398 + headers.path = "${EPREFIX}/usr/include/qwt5"
399 + doc.path = "${EPREFIX}/usr/share/doc/${PF}"
400 + CONFIG += qt warn_on thread release
401 + CONFIG += QwtPlot QwtWidgets QwtDesigner
402 + VERSION = ${PV}
403 + QWT_VERSION = ${PV/_*}
404 + QWT_INSTALL_PLUGINS = "${EPREFIX}/usr/$(get_libdir)/qt4/plugins/designer"
405 + QWT_INSTALL_FEATURES = "${EPREFIX}/usr/share/qt4/mkspecs/features"
406 + EOF
407 + sed -i -e 's/headers doc/headers/' src/src.pro || die
408 + use svg && echo >> qwtconfig.pri "CONFIG += QwtSVGItem"
409 +
410 + MULTIBUILD_VARIANTS=( )
411 + use static-libs && MULTIBUILD_VARIANTS+=( static )
412 + MULTIBUILD_VARIANTS+=( shared )
413 +
414 + qt4-r2_src_prepare
415 +
416 + preparation() {
417 + cp -rf "${S}" "${BUILD_DIR}" || die
418 + [[ ${MULTIBUILD_VARIANT} == shared ]] && \
419 + echo "CONFIG += QwtDll" >> "${BUILD_DIR}"/qwtconfig.pri
420 + }
421 +
422 + multibuild_foreach_variant preparation
423 +}
424 +
425 +src_configure() {
426 + multibuild_parallel_foreach_variant run_in_build_dir eqmake4 ${PN}.pro
427 +}
428 +
429 +src_compile() {
430 + multibuild_foreach_variant run_in_build_dir qt4-r2_src_compile
431 +}
432 +
433 +src_test() {
434 + testing() {
435 + cd examples || die
436 + eqmake4 examples.pro
437 + emake
438 + }
439 + multibuild_foreach_variant run_in_build_dir testing
440 +}
441 +
442 +src_install () {
443 + multibuild_foreach_variant run_in_build_dir qt4-r2_src_install
444 +
445 + if use doc; then
446 + insinto /usr/share/doc/${PF}
447 + rm doc/man/*/*license* || die
448 + rm -f doc/man/*/{_,deprecated}* || die
449 + doman doc/man/*/*
450 + doins -r doc/html
451 + fi
452 + if use examples; then
453 + # don't build examples - fix the qt files to build once installed
454 + cat > examples/examples.pri <<-EOF
455 + include( qwtconfig.pri )
456 + TEMPLATE = app
457 + MOC_DIR = moc
458 + INCLUDEPATH += "${EPREFIX}/usr/include/qwt5"
459 + DEPENDPATH += "${EPREFIX}/usr/include/qwt5"
460 + LIBS += -lqwt
461 + EOF
462 + sed -i -e 's:../qwtconfig:qwtconfig:' examples/examples.pro || die
463 + cp *.pri examples/ || die
464 + insinto /usr/share/${PN}5
465 + doins -r examples
466 + fi
467 +}
468
469 diff --git a/x11-libs/qwt/qwt-6.1.3-r1.ebuild b/x11-libs/qwt/qwt-6.1.3-r1.ebuild
470 new file mode 100644
471 index 0000000..dc89fab
472 --- /dev/null
473 +++ b/x11-libs/qwt/qwt-6.1.3-r1.ebuild
474 @@ -0,0 +1,213 @@
475 +# Copyright 1999-2018 Gentoo Foundation
476 +# Distributed under the terms of the GNU General Public License v2
477 +
478 +EAPI=6
479 +
480 +inherit multibuild qmake-utils
481 +
482 +MY_P="${PN}-${PV/_/-}"
483 +
484 +DESCRIPTION="2D plotting library for Qt4 and Qt5"
485 +HOMEPAGE="http://qwt.sourceforge.net/"
486 +SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV/_/-}/${MY_P}.tar.bz2"
487 +
488 +LICENSE="qwt mathml? ( LGPL-2.1 Nokia-Qt-LGPL-Exception-1.1 )"
489 +KEYWORDS="amd64 ~arm ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-macos"
490 +SLOT="6/1.3"
491 +IUSE="designer doc examples mathml opengl qt4 qt5 static-libs svg"
492 +
493 +REQUIRED_USE="|| ( qt4 qt5 )"
494 +
495 +DEPEND="
496 + opengl? ( virtual/opengl )
497 + qt4? (
498 + dev-qt/qtcore:4
499 + dev-qt/qtgui:4
500 + designer? ( dev-qt/designer:4 )
501 + opengl? ( dev-qt/qtopengl:4 )
502 + svg? ( dev-qt/qtsvg:4 )
503 + )
504 + qt5? (
505 + dev-qt/qtconcurrent:5
506 + dev-qt/qtcore:5
507 + dev-qt/qtgui:5
508 + dev-qt/qtprintsupport:5
509 + dev-qt/qtwidgets:5
510 + designer? ( dev-qt/designer:5 )
511 + opengl? ( dev-qt/qtopengl:5 )
512 + svg? ( dev-qt/qtsvg:5 )
513 + )
514 +"
515 +RDEPEND="${DEPEND}
516 + !<x11-libs/qwt-5.2.3
517 + !x11-libs/qwt:5[doc]
518 + doc? ( !<media-libs/coin-3.1.3[doc] )
519 +"
520 +
521 +S="${WORKDIR}"/${MY_P}
522 +
523 +DOCS=( CHANGES-6.1 README )
524 +
525 +PATCHES=(
526 + "${FILESDIR}"/${PN}-6.0.2-invalid-read.patch
527 + "${FILESDIR}"/${PN}-6.1.1-pc-destdir.patch
528 +)
529 +
530 +src_prepare() {
531 + cat > qwtconfig.pri <<-EOF
532 + QWT_INSTALL_LIBS = "${EPREFIX}/usr/$(get_libdir)"
533 + QWT_INSTALL_HEADERS = "${EPREFIX}/usr/include/qwt6"
534 + QWT_INSTALL_DOCS = "${EPREFIX}/usr/share/doc/${PF}"
535 + QWT_CONFIG += QwtPlot QwtWidgets QwtPkgConfig
536 + VERSION = ${PV/_*}
537 + QWT_VERSION = ${PV/_*}
538 + EOF
539 +
540 + use designer && echo "QWT_CONFIG += QwtDesigner" >> qwtconfig.pri
541 + use mathml && echo "QWT_CONFIG += QwtMathML" >> qwtconfig.pri
542 + use opengl && echo "QWT_CONFIG += QwtOpenGL" >> qwtconfig.pri
543 + use svg && echo "QWT_CONFIG += QwtSvg" >> qwtconfig.pri
544 +
545 + cat > qwtbuild.pri <<-EOF
546 + QWT_CONFIG += qt warn_on thread release no_keywords
547 + EOF
548 +
549 + MULTIBUILD_VARIANTS=( )
550 +
551 + if use qt4; then
552 + use static-libs && MULTIBUILD_VARIANTS+=( qt4-static )
553 + MULTIBUILD_VARIANTS+=( qt4-shared )
554 + fi
555 +
556 + if use qt5; then
557 + use static-libs && MULTIBUILD_VARIANTS+=( qt5-static )
558 + MULTIBUILD_VARIANTS+=( qt5-shared )
559 + fi
560 +
561 + multibuild_copy_sources
562 +
563 + preparation() {
564 + if [[ ${MULTIBUILD_VARIANT} == *-shared ]]; then
565 + echo "QWT_CONFIG += QwtDll" >> qwtconfig.pri
566 + fi
567 +
568 + case "${MULTIBUILD_VARIANT}" in
569 + qt4-*)
570 + cat >> qwtconfig.pri <<-EOF
571 + QWT_INSTALL_PLUGINS = "${EPREFIX}$(qt4_get_plugindir)/designer"
572 + QWT_INSTALL_FEATURES = "${EPREFIX}$(qt4_get_mkspecsdir)/features"
573 + EOF
574 + sed \
575 + -e 's/target doc/target/' \
576 + -e "/^TARGET/s:(qwt):(qwt6-qt4):g" \
577 + -e "/^TARGET/s:qwt):qwt6-qt4):g" \
578 + -i src/src.pro || die
579 +
580 + sed \
581 + -e '/qwtAddLibrary/s:(qwt):(qwt6-qt4):g' \
582 + -e '/qwtAddLibrary/s:qwt):qwt6-qt4):g' \
583 + -i qwt.prf designer/designer.pro examples/examples.pri \
584 + textengines/mathml/qwtmathml.prf textengines/textengines.pri || die
585 +
586 + ;;
587 + qt5-*)
588 + cat >> qwtconfig.pri <<-EOF
589 + QWT_INSTALL_PLUGINS = "${EPREFIX}$(qt5_get_plugindir)/designer"
590 + QWT_INSTALL_FEATURES = "${EPREFIX}$(qt5_get_mkspecsdir)/features"
591 + EOF
592 + sed \
593 + -e 's/target doc/target/' \
594 + -e "/^TARGET/s:(qwt):(qwt6-qt5):g" \
595 + -e "/^TARGET/s:qwt):qwt6-qt5):g" \
596 + -i src/src.pro || die
597 +
598 + sed \
599 + -e '/qwtAddLibrary/s:(qwt):(qwt6-qt5):g' \
600 + -e '/qwtAddLibrary/s:qwt):qwt6-qt5):g' \
601 + -i qwt.prf designer/designer.pro examples/examples.pri \
602 + textengines/mathml/qwtmathml.prf textengines/textengines.pri || die
603 + ;;
604 + esac
605 + default
606 + }
607 +
608 + multibuild_foreach_variant run_in_build_dir preparation
609 +}
610 +
611 +src_configure() {
612 + configuration() {
613 + case "${MULTIBUILD_VARIANT}" in
614 + qt4-*)
615 + eqmake4
616 + ;;
617 + qt5-*)
618 + eqmake5
619 + ;;
620 + esac
621 + }
622 + multibuild_foreach_variant run_in_build_dir configuration
623 +}
624 +
625 +src_compile() {
626 + multibuild_foreach_variant run_in_build_dir default
627 +}
628 +
629 +src_test() {
630 + testing() {
631 + cd examples || die
632 + case "${MULTIBUILD_VARIANT}" in
633 + qt4-*)
634 + eqmake4 examples.pro
635 + ;;
636 + qt5-*)
637 + eqmake5 examples.pro
638 + ;;
639 + esac
640 + emake
641 + }
642 + multibuild_foreach_variant run_in_build_dir testing
643 +}
644 +
645 +src_install () {
646 + rm -f doc/man/*/{_,deprecated}* || die
647 +
648 + multibuild_foreach_variant run_in_build_dir emake INSTALL_ROOT="${D}" install
649 +
650 + if use qt4; then
651 + mv "${ED}"/usr/$(get_libdir)/pkgconfig/qwt6{-qt4,}.pc || die
652 + fi
653 +
654 + if use mathml; then
655 + sed \
656 + -e "s: -L\"${WORKDIR}\".* -lqwt6: -lqwt6:g" \
657 + -i "${ED}"/usr/$(get_libdir)/pkgconfig/qwtmathml.pc || die
658 + fi
659 +
660 + if use doc; then
661 + HTML_DOCS=( doc/html/. )
662 + else
663 + rm -rf "${ED}"/usr/share/doc/${PF}/html || die
664 + fi
665 +
666 + einstalldocs
667 +
668 + mkdir -p "${ED}"/usr/share/man/ || die
669 + mv "${ED}"/usr/share/doc/${PF}/man/man3 "${ED}"/usr/share/man/ && \
670 + rmdir "${ED}"/usr/share/doc/${PF}/man || die
671 +
672 + if use examples; then
673 + # don't build examples - fix the qt files to build once installed
674 + cat > examples/examples.pri <<-EOF
675 + include( qwtconfig.pri )
676 + TEMPLATE = app
677 + MOC_DIR = moc
678 + INCLUDEPATH += "${EPREFIX}/usr/include/qwt6"
679 + DEPENDPATH += "${EPREFIX}/usr/include/qwt6"
680 + LIBS += -lqwt6
681 + EOF
682 + sed -i -e 's:../qwtconfig:qwtconfig:' examples/examples.pro || die
683 + cp *.pri examples/ || die
684 + insinto /usr/share/${PN}6
685 + doins -r examples
686 + fi
687 +}