[oe] [meta-qt5][PATCH 2/2] python-pyqt5: Add recipe.

Philip Balister philip at balister.org
Sat May 13 20:23:42 UTC 2017


On 05/13/2017 04:03 PM, Andreas Müller wrote:
> On Sat, May 13, 2017 at 9:24 PM, Philip Balister <philip at balister.org> wrote:
>>  * Build tested on raspberrypi3
>>  * I promise to chase the patch upstream.
>>
>> Signed-off-by: Philip Balister <philip at balister.org>
> Hi Philip,
> 
> I played around with this too - but did not finish and am happy to you
> put some progress on it.
>> ---
>>  recipes-python/pyqt5/files/fix-sm.patch    | 17 ++++++++
>>  recipes-python/pyqt5/python-pyqt5_5.8.2.bb | 68 ++++++++++++++++++++++++++++++
>>  2 files changed, 85 insertions(+)
>>  create mode 100644 recipes-python/pyqt5/files/fix-sm.patch
>>  create mode 100644 recipes-python/pyqt5/python-pyqt5_5.8.2.bb
>>
>> diff --git a/recipes-python/pyqt5/files/fix-sm.patch b/recipes-python/pyqt5/files/fix-sm.patch
>> new file mode 100644
>> index 0000000..f2936a2
>> --- /dev/null
>> +++ b/recipes-python/pyqt5/files/fix-sm.patch
>> @@ -0,0 +1,17 @@
>> +--- PyQt5_gpl-5.8.2/sip/QtGui/qguiapplication.sip.orig 2017-05-13 13:28:42.523392315 -0400
>> ++++ PyQt5_gpl-5.8.2/sip/QtGui/qguiapplication.sip      2017-05-13 13:30:08.081207211 -0400
>> +@@ -270,12 +270,14 @@
>> + %End
>> +
>> + public:
>> ++%If (PyQt_SessionManager)
>> + %If (Qt_5_6_0 -)
>> +     static bool isFallbackSessionManagementEnabled();
>> + %End
>> + %If (Qt_5_6_0 -)
>> +     static void setFallbackSessionManagementEnabled(bool);
>> + %End
>> ++%End
>> +
>> + signals:
>> + %If (Qt_5_6_0 -)
>> diff --git a/recipes-python/pyqt5/python-pyqt5_5.8.2.bb b/recipes-python/pyqt5/python-pyqt5_5.8.2.bb
>> new file mode 100644
>> index 0000000..b4c0a8d
>> --- /dev/null
>> +++ b/recipes-python/pyqt5/python-pyqt5_5.8.2.bb
>> @@ -0,0 +1,68 @@
>> +SUMMARY = "Python Qt5 Bindings"
>> +AUTHOR = "Phil Thomson @ riverbank.co.uk"
>> +HOMEPAGE = "http://riverbankcomputing.co.uk"
>> +SECTION = "devel/python"
>> +LICENSE = "GPLv3"
>> +LIC_FILES_CHKSUM = "\
>> +    file://LICENSE;md5=d32239bcb673463ab874e80d47fae504 \
>> +"
>> +DEPENDS = "sip sip-native qtbase python"
>> +
>> +SRC_URI = "\
>> +    ${SOURCEFORGE_MIRROR}/pyqt/PyQt5_gpl-${PV}.tar.gz \
>> +    file://fix-sm.patch \
>> +"
>> +SRC_URI[md5sum] = "c3048e9d242f3e72fd393630da1d971a"
>> +SRC_URI[sha256sum] = "ebd70515b30bbd6098fee29e6271a6696b1183c5530ee30e6ba9aaab195536e8"
>> +
>> +S = "${WORKDIR}/PyQt5_gpl-${PV}"
>> +
>> +
>> +inherit qmake5 pythonnative python-dir distro_features_check
>> +# depends on qt4-x11-free
>> +REQUIRED_DISTRO_FEATURES = "x11"
>> +
>> +export BUILD_SYS
>> +export HOST_SYS
>> +export STAGING_INCDIR
>> +export STAGING_LIBDIR
>> +
>> +DISABLED_FEATURES = "PyQt_Desktop_OpenGL PyQt_Accessibility PyQt_SessionManager"
>> +
>> +DISABLED_FEATURES_append_arm = " PyQt_qreal_double"
>> +
>> +PYQT_MODULES = "QtCore QtGui QtNetwork"
>> +PYQT_MODULES_aarch64 = "QtCore QtGui QtNetwork"
>> +
>> +do_configure_prepend() {
>> +    cd ${S}
>> +    echo "py_platform = linux" > pyqt.cfg
>> +    echo "py_inc_dir = %(sysroot)/$includedir/python%(py_major).%(py_minor)" >> pyqt.cfg
>> +    echo "py_pylib_dir = %(sysroot)/${libdir}/python%(py_major).%(py_minor)" >> pyqt.cfg
>> +    echo "py_pylib_lib = python%(py_major).%(py_minor)mu" >> pyqt.cfg
>> +    echo "pyqt_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> pyqt.cfg
>> +    echo "pyqt_bin_dir = ${D}/${bindir}" >> pyqt.cfg
>> +    echo "pyqt_sip_dir = ${D}/${datadir}/sip/PyQt5" >> pyqt.cfg
>> +    echo "pyuic_interpreter = ${D}/${bindir}/python%(py_major).%(py_minor)" >> pyqt.cfg
>> +    echo "pyqt_disabled_features = ${DISABLED_FEATURES}" >> pyqt.cfg
>> +    echo "qt_shared = True" >> pyqt.cfg
>> +    echo "[Qt 5.7]" >> pyqt.cfg
> ^ How about
>     QT_VERSION=`${OE_QMAKE_QMAKE} -query QT_VERSION`
>     echo "[Qt $QT_VERSION]" >> pyqt.cfg
> That worked for me

I'll give it a try and resubmit.


>> +    echo "pyqt_modules = ${PYQT_MODULES}" >> pyqt.cfg
>> +    echo yes | python configure.py --verbose --qmake  ${STAGING_BINDIR_NATIVE}/qt5/qmake --configuration pyqt.cfg --sysroot ${STAGING_DIR_HOST}
>> +}
>> +
>> +do_compile() {
>> +    cd ${S}
>> +    oe_runmake
>> +}
>> +
>> +do_install() {
>> +    cd ${S}
>> +    oe_runmake install
>> +}
>> +
>> +RDEPENDS_${PN} = "python-core python-sip"
> ^ I don't know your use case but do you think there is a chance to
> support python3?

I using this to support gnuradio, and one of the next things is get this
all working with python3. Do we need to support both python2 and 3 for pyqt?

Thanks,

Philip


>> +
>> +FILES_${PN} += "${libdir}/${PYTHON_DIR}/site-packages ${datadir}/sip/PyQt5/"
>> +FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/site-packages/*/.debug/"
>> +
>> --
>> 2.7.4
>>
> Best regards
> 
> Andreas
> 



More information about the Openembedded-devel mailing list