[PyQt4-webkit/epel7] import

Rex Dieter rdieter at fedoraproject.org
Mon Mar 31 19:22:36 UTC 2014


commit ba178faf923e7062e9a25c3b7be5ee5ac264dcf2
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Mon Mar 31 14:22:42 2014 -0500

    import

 .gitignore                                  |    1 +
 PyQt-x11-gpl-4.10-pyuic_shbang.patch        |    8 +
 PyQt-x11-gpl-4.9.1-opengl_types.patch       |   38 ++++
 PyQt-x11-gpl-4.9.5-timestamp_multilib.patch |   13 ++
 PyQt4-webkit.spec                           |  100 +++++++++++
 qreal_float_support.diff                    |  248 +++++++++++++++++++++++++++
 sources                                     |    1 +
 7 files changed, 409 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ba7264c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/PyQt-x11-gpl-4.10.1.tar.gz
diff --git a/PyQt-x11-gpl-4.10-pyuic_shbang.patch b/PyQt-x11-gpl-4.10-pyuic_shbang.patch
new file mode 100644
index 0000000..c2d83e1
--- /dev/null
+++ b/PyQt-x11-gpl-4.10-pyuic_shbang.patch
@@ -0,0 +1,8 @@
+diff -up PyQt-x11-gpl-4.10/pyuic/uic/pyuic.py.pyuic_shbang PyQt-x11-gpl-4.10/pyuic/uic/pyuic.py
+--- PyQt-x11-gpl-4.10/pyuic/uic/pyuic.py.pyuic_shbang	2013-03-01 15:42:12.000000000 -0600
++++ PyQt-x11-gpl-4.10/pyuic/uic/pyuic.py	2013-03-03 18:09:13.822342505 -0600
+@@ -1,3 +1,4 @@
++#!/usr/bin/python -tt
+ #############################################################################
+ ##
+ ## Copyright (c) 2013 Riverbank Computing Limited <info at riverbankcomputing.com>
diff --git a/PyQt-x11-gpl-4.9.1-opengl_types.patch b/PyQt-x11-gpl-4.9.1-opengl_types.patch
new file mode 100644
index 0000000..67591c0
--- /dev/null
+++ b/PyQt-x11-gpl-4.9.1-opengl_types.patch
@@ -0,0 +1,38 @@
+diff -up PyQt-x11-gpl-4.9.1/configure.py.opengl_types PyQt-x11-gpl-4.9.1/configure.py
+--- PyQt-x11-gpl-4.9.1/configure.py.opengl_types	2012-06-21 09:52:52.916412238 -0500
++++ PyQt-x11-gpl-4.9.1/configure.py	2012-06-21 10:03:09.297706409 -0500
+@@ -1203,22 +1203,30 @@ int main(int, char **)
+ 
+     QTextStream out(&outf);
+ 
+-    if (sizeof (long) == sizeof (GLint))
++    if   (sizeof (int) == sizeof (GLint))
++        out << "typedef int GLint;\\n";
++    else if (sizeof (long) == sizeof (GLint))
+         out << "typedef long GLint;\\n";
+     else
+         out << "typedef int GLint;\\n";
+ 
+-    if (sizeof (unsigned long) == sizeof (GLuint))
++    if   (sizeof (unsigned) == sizeof (GLuint))
++        out << "typedef unsigned GLuint;\\n";
++    else if (sizeof (unsigned long) == sizeof (GLuint))
+         out << "typedef unsigned long GLuint;\\n";
+     else
+         out << "typedef unsigned GLuint;\\n";
+ 
+-    if (sizeof (unsigned long) == sizeof (GLenum))
++    if (sizeof (unsigned) == sizeof (GLenum))
++        out << "typedef unsigned GLenum;\\n";
++    else if (sizeof (unsigned long) == sizeof (GLenum))
+         out << "typedef unsigned long GLenum;\\n";
+     else
+         out << "typedef unsigned GLenum;\\n";
+ 
+-    if (sizeof (unsigned long) == sizeof (GLbitfield))
++    if   (sizeof (unsigned) == sizeof (GLbitfield))
++        out << "typedef unsigned GLbitfield;\\n";
++    else if (sizeof (unsigned long) == sizeof (GLbitfield))
+         out << "typedef unsigned long GLbitfield;\\n";
+     else
+         out << "typedef unsigned GLbitfield;\\n";
diff --git a/PyQt-x11-gpl-4.9.5-timestamp_multilib.patch b/PyQt-x11-gpl-4.9.5-timestamp_multilib.patch
new file mode 100644
index 0000000..4399c9b
--- /dev/null
+++ b/PyQt-x11-gpl-4.9.5-timestamp_multilib.patch
@@ -0,0 +1,13 @@
+diff -up PyQt-x11-gpl-4.9.5/pyrcc/rcc.cpp.timestamp PyQt-x11-gpl-4.9.5/pyrcc/rcc.cpp
+--- PyQt-x11-gpl-4.9.5/pyrcc/rcc.cpp.timestamp	2012-09-29 06:35:02.000000000 -0500
++++ PyQt-x11-gpl-4.9.5/pyrcc/rcc.cpp	2012-10-01 08:22:03.197843077 -0500
+@@ -407,8 +407,7 @@ RCCResourceLibrary::writeHeader(FILE *ou
+     fprintf(out, "# -*- coding: utf-8 -*-\n\n");
+     fprintf(out, "# Resource object code\n");
+     fprintf(out, "#\n");
+-    fprintf(out, "# Created: %s\n", QDateTime::currentDateTime().toString().toUtf8().constData());
+-    fprintf(out, "#      by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR);
++    fprintf(out, "# Created by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR);
+     fprintf(out, "#\n");
+     fprintf(out, "# WARNING! All changes made in this file will be lost!\n");
+     fprintf(out, "\n");
diff --git a/PyQt4-webkit.spec b/PyQt4-webkit.spec
new file mode 100644
index 0000000..e52a8c8
--- /dev/null
+++ b/PyQt4-webkit.spec
@@ -0,0 +1,100 @@
+
+Summary: Python bindings for Qt4 Webkit
+Name:    PyQt4-webkit
+Version: 4.10.1
+Release: 1%{?dist}
+
+# GPLv2 exceptions(see GPL_EXCEPTIONS*.txt)
+License: (GPLv3 or GPLv2 with exceptions) and BSD
+Url:     http://www.riverbankcomputing.com/software/pyqt/
+Source0:  http://downloads.sourceforge.net/pyqt/PyQt-x11-gpl%{?snap:-snapshot}-%{version}%{?snap:-%{snap}}.tar.gz
+
+## upstreamable patches
+# fix multilib conflict because of timestamp
+Patch50:  PyQt-x11-gpl-4.9.5-timestamp_multilib.patch
+# multilib-safe(r)  opengl_types.sip (hopefully)
+# simpler approach may be to not try to change these at buildime (only verify),
+# if /usr/include/GL/gl.h ever changes these types, we have bigger problems
+Patch51:  PyQt-x11-gpl-4.9.1-opengl_types.patch
+Patch52:  PyQt-x11-gpl-4.10-pyuic_shbang.patch
+
+## upstream patches
+# fix FTBFS on ARM
+Patch60:  qreal_float_support.diff
+
+BuildRequires: findutils
+BuildRequires: pkgconfig(dbus-1) pkgconfig(dbus-python)
+BuildRequires: pkgconfig(phonon)
+BuildRequires: pkgconfig(QtDBus) pkgconfig(QtDeclarative) pkgconfig(QtDesigner)
+BuildRequires: pkgconfig(QtGui) pkgconfig(QtHelp) pkgconfig(QtMultimedia)
+BuildRequires: pkgconfig(QtNetwork) pkgconfig(QtOpenGL)
+BuildRequires: pkgconfig(QtScript) pkgconfig(QtScriptTools)
+BuildRequires: pkgconfig(QtSql) pkgconfig(QtSvg) pkgconfig(QtTest)
+BuildRequires: pkgconfig(QtXml) pkgconfig(QtXmlPatterns)
+BuildRequires: pkgconfig(QtWebKit)
+BuildRequires: python2-devel
+BuildRequires: sip-devel >= 4.14.3
+
+%{?_qt4_version:Requires: qt4%{?_isa} >= %{_qt4_version}}
+%{?_sip_api:Requires: sip-api(%{_sip_api_major}) >= %{_sip_api}}
+
+%filter_provides_in %{python_sitearch} %{?_qt4_plugindir}
+%filter_setup
+
+%description
+%{summary}.
+
+%package devel
+Summary: Files needed to build other bindings based on Qt4 WebKit
+Requires: PyQt4-devel
+BuildArch: noarch
+%description devel
+%{summary}.
+
+
+%prep
+%setup -q -n PyQt-x11-gpl%{?snap:-snapshot}-%{version}%{?snap:-%{snap}}
+
+%patch50 -p1 -b .timestamp
+%patch51 -p1 -b .opengl_types
+%patch52 -p1 -b .pyuic_shbang
+# save orig for comparison later
+cp -a ./sip/QtOpenGL/opengl_types.sip ./sip/QtOpenGL/opengl_types.sip.orig
+%patch60 -p1 -b .arm
+
+# permissions, mark examples non-executable
+find examples/ -name "*.py" | xargs chmod a-x
+chmod a+rx pyuic/uic/pyuic.py
+
+
+%build
+
+QT4DIR=%{_qt4_prefix}
+PATH=%{_qt4_bindir}:$PATH ; export PATH
+
+%{__python2} configure.py \
+  --assume-shared \
+  --confirm-license \
+  --no-timestamp \
+  --qmake=%{_qt4_qmake} \
+  --verbose
+
+make %{?_smp_mflags} -C QtWebKit/
+
+
+%install
+make install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} -C QtWebKit/
+
+
+
+%files
+%{python2_sitearch}/PyQt4/QtWebKit.so
+
+%files devel
+%{_datadir}/sip/PyQt4/
+
+
+%changelog
+* Sat Mar 22 2014 Rex Dieter <rdieter at fedoraproject.org> 4.10.1-1
+- adapt el6 PyQt4-webkit for epel-7
+
diff --git a/qreal_float_support.diff b/qreal_float_support.diff
new file mode 100644
index 0000000..af6c9cf
--- /dev/null
+++ b/qreal_float_support.diff
@@ -0,0 +1,248 @@
+## 03_qreal_float_support.dpatch by Michael Casadevall <sonicmctails at gmail.com>
+Index: python-qt4-4.9.1/configure.py
+===================================================================
+--- python-qt4-4.9.1.orig/configure.py	2012-02-11 16:59:33.402554204 -0500
++++ python-qt4-4.9.1/configure.py	2012-02-11 17:02:46.626548495 -0500
+@@ -2072,8 +2072,9 @@
+     out << "PyQt_NoOpenGLES\\n";
+ #endif
+ 
+-    if (sizeof (qreal) != sizeof (double))
++#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE)
+         out << "PyQt_qreal_double\\n";
++#endif
+ 
+     return 0;
+ }
+Index: python-qt4-4.9.1/sip/QtCore/qlist.sip
+===================================================================
+--- python-qt4-4.9.1.orig/sip/QtCore/qlist.sip	2012-02-11 16:59:33.422554203 -0500
++++ python-qt4-4.9.1/sip/QtCore/qlist.sip	2012-02-11 17:05:31.546543622 -0500
+@@ -807,3 +807,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<QPair<double, double> > is implemented as a Python list of 2-element tuples.
++%MappedType QList<QPair<double, double> >
++{
++%TypeHeaderCode
++#include <qlist.h>
++#include <qpair.h>
++%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<double, double> &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<QPair<double, double> > *ql = new QList<QPair<double, double> >;
++    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<double, double>(first, second));
++    }
++
++    *sipCppPtr = ql;
++
++    return sipGetState(sipTransferObj);
++%End
++};
++%End
++%If (Qt_4_3_0 -)
++// QList<QPair<double, TYPE> > is implemented as a Python list of 2-element tuples.
++template<double, TYPE>
++%MappedType QList<QPair<double, TYPE> >
++{
++%TypeHeaderCode
++#include <qlist.h>
++#include <qpair.h>
++%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<double, TYPE> &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<QPair<double, TYPE> > *ql = new QList<QPair<double, TYPE> >;
++    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<TYPE *>(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<double, TYPE>(d, *t));
++
++        sipReleaseInstance(t, sipClass_TYPE, state);
++    }
++
++    *sipCppPtr = ql;
++
++    return sipGetState(sipTransferObj);
++%End
++};
++%End
++
++// QList<double> is implemented as a Python list of doubles.
++%MappedType QList<double>
++{
++%TypeHeaderCode
++#include <qlist.h>
++%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<double> *ql = new QList<double>;
++    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/sources b/sources
index e69de29..99f8870 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e5973c4ec0b0469f329bc00209d2ad9c  PyQt-x11-gpl-4.10.1.tar.gz


More information about the scm-commits mailing list