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: dev-python/PyQt4/files/, dev-python/PyQt4/
Date: Sat, 30 Jun 2018 11:29:19
Message-Id: 1530358067.8d3c51b13ee42453f19d54cd09e70cc9bfc09721.asturm@gentoo
1 commit: 8d3c51b13ee42453f19d54cd09e70cc9bfc09721
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Sat Jun 30 11:27:47 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 30 11:27:47 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=8d3c51b1
7
8 dev-python/PyQt4: Import from Gentoo ebuild repository
9
10 Package-Manager: Portage-2.3.41, Repoman-2.3.9
11
12 dev-python/PyQt4/PyQt4-4.12.1.ebuild | 193 +++++++++++++++++
13 dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch | 25 +++
14 .../files/PyQt4-4.7.3-qreal_float_support.patch | 239 +++++++++++++++++++++
15 dev-python/PyQt4/metadata.xml | 33 +++
16 4 files changed, 490 insertions(+)
17
18 diff --git a/dev-python/PyQt4/PyQt4-4.12.1.ebuild b/dev-python/PyQt4/PyQt4-4.12.1.ebuild
19 new file mode 100644
20 index 0000000..aa304f2
21 --- /dev/null
22 +++ b/dev-python/PyQt4/PyQt4-4.12.1.ebuild
23 @@ -0,0 +1,193 @@
24 +# Copyright 1999-2018 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
29 +
30 +inherit multibuild python-r1 qmake-utils toolchain-funcs
31 +
32 +DESCRIPTION="Python bindings for the Qt framework"
33 +HOMEPAGE="https://www.riverbankcomputing.com/software/pyqt/intro"
34 +
35 +MY_P=${PN}_gpl_x11-${PV/_pre/.dev}
36 +if [[ ${PV} == *_pre* ]]; then
37 + SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.xz"
38 +else
39 + SRC_URI="mirror://sourceforge/pyqt/${MY_P}.tar.gz"
40 +fi
41 +
42 +LICENSE="GPL-3"
43 +SLOT="0"
44 +KEYWORDS="alpha amd64 ~arm ~arm64 ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux"
45 +
46 +IUSE="X compat dbus debug declarative designer doc examples help multimedia
47 + opengl phonon script scripttools sql svg testlib webkit xmlpatterns"
48 +REQUIRED_USE="
49 + ${PYTHON_REQUIRED_USE}
50 + sql? ( X )
51 + testlib? ( X )
52 +"
53 +
54 +# Minimal supported version of Qt.
55 +QT_PV="4.8.5:4"
56 +
57 +RDEPEND="
58 + ${PYTHON_DEPS}
59 + >=dev-python/sip-4.19.1:=[${PYTHON_USEDEP}]
60 + >=dev-qt/qtcore-${QT_PV}
61 + X? ( >=dev-qt/qtgui-${QT_PV} )
62 + dbus? (
63 + dev-python/dbus-python[${PYTHON_USEDEP}]
64 + >=dev-qt/qtdbus-${QT_PV}
65 + )
66 + declarative? ( >=dev-qt/qtdeclarative-${QT_PV} )
67 + designer? ( >=dev-qt/designer-${QT_PV} )
68 + help? ( >=dev-qt/qthelp-${QT_PV} )
69 + multimedia? ( >=dev-qt/qtmultimedia-${QT_PV} )
70 + opengl? ( >=dev-qt/qtopengl-${QT_PV} )
71 + phonon? ( >=media-libs/phonon-4.7[qt4] )
72 + script? ( >=dev-qt/qtscript-${QT_PV} )
73 + scripttools? ( >=dev-qt/qtgui-${QT_PV} )
74 + sql? ( >=dev-qt/qtsql-${QT_PV} )
75 + svg? ( >=dev-qt/qtsvg-${QT_PV} )
76 + testlib? ( >=dev-qt/qttest-${QT_PV} )
77 + webkit? ( >=dev-qt/qtwebkit-${QT_PV} )
78 + xmlpatterns? ( >=dev-qt/qtxmlpatterns-${QT_PV} )
79 +"
80 +DEPEND="${RDEPEND}
81 + dbus? ( virtual/pkgconfig )
82 +"
83 +
84 +S=${WORKDIR}/${MY_P}
85 +
86 +DOCS=( "${S}"/{ChangeLog,NEWS,THANKS} )
87 +PATCHES=(
88 + # Allow building against KDE's phonon (bug 525354)
89 + "${FILESDIR}/${PN}-4.11.2-phonon.patch"
90 +)
91 +
92 +src_prepare() {
93 + # Support qreal on arm architecture (bug 322349)
94 + use arm && PATCHES+=("${FILESDIR}/${PN}-4.7.3-qreal_float_support.patch")
95 +
96 + default
97 +}
98 +
99 +pyqt_run() {
100 + echo "$@"
101 + "${PYTHON}" "$@"
102 +}
103 +
104 +pyqt_use_enable() {
105 + use "$1" || return
106 +
107 + echo --enable=${2:-Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}}
108 +}
109 +
110 +src_configure() {
111 + configuration() {
112 + local myconf=(
113 + $(usex debug '--debug --trace' '')
114 + --verbose
115 + --confirm-license
116 + --qmake="$(qt4_get_bindir)"/qmake
117 + --bindir="${EPREFIX}/usr/bin"
118 + --destdir="$(python_get_sitedir)"
119 + --qsci-api
120 + --enable=QtCore
121 + --enable=QtNetwork
122 + --enable=QtXml
123 + $(pyqt_use_enable X QtGui)
124 + $(pyqt_use_enable dbus QtDBus)
125 + $(pyqt_use_enable declarative)
126 + $(pyqt_use_enable designer)
127 + $(usex designer '' --no-designer-plugin)
128 + $(pyqt_use_enable help)
129 + $(pyqt_use_enable multimedia)
130 + $(pyqt_use_enable opengl QtOpenGL)
131 + $(pyqt_use_enable phonon phonon)
132 + $(pyqt_use_enable script)
133 + $(pyqt_use_enable scripttools QtScriptTools)
134 + $(pyqt_use_enable sql)
135 + $(pyqt_use_enable svg)
136 + $(pyqt_use_enable testlib QtTest)
137 + $(pyqt_use_enable webkit QtWebKit)
138 + $(pyqt_use_enable xmlpatterns QtXmlPatterns)
139 + )
140 +
141 + if use compat; then
142 + local compat_build_dir=${BUILD_DIR%/}-compat
143 + cp -Rp "${S}" "${compat_build_dir}" || die
144 + pushd "${compat_build_dir}" >/dev/null || die
145 +
146 + local mycompatconf=(
147 + "${myconf[@]}"
148 + AR="$(tc-getAR) cqs"
149 + CC="$(tc-getCC)"
150 + CFLAGS="${CFLAGS}"
151 + CFLAGS_RELEASE=
152 + CXX="$(tc-getCXX)"
153 + CXXFLAGS="${CXXFLAGS}"
154 + CXXFLAGS_RELEASE=
155 + LINK="$(tc-getCXX)"
156 + LINK_SHLIB="$(tc-getCXX)"
157 + LFLAGS="${LDFLAGS}"
158 + LFLAGS_RELEASE=
159 + RANLIB=
160 + STRIP=
161 + )
162 + pyqt_run configure.py "${mycompatconf[@]}" || die
163 +
164 + popd >/dev/null || die
165 + fi
166 +
167 + myconf+=(
168 + --sip-incdir="$(python_get_includedir)"
169 + $(usex dbus '' --no-python-dbus)
170 + )
171 + pyqt_run "${S}"/configure-ng.py "${myconf[@]}" || die
172 +
173 + eqmake4 -recursive ${PN}.pro
174 + }
175 + python_foreach_impl run_in_build_dir configuration
176 +}
177 +
178 +src_compile() {
179 + python_foreach_impl run_in_build_dir default
180 +}
181 +
182 +src_install() {
183 + installation() {
184 + local tmp_root=${D%/}/tmp
185 + emake INSTALL_ROOT="${tmp_root}" install
186 +
187 + local uic_dir=${tmp_root}$(python_get_sitedir)/${PN}/uic
188 + if python_is_python3; then
189 + rm -r "${uic_dir}"/port_v2 || die
190 + else
191 + rm -r "${uic_dir}"/port_v3 || die
192 + fi
193 +
194 + python_doexe "${tmp_root}${EPREFIX}"/usr/bin/pyuic4
195 + rm "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 || die
196 +
197 + multibuild_merge_root "${tmp_root}" "${D}"
198 +
199 + if use compat; then
200 + local compat_build_dir=${BUILD_DIR%/}-compat
201 + python_moduleinto ${PN}
202 + python_domodule "${compat_build_dir}"/pyqtconfig.py
203 + fi
204 +
205 + python_optimize
206 + }
207 + python_foreach_impl run_in_build_dir installation
208 +
209 + einstalldocs
210 + use doc && dodoc -r doc/html
211 +
212 + if use examples; then
213 + insinto /usr/share/doc/${PF}
214 + doins -r examples
215 + fi
216 +}
217
218 diff --git a/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch b/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch
219 new file mode 100644
220 index 0000000..e3449b3
221 --- /dev/null
222 +++ b/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch
223 @@ -0,0 +1,25 @@
224 +From e8931ed7f49eb55d6259328a5a78f3fc18472d48 Mon Sep 17 00:00:00 2001
225 +From: Davide Pesavento <pesa@g.o>
226 +Date: Tue, 14 Oct 2014 04:30:29 +0200
227 +Subject: [PATCH] Support building against KDE's phonon variant.
228 +
229 +---
230 + configure-ng.py | 2 ++
231 + 1 file changed, 2 insertions(+)
232 +
233 +diff --git a/configure-ng.py b/configure-ng.py
234 +index a80cb57..fd2c56c 100644
235 +--- a/configure-ng.py
236 ++++ b/configure-ng.py
237 +@@ -2256,6 +2256,8 @@ def generate_sip_module_code(target_config, verbose, no_timestamp, parts, tracin
238 + if mname == 'QtCore':
239 + includepath = target_config.vend_inc_dir
240 + libs = '-L%s -lvendorid' % target_config.vend_lib_dir
241 ++ if mname == 'phonon':
242 ++ includepath = os.path.join(sys.prefix, 'include', 'phonon')
243 +
244 + generate_module_makefile(target_config, verbose, mname,
245 + includepath=includepath, libs=libs, qpy_sources=qpy_sources,
246 +--
247 +2.1.2
248 +
249
250 diff --git a/dev-python/PyQt4/files/PyQt4-4.7.3-qreal_float_support.patch b/dev-python/PyQt4/files/PyQt4-4.7.3-qreal_float_support.patch
251 new file mode 100644
252 index 0000000..37e1e69
253 --- /dev/null
254 +++ b/dev-python/PyQt4/files/PyQt4-4.7.3-qreal_float_support.patch
255 @@ -0,0 +1,239 @@
256 +#! /bin/sh /usr/share/dpatch/dpatch-run
257 +## 03_qreal_float_support.dpatch by Michael Casadevall <sonicmctails@×××××.com>
258 +##
259 +## DP: Corrects a configure test, and adds explicate double handling
260 +## to qlist.sip on architectures where qreal != double
261 +
262 +@DPATCH@
263 +Index: python-qt4-4.7.2/sip/QtCore/qlist.sip
264 +===================================================================
265 +--- python-qt4-4.7.2.orig/sip/QtCore/qlist.sip 2010-03-17 19:29:26.000000000 +0100
266 ++++ python-qt4-4.7.2/sip/QtCore/qlist.sip 2010-03-25 23:53:55.468631945 +0100
267 +@@ -749,3 +749,227 @@
268 + return sipGetState(sipTransferObj);
269 + %End
270 + };
271 ++
272 ++// If we're on an architecture where qreal != double, then we need to also
273 ++// explicately handle doubles. On architectures where qreal == double, they
274 ++// will automaticially be cast upwards
275 ++
276 ++%If (!PyQt_qreal_double)
277 ++
278 ++%If (Qt_4_3_0 -)
279 ++// QList<QPair<double, double> > is implemented as a Python list of 2-element tuples.
280 ++%MappedType QList<QPair<double, double> >
281 ++{
282 ++%TypeHeaderCode
283 ++#include <qlist.h>
284 ++#include <qpair.h>
285 ++%End
286 ++
287 ++%ConvertFromTypeCode
288 ++ // Create the list.
289 ++ PyObject *l;
290 ++
291 ++ if ((l = PyList_New(sipCpp->size())) == NULL)
292 ++ return NULL;
293 ++
294 ++ // Set the list elements.
295 ++ for (int i = 0; i < sipCpp->size(); ++i)
296 ++ {
297 ++ const QPair<double, double> &p = sipCpp->at(i);
298 ++ PyObject *pobj;
299 ++
300 ++ if ((pobj = Py_BuildValue((char *)"dd", p.first, p.second)) == NULL)
301 ++ {
302 ++ Py_DECREF(l);
303 ++
304 ++ return NULL;
305 ++ }
306 ++
307 ++ PyList_SET_ITEM(l, i, pobj);
308 ++ }
309 ++
310 ++ return l;
311 ++%End
312 ++
313 ++%ConvertToTypeCode
314 ++ SIP_SSIZE_T len;
315 ++
316 ++ // Check the type if that is all that is required.
317 ++ if (sipIsErr == NULL)
318 ++ {
319 ++ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
320 ++ return 0;
321 ++
322 ++ for (SIP_SSIZE_T i = 0; i < len; ++i)
323 ++ {
324 ++ PyObject *tup = PySequence_ITEM(sipPy, i);
325 ++
326 ++ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2)
327 ++ return 0;
328 ++ }
329 ++
330 ++ return 1;
331 ++ }
332 ++
333 ++ QList<QPair<double, double> > *ql = new QList<QPair<double, double> >;
334 ++ len = PySequence_Size(sipPy);
335 ++
336 ++ for (SIP_SSIZE_T i = 0; i < len; ++i)
337 ++ {
338 ++ PyObject *tup = PySequence_ITEM(sipPy, i);
339 ++
340 ++ double first = PyFloat_AsDouble(PySequence_ITEM(tup, 0));
341 ++ double second = PyFloat_AsDouble(PySequence_ITEM(tup, 1));
342 ++
343 ++ ql->append(QPair<double, double>(first, second));
344 ++ }
345 ++
346 ++ *sipCppPtr = ql;
347 ++
348 ++ return sipGetState(sipTransferObj);
349 ++%End
350 ++};
351 ++%End
352 ++%If (Qt_4_3_0 -)
353 ++// QList<QPair<double, TYPE> > is implemented as a Python list of 2-element tuples.
354 ++template<double, TYPE>
355 ++%MappedType QList<QPair<double, TYPE> >
356 ++{
357 ++%TypeHeaderCode
358 ++#include <qlist.h>
359 ++#include <qpair.h>
360 ++%End
361 ++
362 ++%ConvertFromTypeCode
363 ++ // Create the list.
364 ++ PyObject *l;
365 ++
366 ++ if ((l = PyList_New(sipCpp->size())) == NULL)
367 ++ return NULL;
368 ++
369 ++ // Set the list elements.
370 ++ for (int i = 0; i < sipCpp->size(); ++i)
371 ++ {
372 ++ const QPair<double, TYPE> &p = sipCpp->at(i);
373 ++ TYPE *t = new TYPE(p.second);
374 ++ PyObject *pobj;
375 ++
376 ++ if ((pobj = sipBuildResult(NULL, "(dB)", p.first, t, sipClass_TYPE, sipTransferObj)) == NULL)
377 ++ {
378 ++ Py_DECREF(l);
379 ++ delete t;
380 ++
381 ++ return NULL;
382 ++ }
383 ++
384 ++ PyList_SET_ITEM(l, i, pobj);
385 ++ }
386 ++
387 ++ return l;
388 ++%End
389 ++
390 ++%ConvertToTypeCode
391 ++ SIP_SSIZE_T len;
392 ++
393 ++ // Check the type if that is all that is required.
394 ++ if (sipIsErr == NULL)
395 ++ {
396 ++ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
397 ++ return 0;
398 ++
399 ++ for (SIP_SSIZE_T i = 0; i < len; ++i)
400 ++ {
401 ++ PyObject *tup = PySequence_ITEM(sipPy, i);
402 ++
403 ++ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2)
404 ++ return 0;
405 ++
406 ++ if (!sipCanConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, SIP_NOT_NONE))
407 ++ return 0;
408 ++ }
409 ++
410 ++ return 1;
411 ++ }
412 ++
413 ++ QList<QPair<double, TYPE> > *ql = new QList<QPair<double, TYPE> >;
414 ++ len = PySequence_Size(sipPy);
415 ++
416 ++ for (SIP_SSIZE_T i = 0; i < len; ++i)
417 ++ {
418 ++ PyObject *tup = PySequence_ITEM(sipPy, i);
419 ++ double d;
420 ++ int state;
421 ++
422 ++ d = PyFloat_AsDouble(PySequence_ITEM(tup, 0));
423 ++ TYPE *t = reinterpret_cast<TYPE *>(sipConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
424 ++
425 ++ if (*sipIsErr)
426 ++ {
427 ++ sipReleaseInstance(t, sipClass_TYPE, state);
428 ++
429 ++ delete ql;
430 ++ return 0;
431 ++ }
432 ++
433 ++ ql->append(QPair<double, TYPE>(d, *t));
434 ++
435 ++ sipReleaseInstance(t, sipClass_TYPE, state);
436 ++ }
437 ++
438 ++ *sipCppPtr = ql;
439 ++
440 ++ return sipGetState(sipTransferObj);
441 ++%End
442 ++};
443 ++%End
444 ++
445 ++// QList<double> is implemented as a Python list of doubles.
446 ++%MappedType QList<double>
447 ++{
448 ++%TypeHeaderCode
449 ++#include <qlist.h>
450 ++%End
451 ++
452 ++%ConvertFromTypeCode
453 ++ // Create the list.
454 ++ PyObject *l;
455 ++
456 ++ if ((l = PyList_New(sipCpp->size())) == NULL)
457 ++ return NULL;
458 ++
459 ++ // Set the list elements.
460 ++ for (int i = 0; i < sipCpp->size(); ++i)
461 ++ {
462 ++ PyObject *pobj;
463 ++
464 ++ if ((pobj = PyFloat_FromDouble(sipCpp->value(i))) == NULL)
465 ++ {
466 ++ Py_DECREF(l);
467 ++
468 ++ return NULL;
469 ++ }
470 ++
471 ++ PyList_SET_ITEM(l, i, pobj);
472 ++ }
473 ++
474 ++ return l;
475 ++%End
476 ++
477 ++%ConvertToTypeCode
478 ++ // Check the type if that is all that is required.
479 ++ if (sipIsErr == NULL)
480 ++ return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >= 0);
481 ++
482 ++ QList<double> *ql = new QList<double>;
483 ++ SIP_SSIZE_T len = PySequence_Size(sipPy);
484 ++
485 ++ for (SIP_SSIZE_T i = 0; i < len; ++i)
486 ++ ql->append(PyFloat_AsDouble(PySequence_ITEM(sipPy, i)));
487 ++
488 ++ *sipCppPtr = ql;
489 ++
490 ++ return sipGetState(sipTransferObj);
491 ++%End
492 ++};
493 ++
494 ++%End
495
496 diff --git a/dev-python/PyQt4/metadata.xml b/dev-python/PyQt4/metadata.xml
497 new file mode 100644
498 index 0000000..8c80377
499 --- /dev/null
500 +++ b/dev-python/PyQt4/metadata.xml
501 @@ -0,0 +1,33 @@
502 +<?xml version="1.0" encoding="UTF-8"?>
503 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
504 +<pkgmetadata>
505 +<!-- maintainer-needed -->
506 + <use>
507 + <flag name="X">Build bindings for the QtGui module</flag>
508 + <flag name="compat">Install the deprecated pyqtconfig module for backward compatibility</flag>
509 + <flag name="dbus">Build bindings for the QtDBus module</flag>
510 + <flag name="declarative">Build bindings for the QtDeclarative module</flag>
511 + <flag name="designer">Build bindings for the QtDesigner module and enable the designer plugin</flag>
512 + <flag name="help">Build bindings for the QtHelp module</flag>
513 + <flag name="multimedia">Build bindings for the QtMultimedia module</flag>
514 + <flag name="opengl">Build bindings for the QtOpenGL module</flag>
515 + <flag name="phonon">Build bindings for the phonon module</flag>
516 + <flag name="script">Build bindings for the QtScript module</flag>
517 + <flag name="scripttools">Build bindings for the QtScriptTools module</flag>
518 + <flag name="sql">Build bindings for the QtSql module</flag>
519 + <flag name="svg">Build bindings for the QtSvg module</flag>
520 + <flag name="testlib">Build bindings for the QtTest module</flag>
521 + <flag name="webkit">Build bindings for the QtWebKit module</flag>
522 + <flag name="xmlpatterns">Build bindings for the QtXmlPatterns module</flag>
523 + </use>
524 + <upstream>
525 + <maintainer status="active">
526 + <email>phil@××××××××××××××××××.com</email>
527 + <name>Phil Thompson</name>
528 + </maintainer>
529 + <bugs-to>mailto:pyqt@××××××××××××××××××.com</bugs-to>
530 + <doc>http://pyqt.sourceforge.net/Docs/PyQt4/</doc>
531 + <remote-id type="pypi">PyQt4</remote-id>
532 + <remote-id type="sourceforge">pyqt</remote-id>
533 + </upstream>
534 +</pkgmetadata>