Skip to content

Commit

Permalink
pyside6: Qt for Python
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Mikko Gronoff <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
sapiippo committed Dec 18, 2023
1 parent 61b1721 commit b8d52a4
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------

Expand Down
32 changes: 32 additions & 0 deletions recipes-python/pyside6/python3-pyside6.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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"

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"
61 changes: 61 additions & 0 deletions recipes-python/pyside6/python3-pyside6_git.bb
Original file line number Diff line number Diff line change
@@ -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 \
"
9 changes: 9 additions & 0 deletions recipes-python/pyside6/python3-shiboken6_git.bb
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions recipes-qt/qt6/qt6-git.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SRCREV = "${SRCREV_${QT_MODULE}}"
SRCREV_tqtc-qmlcompilerplus = "dbe1239587c036ef6a51379ee002b436a8e5822a"
SRCREV_tqtc-qtinsighttracker = "c9bb96584600fadccbf86e93e6550ebb891915e2"
SRCREV_tqtc-qtvncserver = "65a38d58d3bb0ca220745f402fd3381817efd60f"
SRCREV_pyside-setup = "9356cc849bc2c14bb84338eda2469efe9d12106d"
SRCREV_qt3d = "8d3372b349b7c0d1a42f46dddd64c80a03691967"
SRCREV_qt3d-assimp = "c60a259fd35f09b8896b2920d48c436145914aae"
SRCREV_qt5compat = "37b32fa22f0ba19818dc7c84ab45dee8eef3f43e"
Expand Down

0 comments on commit b8d52a4

Please sign in to comment.