From f7c493937aa0972403e09f609e63901a13f39147 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Wed, 30 Mar 2022 11:08:04 +0000 Subject: [PATCH 1/3] pyside6: Qt for Python Qt for Python offers the official Python bindings for Qt, which enables you to use Python to write your Qt applications. The project has two main components: PySide6, so that you can use Qt6 APIs in your Python applications, and Shiboken6, a binding generator tool, which can be used to expose C++ projects to Python, and a Python module with some utility functions. Shiboken has dependency to libclang, the recipes can therefore be used only with meta-clang layer included in the build. Task-number: PYSIDE-1958 Change-Id: Ic4de8c37ecbfdb092a33869b472b55e5442720fc Reviewed-by: Alex Bu Reviewed-by: Mikko Gronoff Reviewed-by: Alexandru Croitor (cherry picked from commit b8d52a40be79823565d0e32986b86a0a4f1f9053) --- README.md | 4 ++ recipes-python/pyside6/python3-pyside6.inc | 33 ++++++++++ recipes-python/pyside6/python3-pyside6_git.bb | 61 +++++++++++++++++++ .../pyside6/python3-shiboken6_git.bb | 9 +++ recipes-qt/qt6/qt6-git.inc | 1 + 5 files changed, 108 insertions(+) create mode 100644 recipes-python/pyside6/python3-pyside6.inc create mode 100644 recipes-python/pyside6/python3-pyside6_git.bb create mode 100644 recipes-python/pyside6/python3-shiboken6_git.bb diff --git a/README.md b/README.md index 603debe9..f61c404a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ URI: https://git.openembedded.org/openembedded-core/ URI: https://git.openembedded.org/meta-openembedded/ +and optionally: + +URI: https://github.com/kraj/meta-clang + Yocto version support --------------------- diff --git a/recipes-python/pyside6/python3-pyside6.inc b/recipes-python/pyside6/python3-pyside6.inc new file mode 100644 index 00000000..770a2e7e --- /dev/null +++ b/recipes-python/pyside6/python3-pyside6.inc @@ -0,0 +1,33 @@ +LICENSE = "The-Qt-Company-Commercial | (GPL-3.0-only & Qt-GPL-exception-1.0) & (LGPL-3.0-only | GPL-2.0-only | GPL-3.0-only)" +LIC_FILES_CHKSUM = " \ + file://LICENSES/BSD-3-Clause.txt;md5=cb40fa7520502d8c7a3aea47cae1316c \ + file://LICENSES/GFDL-1.3-no-invariants-only.txt;md5=a22d0be1ce2284b67950a4d1673dd1b0 \ + file://LICENSES/GPL-2.0-only.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://LICENSES/GPL-3.0-only.txt;md5=d32239bcb673463ab874e80d47fae504 \ + file://LICENSES/LGPL-3.0-only.txt;md5=e6a600fd5e1d9cbde2d983680233ad02 \ + file://LICENSES/LicenseRef-Qt-Commercial.txt;md5=40a1036f91cefc0e3fabad241fb5f187 \ + file://LICENSES/Qt-GPL-exception-1.0.txt;md5=9a13522cd91a88fba784baf16ea66af8 \ +" + +python() { + if 'clang-layer' not in d.getVar('BBFILE_COLLECTIONS').split(): + raise bb.parse.SkipRecipe('Requires meta-clang to be present.') +} + +inherit setuptools3 +inherit qt6-cmake + +require recipes-qt/qt6/qt6-git.inc + +QT_GIT_PROJECT = "pyside" +QT_MODULE = "pyside-setup" +QT_MODULE_BRANCH = "dev" + +FILESEXTRAPATHS:prepend := "${THISDIR}/pyside6:" + +S = "${WORKDIR}/git" + +EXTRA_OECMAKE += "-DBUILD_TESTS=FALSE" +EXTRA_OECMAKE:append:class-target = " -DQFP_SHIBOKEN_HOST_PATH=${STAGING_EXECPREFIXDIR} -DQFP_PYTHON_HOST_PATH=${PYTHON}" + +INSANE_SKIP:${PN} += "already-stripped" diff --git a/recipes-python/pyside6/python3-pyside6_git.bb b/recipes-python/pyside6/python3-pyside6_git.bb new file mode 100644 index 00000000..87e7faa9 --- /dev/null +++ b/recipes-python/pyside6/python3-pyside6_git.bb @@ -0,0 +1,61 @@ +require python3-pyside6.inc + +DEPENDS += "\ + python3-shiboken6 \ + python3-shiboken6-native \ + ${PYSIDE_QT_MODULES} \ +" +PYSIDE_QT_MODULES ?= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qt3d', '', d)} \ + qtbase \ + qtcharts \ + qtconnectivity \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtdatavis3d', '', d)} \ + qtdeclarative \ + qtdeclarative-native \ + qtgraphs \ + ${@bb.utils.contains('QT_COMMERCIAL_MODULES', '1', 'qthttpserver', '', d)} \ + qtlocation \ + qtmultimedia \ + qtnetworkauth \ + qtpositioning \ + qtquick3d \ + qtquick3d-native \ + qtremoteobjects \ + qtremoteobjects-native \ + qtscxml \ + qtscxml-native \ + qtsensors \ + qtserialbus \ + qtserialport \ + qtspeech \ + qtsvg \ + qttools \ + qtwebchannel \ + ${@bb.utils.contains('DISTRO_FEATURES', 'webengine', 'qtwebengine', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'webengine', 'qtpdf', '', d)} \ + qtwebsockets \ +" + +OECMAKE_SOURCEPATH = "${S}/sources/pyside6" + +export LLVM_INSTALL_DIR = "${STAGING_DIR_NATIVE}${exec_prefix}" + +PYSIDE_COMPILER = "${HOST_SYS}-g++" +PYSIDE_COMPILER:toolchain-clang = "${HOST_SYS}-clang++" + +EXTRA_OECMAKE += "\ + -DSTANDALONE=ON \ + -DPYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM=ON \ + -DSHIBOKEN_GENERATOR_EXTRA_FLAGS='\ + --clang-options=--sysroot=${STAGING_DIR_TARGET},--target=${HOST_SYS},${@d.getVar('HOST_CC_ARCH').replace(' ',',')} \ + --compiler-path=${PYSIDE_COMPILER} \ + ' \ +" + +FILES:${PN} += "\ + ${QT6_INSTALL_PLUGINSDIR}/designer \ +" +FILES:${PN}-dev += "\ + ${datadir}/PySide6 \ +" diff --git a/recipes-python/pyside6/python3-shiboken6_git.bb b/recipes-python/pyside6/python3-shiboken6_git.bb new file mode 100644 index 00000000..7a02bc2f --- /dev/null +++ b/recipes-python/pyside6/python3-shiboken6_git.bb @@ -0,0 +1,9 @@ +require python3-pyside6.inc + +DEPENDS += "qtbase clang-native python3-shiboken6-native" + +OECMAKE_SOURCEPATH = "${S}/sources/shiboken6" + +EXTRA_OECMAKE += "-DSHIBOKEN_BUILD_LIBS=ON" + +BBCLASSEXTEND = "native nativesdk" diff --git a/recipes-qt/qt6/qt6-git.inc b/recipes-qt/qt6/qt6-git.inc index 4874a6a2..c55e9494 100644 --- a/recipes-qt/qt6/qt6-git.inc +++ b/recipes-qt/qt6/qt6-git.inc @@ -21,6 +21,7 @@ SRCREV = "${SRCREV_${QT_MODULE}}" SRCREV_tqtc-qmlcompilerplus = "eaa415997c3015648c99b172d6b8d57ec49e9bd1" SRCREV_tqtc-qtinsighttracker = "5b85639156f9dfc10e7cb5e055f9c5d386dc078d" SRCREV_tqtc-qtvncserver = "3c4cb95cdff7f69f6ed504cb2e9197ad9a2574c4" +SRCREV_pyside-setup = "f0fa7f37ea85402671805e54c0fa9c0a61e8e117" SRCREV_qt3d = "518b432e62005cdae3d3ed4132cf576d0f5b1477" SRCREV_qt3d-assimp = "c60a259fd35f09b8896b2920d48c436145914aae" SRCREV_qt5compat = "3407e0fde0f3efb80cd916bd18fd96e585007aa9" From a0565088a0df7785df47c551362dca37d5c8e2bb Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 4 Dec 2023 08:05:46 +0000 Subject: [PATCH 2/3] coin: add pyside6 to CI build Add CI test build for Qt for Python. Change-Id: Iab434d0f908035674f3c1e635d94892ed2bac5da Reviewed-by: Mikko Gronoff --- coin/module_config.yaml | 11 ++++++----- coin/test-python.inc | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 coin/test-python.inc diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 3e82471d..ea325a4c 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -34,7 +34,7 @@ target1: &target1 variableValue: master.xml - type: EnvironmentVariable variableName: TEST_CONFIGS - variableValue: ci configs wayland + variableValue: ci configs wayland python enable_if: condition: property property: target.arch @@ -50,7 +50,7 @@ target2: &target2 variableValue: master.xml - type: EnvironmentVariable variableName: TEST_CONFIGS - variableValue: ci configs + variableValue: ci configs python enable_if: condition: property property: target.arch @@ -66,7 +66,7 @@ target3: &target3 variableValue: master.xml - type: EnvironmentVariable variableName: TEST_CONFIGS - variableValue: ci configs + variableValue: ci configs python enable_if: condition: property property: target.arch @@ -82,7 +82,7 @@ target4: &target4 variableValue: nanbield.xml - type: EnvironmentVariable variableName: TEST_CONFIGS - variableValue: ci configs wayland mingw no-webengine + variableValue: ci configs wayland mingw no-webengine python enable_if: condition: property property: target.arch @@ -98,7 +98,7 @@ target5: &target5 variableValue: kirkstone.xml - type: EnvironmentVariable variableName: TEST_CONFIGS - variableValue: ci configs wayland static no-webengine + variableValue: ci configs wayland static no-webengine python enable_if: condition: property property: target.arch @@ -149,6 +149,7 @@ instructions: bitbake-layers add-layer ../meta-openembedded/meta-python bitbake-layers add-layer ../meta-openembedded/meta-multimedia bitbake-layers add-layer ../meta-mingw + bitbake-layers add-layer ../meta-clang bitbake-layers add-layer ${SOURCE_DIR} for conf in ${TEST_CONFIGS}; do diff --git a/coin/test-python.inc b/coin/test-python.inc new file mode 100644 index 00000000..4797f7b8 --- /dev/null +++ b/coin/test-python.inc @@ -0,0 +1,2 @@ +RDEPENDS:${PN}:append:pn-packagegroup-qt6-addons = " python3-pyside6" + From 544be0857c15c16ec153d0e5f6104eebafb8b8a7 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 12 Mar 2024 09:42:45 +0000 Subject: [PATCH 3/3] qttools: update revision Fix build with clang 18. Change-Id: I5651432bcaaaf106e9a8cd353c5323fef2cafc3f Reviewed-by: Mikko Gronoff --- recipes-qt/qt6/qt6-git.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-qt/qt6/qt6-git.inc b/recipes-qt/qt6/qt6-git.inc index c55e9494..9257922d 100644 --- a/recipes-qt/qt6/qt6-git.inc +++ b/recipes-qt/qt6/qt6-git.inc @@ -60,7 +60,7 @@ SRCREV_qtserialport = "5bd74239bc6c59cea652a16dc684d33da861ff92" SRCREV_qtshadertools = "e52117a5ef9d16a5fe03dbbc61a6503bf68061ff" SRCREV_qtspeech = "bcb935d12dee170de2baa999fa02b5a624752f23" SRCREV_qtsvg = "867f49014b92fc345f59c52b13ccc4a4f4eb9ac1" -SRCREV_qttools = "c2ba2298544875a6e815ba2ddc4a60d125d2ddd4" +SRCREV_qttools = "a916ac4087b1a0ec76b7fb5b3c003274d685716d" SRCREV_qttools-qlitehtml = "7e8eb0f5eaee53b0aeb04208bdaba74fcffc3a3f" SRCREV_qttools-qlitehtml-litehtml = "6ca1ab0419e770e6d35a1ef690238773a1dafcee" SRCREV_qttranslations = "fa8e1a3d3b3924d0ad46217a4a99a17a32dacfd8"