From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 175E4138334 for ; Sat, 30 Jun 2018 11:29:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 32175E088F; Sat, 30 Jun 2018 11:29:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EBF74E088F for ; Sat, 30 Jun 2018 11:29:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B32BF335C89 for ; Sat, 30 Jun 2018 11:29:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CB0532C8 for ; Sat, 30 Jun 2018 11:29:13 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1530358067.8d3c51b13ee42453f19d54cd09e70cc9bfc09721.asturm@gentoo> Subject: [gentoo-commits] proj/kde-sunset:master commit in: dev-python/PyQt4/files/, dev-python/PyQt4/ X-VCS-Repository: proj/kde-sunset X-VCS-Files: dev-python/PyQt4/PyQt4-4.12.1.ebuild dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch dev-python/PyQt4/files/PyQt4-4.7.3-qreal_float_support.patch dev-python/PyQt4/metadata.xml X-VCS-Directories: dev-python/PyQt4/files/ dev-python/PyQt4/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 8d3c51b13ee42453f19d54cd09e70cc9bfc09721 X-VCS-Branch: master Date: Sat, 30 Jun 2018 11:29:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6584a91a-13ed-4212-9e9a-e94d4850b6d9 X-Archives-Hash: 972ecaf153ed842a9e208a220582e4b9 commit: 8d3c51b13ee42453f19d54cd09e70cc9bfc09721 Author: Andreas Sturmlechner gmail com> AuthorDate: Sat Jun 30 11:27:47 2018 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Jun 30 11:27:47 2018 +0000 URL: https://gitweb.gentoo.org/proj/kde-sunset.git/commit/?id=8d3c51b1 dev-python/PyQt4: Import from Gentoo ebuild repository Package-Manager: Portage-2.3.41, Repoman-2.3.9 dev-python/PyQt4/PyQt4-4.12.1.ebuild | 193 +++++++++++++++++ dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch | 25 +++ .../files/PyQt4-4.7.3-qreal_float_support.patch | 239 +++++++++++++++++++++ dev-python/PyQt4/metadata.xml | 33 +++ 4 files changed, 490 insertions(+) diff --git a/dev-python/PyQt4/PyQt4-4.12.1.ebuild b/dev-python/PyQt4/PyQt4-4.12.1.ebuild new file mode 100644 index 0000000..aa304f2 --- /dev/null +++ b/dev-python/PyQt4/PyQt4-4.12.1.ebuild @@ -0,0 +1,193 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) + +inherit multibuild python-r1 qmake-utils toolchain-funcs + +DESCRIPTION="Python bindings for the Qt framework" +HOMEPAGE="https://www.riverbankcomputing.com/software/pyqt/intro" + +MY_P=${PN}_gpl_x11-${PV/_pre/.dev} +if [[ ${PV} == *_pre* ]]; then + SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.xz" +else + SRC_URI="mirror://sourceforge/pyqt/${MY_P}.tar.gz" +fi + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="alpha amd64 ~arm ~arm64 ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux" + +IUSE="X compat dbus debug declarative designer doc examples help multimedia + opengl phonon script scripttools sql svg testlib webkit xmlpatterns" +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + sql? ( X ) + testlib? ( X ) +" + +# Minimal supported version of Qt. +QT_PV="4.8.5:4" + +RDEPEND=" + ${PYTHON_DEPS} + >=dev-python/sip-4.19.1:=[${PYTHON_USEDEP}] + >=dev-qt/qtcore-${QT_PV} + X? ( >=dev-qt/qtgui-${QT_PV} ) + dbus? ( + dev-python/dbus-python[${PYTHON_USEDEP}] + >=dev-qt/qtdbus-${QT_PV} + ) + declarative? ( >=dev-qt/qtdeclarative-${QT_PV} ) + designer? ( >=dev-qt/designer-${QT_PV} ) + help? ( >=dev-qt/qthelp-${QT_PV} ) + multimedia? ( >=dev-qt/qtmultimedia-${QT_PV} ) + opengl? ( >=dev-qt/qtopengl-${QT_PV} ) + phonon? ( >=media-libs/phonon-4.7[qt4] ) + script? ( >=dev-qt/qtscript-${QT_PV} ) + scripttools? ( >=dev-qt/qtgui-${QT_PV} ) + sql? ( >=dev-qt/qtsql-${QT_PV} ) + svg? ( >=dev-qt/qtsvg-${QT_PV} ) + testlib? ( >=dev-qt/qttest-${QT_PV} ) + webkit? ( >=dev-qt/qtwebkit-${QT_PV} ) + xmlpatterns? ( >=dev-qt/qtxmlpatterns-${QT_PV} ) +" +DEPEND="${RDEPEND} + dbus? ( virtual/pkgconfig ) +" + +S=${WORKDIR}/${MY_P} + +DOCS=( "${S}"/{ChangeLog,NEWS,THANKS} ) +PATCHES=( + # Allow building against KDE's phonon (bug 525354) + "${FILESDIR}/${PN}-4.11.2-phonon.patch" +) + +src_prepare() { + # Support qreal on arm architecture (bug 322349) + use arm && PATCHES+=("${FILESDIR}/${PN}-4.7.3-qreal_float_support.patch") + + default +} + +pyqt_run() { + echo "$@" + "${PYTHON}" "$@" +} + +pyqt_use_enable() { + use "$1" || return + + echo --enable=${2:-Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}} +} + +src_configure() { + configuration() { + local myconf=( + $(usex debug '--debug --trace' '') + --verbose + --confirm-license + --qmake="$(qt4_get_bindir)"/qmake + --bindir="${EPREFIX}/usr/bin" + --destdir="$(python_get_sitedir)" + --qsci-api + --enable=QtCore + --enable=QtNetwork + --enable=QtXml + $(pyqt_use_enable X QtGui) + $(pyqt_use_enable dbus QtDBus) + $(pyqt_use_enable declarative) + $(pyqt_use_enable designer) + $(usex designer '' --no-designer-plugin) + $(pyqt_use_enable help) + $(pyqt_use_enable multimedia) + $(pyqt_use_enable opengl QtOpenGL) + $(pyqt_use_enable phonon phonon) + $(pyqt_use_enable script) + $(pyqt_use_enable scripttools QtScriptTools) + $(pyqt_use_enable sql) + $(pyqt_use_enable svg) + $(pyqt_use_enable testlib QtTest) + $(pyqt_use_enable webkit QtWebKit) + $(pyqt_use_enable xmlpatterns QtXmlPatterns) + ) + + if use compat; then + local compat_build_dir=${BUILD_DIR%/}-compat + cp -Rp "${S}" "${compat_build_dir}" || die + pushd "${compat_build_dir}" >/dev/null || die + + local mycompatconf=( + "${myconf[@]}" + AR="$(tc-getAR) cqs" + CC="$(tc-getCC)" + CFLAGS="${CFLAGS}" + CFLAGS_RELEASE= + CXX="$(tc-getCXX)" + CXXFLAGS="${CXXFLAGS}" + CXXFLAGS_RELEASE= + LINK="$(tc-getCXX)" + LINK_SHLIB="$(tc-getCXX)" + LFLAGS="${LDFLAGS}" + LFLAGS_RELEASE= + RANLIB= + STRIP= + ) + pyqt_run configure.py "${mycompatconf[@]}" || die + + popd >/dev/null || die + fi + + myconf+=( + --sip-incdir="$(python_get_includedir)" + $(usex dbus '' --no-python-dbus) + ) + pyqt_run "${S}"/configure-ng.py "${myconf[@]}" || die + + eqmake4 -recursive ${PN}.pro + } + python_foreach_impl run_in_build_dir configuration +} + +src_compile() { + python_foreach_impl run_in_build_dir default +} + +src_install() { + installation() { + local tmp_root=${D%/}/tmp + emake INSTALL_ROOT="${tmp_root}" install + + local uic_dir=${tmp_root}$(python_get_sitedir)/${PN}/uic + if python_is_python3; then + rm -r "${uic_dir}"/port_v2 || die + else + rm -r "${uic_dir}"/port_v3 || die + fi + + python_doexe "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 + rm "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 || die + + multibuild_merge_root "${tmp_root}" "${D}" + + if use compat; then + local compat_build_dir=${BUILD_DIR%/}-compat + python_moduleinto ${PN} + python_domodule "${compat_build_dir}"/pyqtconfig.py + fi + + python_optimize + } + python_foreach_impl run_in_build_dir installation + + einstalldocs + use doc && dodoc -r doc/html + + if use examples; then + insinto /usr/share/doc/${PF} + doins -r examples + fi +} diff --git a/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch b/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch new file mode 100644 index 0000000..e3449b3 --- /dev/null +++ b/dev-python/PyQt4/files/PyQt4-4.11.2-phonon.patch @@ -0,0 +1,25 @@ +From e8931ed7f49eb55d6259328a5a78f3fc18472d48 Mon Sep 17 00:00:00 2001 +From: Davide Pesavento +Date: Tue, 14 Oct 2014 04:30:29 +0200 +Subject: [PATCH] Support building against KDE's phonon variant. + +--- + configure-ng.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure-ng.py b/configure-ng.py +index a80cb57..fd2c56c 100644 +--- a/configure-ng.py ++++ b/configure-ng.py +@@ -2256,6 +2256,8 @@ def generate_sip_module_code(target_config, verbose, no_timestamp, parts, tracin + if mname == 'QtCore': + includepath = target_config.vend_inc_dir + libs = '-L%s -lvendorid' % target_config.vend_lib_dir ++ if mname == 'phonon': ++ includepath = os.path.join(sys.prefix, 'include', 'phonon') + + generate_module_makefile(target_config, verbose, mname, + includepath=includepath, libs=libs, qpy_sources=qpy_sources, +-- +2.1.2 + 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 new file mode 100644 index 0000000..37e1e69 --- /dev/null +++ b/dev-python/PyQt4/files/PyQt4-4.7.3-qreal_float_support.patch @@ -0,0 +1,239 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_qreal_float_support.dpatch by Michael Casadevall +## +## DP: Corrects a configure test, and adds explicate double handling +## to qlist.sip on architectures where qreal != double + +@DPATCH@ +Index: python-qt4-4.7.2/sip/QtCore/qlist.sip +=================================================================== +--- python-qt4-4.7.2.orig/sip/QtCore/qlist.sip 2010-03-17 19:29:26.000000000 +0100 ++++ python-qt4-4.7.2/sip/QtCore/qlist.sip 2010-03-25 23:53:55.468631945 +0100 +@@ -749,3 +749,227 @@ + return sipGetState(sipTransferObj); + %End + }; ++ ++// If we're on an architecture where qreal != double, then we need to also ++// explicately handle doubles. On architectures where qreal == double, they ++// will automaticially be cast upwards ++ ++%If (!PyQt_qreal_double) ++ ++%If (Qt_4_3_0 -) ++// QList > is implemented as a Python list of 2-element tuples. ++%MappedType QList > ++{ ++%TypeHeaderCode ++#include ++#include ++%End ++ ++%ConvertFromTypeCode ++ // Create the list. ++ PyObject *l; ++ ++ if ((l = PyList_New(sipCpp->size())) == NULL) ++ return NULL; ++ ++ // Set the list elements. ++ for (int i = 0; i < sipCpp->size(); ++i) ++ { ++ const QPair &p = sipCpp->at(i); ++ PyObject *pobj; ++ ++ if ((pobj = Py_BuildValue((char *)"dd", p.first, p.second)) == NULL) ++ { ++ Py_DECREF(l); ++ ++ return NULL; ++ } ++ ++ PyList_SET_ITEM(l, i, pobj); ++ } ++ ++ return l; ++%End ++ ++%ConvertToTypeCode ++ SIP_SSIZE_T len; ++ ++ // Check the type if that is all that is required. ++ if (sipIsErr == NULL) ++ { ++ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) ++ return 0; ++ ++ for (SIP_SSIZE_T i = 0; i < len; ++i) ++ { ++ PyObject *tup = PySequence_ITEM(sipPy, i); ++ ++ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2) ++ return 0; ++ } ++ ++ return 1; ++ } ++ ++ QList > *ql = new QList >; ++ len = PySequence_Size(sipPy); ++ ++ for (SIP_SSIZE_T i = 0; i < len; ++i) ++ { ++ PyObject *tup = PySequence_ITEM(sipPy, i); ++ ++ double first = PyFloat_AsDouble(PySequence_ITEM(tup, 0)); ++ double second = PyFloat_AsDouble(PySequence_ITEM(tup, 1)); ++ ++ ql->append(QPair(first, second)); ++ } ++ ++ *sipCppPtr = ql; ++ ++ return sipGetState(sipTransferObj); ++%End ++}; ++%End ++%If (Qt_4_3_0 -) ++// QList > is implemented as a Python list of 2-element tuples. ++template ++%MappedType QList > ++{ ++%TypeHeaderCode ++#include ++#include ++%End ++ ++%ConvertFromTypeCode ++ // Create the list. ++ PyObject *l; ++ ++ if ((l = PyList_New(sipCpp->size())) == NULL) ++ return NULL; ++ ++ // Set the list elements. ++ for (int i = 0; i < sipCpp->size(); ++i) ++ { ++ const QPair &p = sipCpp->at(i); ++ TYPE *t = new TYPE(p.second); ++ PyObject *pobj; ++ ++ if ((pobj = sipBuildResult(NULL, "(dB)", p.first, t, sipClass_TYPE, sipTransferObj)) == NULL) ++ { ++ Py_DECREF(l); ++ delete t; ++ ++ return NULL; ++ } ++ ++ PyList_SET_ITEM(l, i, pobj); ++ } ++ ++ return l; ++%End ++ ++%ConvertToTypeCode ++ SIP_SSIZE_T len; ++ ++ // Check the type if that is all that is required. ++ if (sipIsErr == NULL) ++ { ++ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) ++ return 0; ++ ++ for (SIP_SSIZE_T i = 0; i < len; ++i) ++ { ++ PyObject *tup = PySequence_ITEM(sipPy, i); ++ ++ if (!PySequence_Check(tup) || PySequence_Size(tup) != 2) ++ return 0; ++ ++ if (!sipCanConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, SIP_NOT_NONE)) ++ return 0; ++ } ++ ++ return 1; ++ } ++ ++ QList > *ql = new QList >; ++ len = PySequence_Size(sipPy); ++ ++ for (SIP_SSIZE_T i = 0; i < len; ++i) ++ { ++ PyObject *tup = PySequence_ITEM(sipPy, i); ++ double d; ++ int state; ++ ++ d = PyFloat_AsDouble(PySequence_ITEM(tup, 0)); ++ TYPE *t = reinterpret_cast(sipConvertToInstance(PySequence_ITEM(tup, 1), sipClass_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); ++ ++ if (*sipIsErr) ++ { ++ sipReleaseInstance(t, sipClass_TYPE, state); ++ ++ delete ql; ++ return 0; ++ } ++ ++ ql->append(QPair(d, *t)); ++ ++ sipReleaseInstance(t, sipClass_TYPE, state); ++ } ++ ++ *sipCppPtr = ql; ++ ++ return sipGetState(sipTransferObj); ++%End ++}; ++%End ++ ++// QList is implemented as a Python list of doubles. ++%MappedType QList ++{ ++%TypeHeaderCode ++#include ++%End ++ ++%ConvertFromTypeCode ++ // Create the list. ++ PyObject *l; ++ ++ if ((l = PyList_New(sipCpp->size())) == NULL) ++ return NULL; ++ ++ // Set the list elements. ++ for (int i = 0; i < sipCpp->size(); ++i) ++ { ++ PyObject *pobj; ++ ++ if ((pobj = PyFloat_FromDouble(sipCpp->value(i))) == NULL) ++ { ++ Py_DECREF(l); ++ ++ return NULL; ++ } ++ ++ PyList_SET_ITEM(l, i, pobj); ++ } ++ ++ return l; ++%End ++ ++%ConvertToTypeCode ++ // Check the type if that is all that is required. ++ if (sipIsErr == NULL) ++ return (PySequence_Check(sipPy) && PySequence_Size(sipPy) >= 0); ++ ++ QList *ql = new QList; ++ SIP_SSIZE_T len = PySequence_Size(sipPy); ++ ++ for (SIP_SSIZE_T i = 0; i < len; ++i) ++ ql->append(PyFloat_AsDouble(PySequence_ITEM(sipPy, i))); ++ ++ *sipCppPtr = ql; ++ ++ return sipGetState(sipTransferObj); ++%End ++}; ++ ++%End diff --git a/dev-python/PyQt4/metadata.xml b/dev-python/PyQt4/metadata.xml new file mode 100644 index 0000000..8c80377 --- /dev/null +++ b/dev-python/PyQt4/metadata.xml @@ -0,0 +1,33 @@ + + + + + + Build bindings for the QtGui module + Install the deprecated pyqtconfig module for backward compatibility + Build bindings for the QtDBus module + Build bindings for the QtDeclarative module + Build bindings for the QtDesigner module and enable the designer plugin + Build bindings for the QtHelp module + Build bindings for the QtMultimedia module + Build bindings for the QtOpenGL module + Build bindings for the phonon module + Build bindings for the QtScript module + Build bindings for the QtScriptTools module + Build bindings for the QtSql module + Build bindings for the QtSvg module + Build bindings for the QtTest module + Build bindings for the QtWebKit module + Build bindings for the QtXmlPatterns module + + + + phil@riverbankcomputing.com + Phil Thompson + + mailto:pyqt@riverbankcomputing.com + http://pyqt.sourceforge.net/Docs/PyQt4/ + PyQt4 + pyqt + +