summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2006-05-01 12:01:44 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-05-01 12:01:44 +0000
commit9c4951eb174ea42368077d008d78c01222bbed37 (patch)
treee6cf892280dd44a530704816fa48ecad9a074269
parentf651aff5343f010922eaf71b0fe586a2c5695936 (diff)
add PyQt4, the Python Bindings for Qt4/X11
-rw-r--r--classes/sip4.bbclass53
-rw-r--r--packages/python/python-pyqt4/.mtn2git_empty0
-rw-r--r--packages/python/python-pyqt4/cross-compile.patch33
-rw-r--r--packages/python/python-pyqt4/optional-features.patch96
-rw-r--r--packages/python/python-pyqt4_0.9.bb69
5 files changed, 251 insertions, 0 deletions
diff --git a/classes/sip4.bbclass b/classes/sip4.bbclass
new file mode 100644
index 0000000000..d58c2d6381
--- /dev/null
+++ b/classes/sip4.bbclass
@@ -0,0 +1,53 @@
+DEPENDS_prepend = "sip4-native "
+RDEPENDS_append = "python-sip4"
+# EXTRA_SIPTAGS = "-tWS_X11 -tQt_4_1_1"
+
+sip4_do_generate() {
+ if [ -z "${SIP_MODULES}" ]; then
+ MODULES="`ls sip/*mod.sip`"
+ else
+ MODULES="${SIP_MODULES}"
+ fi
+
+ if [ -z "$MODULES" ]; then
+ die "SIP_MODULES not set and no modules found in $PWD"
+ else
+ oenote "using modules '${SIP_MODULES}' and tags '${EXTRA_SIPTAGS}'"
+ fi
+
+ if [ -z "${EXTRA_SIPTAGS}" ]; then
+ die "EXTRA_SIPTAGS needs to be set!"
+ else
+ SIPTAGS="${EXTRA_SIPTAGS}"
+ fi
+
+ if [ ! -z "${SIP_FEATURES}" ]; then
+ FEATURES="-z ${SIP_FEATURES}"
+ oenote "sip feature file: ${SIP_FEATURES}"
+ fi
+
+ for module in $MODULES
+ do
+ install -d ${module}/
+ echo "calling 'sip4 -I sip -I ${STAGING_SIPDIR} ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.pro.in sip/${module}/${module}mod.sip'"
+ sip4 -I ${STAGING_SIPDIR} -I sip ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.sbf \
+ sip/${module}/${module}mod.sip || die "Error calling sip on ${module}"
+ cat ${module}/${module}.sbf | sed s,target,TARGET, \
+ | sed s,sources,SOURCES, \
+ | sed s,headers,HEADERS, \
+ | sed s,"moc_HEADERS =","HEADERS +=", \
+ >${module}/${module}.pro
+ echo "TEMPLATE=lib" >>${module}/${module}.pro
+ [ "${module}" = "qt" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtcanvas" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qttable" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qwt" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtpe" ] && echo "" >>${module}/${module}.pro
+ [ "${module}" = "qtpe" ] && echo "LIBS+=-lqpe" >>${module}/${module}.pro
+ true
+ done
+}
+
+EXPORT_FUNCTIONS do_generate
+
+addtask generate after do_unpack do_patch before do_configure
diff --git a/packages/python/python-pyqt4/.mtn2git_empty b/packages/python/python-pyqt4/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/python/python-pyqt4/.mtn2git_empty
diff --git a/packages/python/python-pyqt4/cross-compile.patch b/packages/python/python-pyqt4/cross-compile.patch
new file mode 100644
index 0000000000..fb1524c09d
--- /dev/null
+++ b/packages/python/python-pyqt4/cross-compile.patch
@@ -0,0 +1,33 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- PyQt4-gpl-4.0beta1/configure.py~cross-compile.patch
++++ PyQt4-gpl-4.0beta1/configure.py
+@@ -471,7 +471,7 @@
+ sipconfig.error("Unable to create the %s directory." % mname)
+
+ # Build the SIP command line.
+- argv = ['"' + sipcfg.sip_bin + '"']
++ argv = ['"' + sipcfg.sip_bin + '4"']
+
+ argv.extend(qt_sip_flags)
+
+@@ -846,7 +846,15 @@
+ """Set the qt_dir, qt_incdir, qt_libdir, qt_bindir and qt_datadir globals
+ for the Qt installation.
+ """
+- sipconfig.inform("Determining the layout of your Qt installation...")
++ sipconfig.inform("Determining the layout of your Qt installation... - patched for OpenEmbedded by :M:")
++
++ global qt_dir, qt_incdir, qt_libdir, qt_bindir, qt_datadir
++ qt_dir = os.getenv( "QTDIR" )
++ qt_incdir = "%s/include" % qt_dir
++ qt_libdir = "%s/lib" % qt_dir
++ qt_bindir = "%s/bin" % qt_dir
++ qt_datadir = "%s/share" % qt_dir
++ return
+
+ if not opt_qmake:
+ sipconfig.error("Make sure you have a working Qt v4 qmake on your PATH or use the -q argument to explicitly specify a working Qt v4 qmake.")
diff --git a/packages/python/python-pyqt4/optional-features.patch b/packages/python/python-pyqt4/optional-features.patch
new file mode 100644
index 0000000000..02a4e80848
--- /dev/null
+++ b/packages/python/python-pyqt4/optional-features.patch
@@ -0,0 +1,96 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- PyQt4-gpl-4.0beta1/sip/QtGui/qsessionmanager.sip~optional-features.patch
++++ PyQt4-gpl-4.0beta1/sip/QtGui/qsessionmanager.sip
+@@ -21,7 +21,8 @@
+ // PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+ // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-
++//%Feature SessionManager
++%If (SessionManager)
+ class QSessionManager : QObject
+ {
+ %TypeHeaderCode
+@@ -58,3 +59,4 @@
+ bool isPhase2() const;
+ void requestPhase2();
+ };
++%End
+--- PyQt4-gpl-4.0beta1/sip/QtGui/qapplication.sip~optional-features.patch
++++ PyQt4-gpl-4.0beta1/sip/QtGui/qapplication.sip
+@@ -20,7 +20,7 @@
+ // You should have received a copy of the GNU General Public License along with
+ // PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+ // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-
++%Feature SessionManager
+
+ // QApplication *qApp
+ QApplication *qApp;
+@@ -101,7 +101,9 @@
+ {sipName_QStandardItemModel, &sipClass_QStandardItemModel, -1, 8},
+ {sipName_QLayout, &sipClass_QLayout, 27, 9},
+ {sipName_QTextObject, &sipClass_QTextObject, 32, 10},
++#ifndef QT_NO_SESSIONMANAGER
+ {sipName_QSessionManager, &sipClass_QSessionManager, -1, 11},
++#endif
+ {sipName_QWidget, &sipClass_QWidget, 36, 12},
+ {sipName_QMovie, &sipClass_QMovie, -1, 13},
+ {sipName_QAbstractProxyModel, &sipClass_QAbstractProxyModel, 100, 14},
+@@ -357,11 +359,13 @@
+ static bool isLeftToRight();
+ static bool isEffectEnabled(Qt::UIEffect);
+ static void setEffectEnabled(Qt::UIEffect, bool enable = true);
++%If (SessionManager)
+ bool isSessionRestored() const;
+ QString sessionId() const;
+ QString sessionKey() const;
+ virtual void commitData(QSessionManager &sm);
+ virtual void saveState(QSessionManager &sm);
++%End
+ void setInputContext(QInputContext *);
+ QInputContext *inputContext() const;
+ static int exec() /PostHook=__pyQtPostEventLoopHook__, PreHook=__pyQtPreEventLoopHook__, PyName=exec_, ReleaseGIL/;
+--- PyQt4-gpl-4.0beta1/sip/QtGui/qwidget.sip~optional-features.patch
++++ PyQt4-gpl-4.0beta1/sip/QtGui/qwidget.sip
+@@ -20,7 +20,10 @@
+ // You should have received a copy of the GNU General Public License along with
+ // PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
+ // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-
++%Feature Accessibility
++%Feature ToolTips
++%Feature StatusTips
++%Feature WhatsThis
+
+ class QWidget : QObject, QPaintDevice
+ {
+@@ -128,16 +131,24 @@
+ void setWindowOpacity(qreal level);
+ qreal windowOpacity() const;
+ bool isWindowModified() const;
++%If (ToolTips)
+ void setToolTip(const QString &);
+ QString toolTip() const;
++%End
++%If (StatusTips)
+ void setStatusTip(const QString &);
+ QString statusTip() const;
++%End
++%If (WhatsThis)
+ void setWhatsThis(const QString &);
+ QString whatsThis() const;
++%End
++%If (Accessibility)
+ QString accessibleName() const;
+ void setAccessibleName(const QString &name);
+ QString accessibleDescription() const;
+ void setAccessibleDescription(const QString &description);
++%End
+ void setLayoutDirection(Qt::LayoutDirection direction);
+ Qt::LayoutDirection layoutDirection() const;
+ void unsetLayoutDirection();
diff --git a/packages/python/python-pyqt4_0.9.bb b/packages/python/python-pyqt4_0.9.bb
new file mode 100644
index 0000000000..e56d6b36ef
--- /dev/null
+++ b/packages/python/python-pyqt4_0.9.bb
@@ -0,0 +1,69 @@
+DESCRIPTION = "Python Qt4 Bindings"
+HOMEPAGE = "http://riverbankcomputing.co.uk"
+AUTHOR = "Phil Thomson @ riverbank.co.uk"
+SECTION = "devel/python"
+PRIORITY = "optional"
+MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
+LICENSE = "GPL"
+DEPENDS = "qt4x11"
+RDEPENDS = "python-core"
+SRCNAME = "pyqt"
+PR = "ml0"
+
+SRC_URI = "http://www.riverbankcomputing.com/Downloads/PyQt4/GPL/PyQt4-gpl-4.0beta1.tar.gz \
+ file://cross-compile.patch;patch=1 \
+ file://optional-features.patch;patch=1"
+S = "${WORKDIR}/PyQt4-gpl-4.0beta1"
+
+inherit qmake qt4x11 sip4 distutils-base
+
+PARALLEL_MAKE = ""
+
+QMAKE_PROFILES = "pyqt.pro"
+EXTRA_SIPTAGS = "-tWS_X11 -tQt_4_1_1 -xVendorID -xSessionManager -xAccessibility"
+EXTRA_OEMAKE = " MAKEFLAGS= "
+
+SIP_MODULES = "QtCore QtGui QtNetwork QtSql QtSvg QtXml"
+# SIP_MODULES += "QtAssistant"
+EXTRA_QMAKEVARS_POST += "INCLUDEPATH+=${OE_QMAKE_INCDIR_QT}/Qt \
+ INCLUDEPATH+=${STAGING_INCDIR}/${PYTHON_DIR}"
+
+#EXTRA_QMAKEVARS_POST += "QMAKE_UIC=${STAGING_BINDIR}/uic \
+# QMAKE_MOC=${STAGING_BINDIR}/moc \
+# QMAKE_RPATH=-Wl,-rpath-link, \
+# DESTDIR= \
+# VERSION=1.0.0 \
+# DEFINES+=SIP_MAKE_DLL \
+# DEFINES+=SIP_QT_SUPPORT \
+# INCLUDEPATH+=. \
+# INCLUDEPATH+=${STAGING_INCDIR}/${PYTHON_DIR} \
+# INCLUDEPATH+=${STAGING_INCDIR} \
+# LIBS+=-L${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages"
+
+do_configure_prepend() {
+ echo -e "TEMPLATE=subdirs\nSUBDIRS=${SIP_MODULES}\n" >pyqt.pro
+}
+
+#do_configure() {
+# echo "yes" | python configure.py -w -q ${OE_QMAKE_QMAKE}
+#}
+
+do_stage() {
+ install -d ${STAGING_SIPDIR}/qt/
+ install -d ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/
+ for module in ${SIP_MODULES}
+ do
+ install -m 0644 ${S}/sip/${module}/*.sip ${STAGING_SIPDIR}/qt/
+ install -m 0755 ${module}/lib${module}.so ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/${module}.so
+ done
+}
+
+do_install() {
+ install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/
+ for module in ${SIP_MODULES}
+ do
+ install -m 0755 ${module}/lib${module}.so ${D}${libdir}/${PYTHON_DIR}/site-packages/${module}.so
+ done
+}
+
+FILES_${PN} = "${libdir}/${PYTHON_DIR}/site-packages"