added package/python-{shiboken6, pyside6}: new packages
PATCH v3 1/1 added package/python-{shiboken6, pyside6}: new packages
There are actually three projects combined in the PySide6 repo:
- Shiboken6 (package/python-shiboken6): A C++/Python Binding Generator
- PySide6 (package/python-pyside6): A C++/Python binding of Qt6
- pyside-tools (Not Included): which contains pyside6-uic/pyside6-rcc
A future patch will add pyside-tools. Until then, you must convert *.ui/*.qrc files to *.py file using pyside-uic/pyside6-rcc manually. Make sure to use a similar version of Qt.
---
Changes v1 -> v2:
- nothing. Made sure git send-email sends the commit message above.
Changes v2 -> v3:
- Used SUBDIR feature to navigate to sources/pyside6 and sources/shiboken6
- Removed numpy from shiboken6 dependencies
- Added requested comments for easier maintanence
- Replied to review email with additional notes per review topic.
DEVELOPERS | 6 + package/Config.in | 2 + package/python-pyside6/Config.in | 19 +++ package/python-pyside6/python-pyside6.hash | 10 ++ package/python-pyside6/python-pyside6.mk | 94 +++++++++++ package/python-shiboken6/Config.in | 22 +++ .../python-shiboken6/python-shiboken6.hash | 10 ++ package/python-shiboken6/python-shiboken6.mk | 57 +++++++ .../tests/package/sample_python_pyside6.py | 157 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 60 +++++++ 10 files changed, 437 insertions(+) create mode 100644 package/python-pyside6/Config.in create mode 100644 package/python-pyside6/python-pyside6.hash create mode 100644 package/python-pyside6/python-pyside6.mk create mode 100644 package/python-shiboken6/Config.in create mode 100644 package/python-shiboken6/python-shiboken6.hash create mode 100644 package/python-shiboken6/python-shiboken6.mk create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
DEVELOPERS +6 -0
@@ -876,6 +876,12 @@ F: package/unscd/ N: Dushara Jayasinghe <[email protected]> F: package/prosody/ +N: Dylan Bespalko <[email protected]> +F: package/python-shiboken6/ +F: package/python-pyside6/ +F: support/testing/tests/package/test_python_pyside6.py +F: support/testing/tests/package/sample_python_pyside6.py + N: Edgar Bonet <[email protected]> F: board/acmesystems/acqua-a5/ F: configs/acmesystems_acqua_a5_256mb_defconfig
package/Config.in +2 -0
@@ -1313,6 +1313,7 @@ menu "External python modules" source "package/python-pysendfile/Config.in" source "package/python-pysensors/Config.in" source "package/python-pysftp/Config.in" + source "package/python-pyside6/Config.in" source "package/python-pysmb/Config.in" source "package/python-pysmi/Config.in" source "package/python-pysnmp/Config.in"
@@ -1368,6 +1369,7 @@ menu "External python modules" source "package/python-setproctitle/Config.in" source "package/python-setuptools/Config.in" source "package/python-sh/Config.in" + source "package/python-shiboken6/Config.in" source "package/python-shutilwhich/Config.in" source "package/python-simpleaudio/Config.in" source "package/python-simplegeneric/Config.in"
package/python-pyside6/Config.in new file +19 -0
@@ -0,0 +1,19 @@ +config BR2_PACKAGE_PYTHON_PYSIDE6 + bool "python-pyside6" + depends on BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6_GL_SUPPORTS # Requirement of PySide6.QtWidgets, but not QtWidgets + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_OPENSSL # Requirement of PySide6.QtNetwork, but not QtNetwork + select BR2_PACKAGE_HOST_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_PYTHON_SHIBOKEN6 + help + Qt For Python is the Python Qt bindings project. + Make sure to select a qpa-platform using: + - BR2_PACKAGE_QT6BASE_DEFAULT_QPA="<qpa-platform>" + - Or, QT_QPA_PLATFORM=<qpa-platform> python3 + + PySide6 auto-detects the Qt6 Modules that are present. + + https://wiki.qt.io/Qt_for_Python
package/python-pyside6/python-pyside6.hash new file +10 -0
@@ -0,0 +1,10 @@ +# Locally computed sha256 checksums +md5 385a4463908d14cc86d54aac0454e871 python-pyside6-v6.7.2-git4.tar.gz +sha256 5ddb1bac70c9504d57f31005f4cdf5921c71fbf91190abe22abf45537d725d3b python-pyside6-v6.7.2-git4.tar.gz +sha256 9f0490f18656c6f2435bd14f603ef0c96434d1825615363dce43abb42ed1dcce BSD-3-Clause.txt +sha256 110535522396708cea37c72a802c5e7e81391139f5f7985631c93ef242b206a4 GFDL-1.3-no-invariants-only.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LGPL-3.0-only.txt +sha256 9b1f50aae6267f9d5e0ceb6775ee86450262c25ec7c0573e151fe5d3f18a4700 LicenseRef-Qt-Commercial.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 Qt-GPL-exception-1.0.txt
package/python-pyside6/python-pyside6.mk new file +94 -0
94 lines not on this page · raw message
package/python-shiboken6/Config.in new file +22 -0
@@ -0,0 +1,22 @@ +config BR2_PACKAGE_PYTHON_SHIBOKEN6 + bool "python-shiboken6" + depends on BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6_GL_SUPPORTS # Requirement of PySide6.QtWidgets, but not QtWidgets + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_HOST_LIBXSLT + select BR2_PACKAGE_HOST_CLANG + select BR2_PACKAGE_HOST_CMAKE + select BR2_PACKAGE_HOST_PERL + select BR2_PACKAGE_HOST_QT6BASE + select BR2_PACKAGE_HOST_QT6BASE_GUI + select BR2_PACKAGE_HOST_QT6BASE_WIDGETS + select BR2_PACKAGE_HOST_PYTHON3 + select BR2_PACKAGE_HOST_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_PYTHON3_ZLIB + help + Shiboken generates bindings for C++ libraries using + CPython source code + + https://wiki.qt.io/Qt_for_Python
package/python-shiboken6/python-shiboken6.hash new file +10 -0
@@ -0,0 +1,10 @@ +# Locally computed sha256 checksums +md5 0bc8a2fcc8ab4c31711b7c6e1254dae8 python-shiboken6-v6.7.2-git4.tar.gz +sha256 586a245db884a4d020f696b985d3afee0b81f11cc3aeeb62aa2c4632d43f4e67 python-shiboken6-v6.7.2-git4.tar.gz +sha256 9f0490f18656c6f2435bd14f603ef0c96434d1825615363dce43abb42ed1dcce BSD-3-Clause.txt +sha256 110535522396708cea37c72a802c5e7e81391139f5f7985631c93ef242b206a4 GFDL-1.3-no-invariants-only.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LGPL-3.0-only.txt +sha256 9b1f50aae6267f9d5e0ceb6775ee86450262c25ec7c0573e151fe5d3f18a4700 LicenseRef-Qt-Commercial.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 Qt-GPL-exception-1.0.txt
package/python-shiboken6/python-shiboken6.mk new file +57 -0
57 lines not on this page · raw message
support/testing/tests/package/sample_python_pyside6.py new file +157 -0
157 lines not on this page · raw message
support/testing/tests/package/test_python_pyside6.py new file +60 -0
60 lines not on this page · raw message
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Thomas,
pyside-tools contains the Python pyside6-{uic|rcc} utilities along with some aspirational features:
- qtpy2cpp_lib: Convert *.py code to *.cpp (assuming you only used Qt)
- deploy: A way to deploy PySide Code accross all platforms as a
single file, simlar to cx_freeze.
These modules have MULTIPLE *.pyproject/setup.py files and implicit dependencies, which are *complicated* and don't make sense for embedded.
Alternatively, Qt has modified the C++ {uic|rcc} utilities to convert Qt Designer {*.uic|*.qrc} files to C++ *or Python*. Hence, the solution is NOT to support pyside-tools on buildroot.
I simply need to tell the downstream user to use {uic|rcc} -g python instead of pyside6-{uic|rcc} in their build recipe. See proposed changes below:
Quoted 4 lines · Dylan Bespalko
There are actually three projects combined in the PySide6 repo:
- Shiboken6 (package/python-shiboken6): A C++/Python Binding Generator
- PySide6 (package/python-pyside6): A C++/Python binding of Qt6
- pyside-tools (Not Included): which contains pyside6-uic/pyside6-rcc
DO NOT create pyside-tools buildroot recipe. It is not needed.
Quoted 87 lines
A future patch will add pyside-tools. Until then, you must convert *.ui/*.qrc files to *.py file using pyside-uic/pyside6-rcc manually. Make sure to use a similar version of Qt.
Signed-off-by Dylan Bespalko<[email protected]>---
Changes v1 -> v2:
- nothing. Made sure git send-email sends the commit message above.
Changes v2 -> v3:
- Used SUBDIR feature to navigate to sources/pyside6 and sources/shiboken6
- Removed numpy from shiboken6 dependencies
- Added requested comments for easier maintanence
- Replied to review email with additional notes per review topic.DEVELOPERS | 6 + package/Config.in | 2 + package/python-pyside6/Config.in | 19 +++ package/python-pyside6/python-pyside6.hash | 10 ++ package/python-pyside6/python-pyside6.mk | 94 +++++++++++ package/python-shiboken6/Config.in | 22 +++ .../python-shiboken6/python-shiboken6.hash | 10 ++ package/python-shiboken6/python-shiboken6.mk | 57 +++++++ .../tests/package/sample_python_pyside6.py | 157 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 60 +++++++ 10 files changed, 437 insertions(+)create mode 100644 package/python-pyside6/Config.in
create mode 100644 package/python-pyside6/python-pyside6.hash create mode 100644package/python-pyside6/python-pyside6.mkcreate mode 100644 package/python-shiboken6/Config.in
create mode 100644 package/python-shiboken6/python-shiboken6.hash create mode 100644package/python-shiboken6/python-shiboken6.mkcreate mode 100644support/testing/tests/package/sample_python_pyside6.pycreate mode 100644support/testing/tests/package/test_python_pyside6.pyDEVELOPERS +6
-0@@ -876,6 +876,12 @@ F: package/unscd/ N: Dushara Jayasinghe<[email protected]> F: package/prosody/ +N: Dylan Bespalko<[email protected]> +F: package/python-shiboken6/ +F: package/python-pyside6/ +F: support/testing/tests/package/test_python_pyside6.py +F: support/testing/tests/package/sample_python_pyside6.py + N: Edgar Bonet<[email protected]> F: board/acmesystems/acqua-a5/ F: configs/acmesystems_acqua_a5_256mb_defconfigpackage/Config.in +2
-0@@ -1313,6 +1313,7 @@ menu "External python modules" source "package/python-pysendfile/Config.in" source "package/python-pysensors/Config.in" source "package/python-pysftp/Config.in" + source "package/python-pyside6/Config.in" source "package/python-pysmb/Config.in" source "package/python-pysmi/Config.in" source "package/python-pysnmp/Config.in"@@ -1368,6 +1369,7 @@ menu "External python modules" source "package/python-setproctitle/Config.in" source "package/python-setuptools/Config.in" source "package/python-sh/Config.in" + source "package/python-shiboken6/Config.in" source "package/python-shutilwhich/Config.in" source "package/python-simpleaudio/Config.in" source "package/python-simplegeneric/Config.in"package/python-pyside6/Config.in new file +8
-0@@ -0,0 +1,19 @@ +config BR2_PACKAGE_PYTHON_PYSIDE6 + bool "python-pyside6" + depends on BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6_GL_SUPPORTS # Requirement of PySide6.QtWidgets, but not QtWidgets + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_OPENSSL # Requirement of PySide6.QtNetwork, but not QtNetwork
package/python-pyside6/Config.in line 18
Quoted 10 lines
package/python-pyside6/Config.in new file +10
-0+ select BR2_PACKAGE_HOST_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_PYTHON_SHIBOKEN6 + help + Qt For Python is the Python Qt bindings project. + Make sure to select a qpa-platform using: + - BR2_PACKAGE_QT6BASE_DEFAULT_QPA="<qpa-platform>" + - Or, QT_QPA_PLATFORM=<qpa-platform> python > + + PySide6 auto-detects the Qt6 Modules that are present. + + https://wiki.qt.io/Qt_for_Python
The help should be as follows:
help
Qt For Python is the Python Qt bindings project.
PySide6 auto-detects the Qt6 Modules that are present.
Make sure to select a qpa-platform using:
- BR2_PACKAGE_QT6BASE_DEFAULT_QPA="<qpa-platform>"at build-time.
- Or, QT_QPA_PLATFORM=<qpa-platform> python3 at run-time.
If your project converts {*.ui|*.qrc} files to *.py files during
the build:
- Call $(HOST_DIR)/libexec/{uic|rcc} -g python in your build.
- This is equivalent to the traditional pyside6-{uic|rcc}
command.
The first solution will isolate your buildroot environement from
your local system.
Quoted 443 lines
package/python-pyside6/python-pyside6.hash new file +10
-0@@ -0,0 +1,10 @@ +# Locally computed sha256 checksums +md5 385a4463908d14cc86d54aac0454e871 python-pyside6-v6.7.2-git4.tar.gz +sha256 5ddb1bac70c9504d57f31005f4cdf5921c71fbf91190abe22abf45537d725d3b python-pyside6-v6.7.2-git4.tar.gz +sha256 9f0490f18656c6f2435bd14f603ef0c96434d1825615363dce43abb42ed1dcce BSD-3-Clause.txt +sha256 110535522396708cea37c72a802c5e7e81391139f5f7985631c93ef242b206a4 GFDL-1.3-no-invariants-only.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LGPL-3.0-only.txt +sha256 9b1f50aae6267f9d5e0ceb6775ee86450262c25ec7c0573e151fe5d3f18a4700 LicenseRef-Qt-Commercial.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 Qt-GPL-exception-1.0.txtpackage/python-pyside6/python-pyside6.mk new file +94
-0@@ -0,0 +1,94 @@ +################################################################################ +# +# python-pyside6 +# +################################################################################ + +# Make sure to sync PYTHON_PYSIDE6_VERSION == PYTHON_SHIBOKEN6_VERSION == QT6_VERSION +PYTHON_PYSIDE6_VERSION = v6.7.2 +PYTHON_PYSIDE6_SITE =https://code.qt.io/pyside/pyside-setup.git +PYTHON_PYSIDE6_SUBDIR = sources/pyside6 +PYTHON_PYSIDE6_SITE_METHOD = git +PYTHON_PYSIDE6_CPE_ID_VENDOR = qt +PYTHON_PYSIDE6_CPE_ID_PRODUCT = pyside6 +PYTHON_PYSIDE6_SUPPORTS_IN_SOURCE_BUILD = NO +PYTHON_PYSIDE6_INSTALL_STAGING = YES + +PYTHON_PYSIDE6_LICENSE = \ + GPL-2.0+ or LGPL-3.0, \ + GPL-3.0 with exception (tools), \ + GFDL-1.3 (docs), \ + Apache-2.0, \ + BSD-3-Clause + +PYTHON_PYSIDE6_LICENSE_FILES = \ + LICENSES/Apache-2.0.txt \ + LICENSES/BSD-3-Clause.txt \ + LICENSES/GFDL-1.3-no-invariants-only.txt \ + LICENSES/GPL-2.0-only.txt \ + LICENSES/LGPL-3.0-only.txt \ + LICENSES/GPL-3.0-only.txt \ + LICENSES/Qt-GPL-exception-1.0.txt + +PYTHON_PYSIDE6_DEPENDENCIES = \ + host-python-shiboken6 \ + qt6base \ + python-shiboken6 + +# Essential Modules: grep -A 8 -r "set(ALL_ESSENTIAL_MODULES" on repo for updated list +PYTHON_PYSIDE6_ALL_ESSENTIAL_MODULES = \ + Core \ + Gui \ + Widgets \ + $(if $(BR2_PACKAGE_QT6BASE_PRINTSUPPORT),PrintSupport) \ + $(if $(BR2_PACKAGE_QT6BASE_SQL),Sql) \ + $(if $(BR2_PACKAGE_QT6BASE_NETWORK),Network) \ + $(if $(BR2_PACKAGE_QT6BASE_TEST),Test) \ + $(if $(BR2_PACKAGE_QT6BASE_CONCURRENT),Concurrent) + +# Add-On Modules: grep -A 33 -r "set(ALL_OPTIONAL_MODULES" on repo for updated list +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES = \ + $(if $(BR2_PACKAGE_QT6BASE_DBUS),DBus) \ + $(if $(BR2_PACKAGE_QT6BASE_XML),Xml) \ + $(if $(BR2_PACKAGE_QT6BASE_OPENGL),OpenGL) \ + $(if $(BR2_PACKAGE_QT6BASE_WIDGETS) && $(BR2_PACKAGE_QT6BASE_OPENGL),OpenGLWidgets) + +ifeq ($(BR2_PACKAGE_QT6DECLARATIVE),y) +PYTHON_PYSIDE6_DEPENDENCIES += qt6declarative +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES += \ + Qml \ + Quick \ + QuickControls2 \ + QuickTest \ + QuickWidgets +endif +ifeq ($(BR2_PACKAGE_QT6SERIALPORT),y) +PYTHON_PYSIDE6_DEPENDENCIES += qt6serialport +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES += SerialPort +ifeq ($(BR2_PACKAGE_QT6SERIALBUS),y) +PYTHON_PYSIDE6_DEPENDENCIES += qt6serialbus +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES += SerialBus +endif +endif +ifeq ($(BR2_PACKAGE_QT6SVG),y) +PYTHON_PYSIDE6_DEPENDENCIES += qt6svg +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES += Svg +PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES += SvgWidgets +endif + +# All Modules: grep -r "set(MODULES" on repo for updated list +# The Modules are defined here:https://doc.qt.io/qt-6/qtmodules.html +PYTHON_PYSIDE6_MODULES = $(subst $(space),\;,$(PYTHON_PYSIDE6_ALL_ESSENTIAL_MODULES) $(PYTHON_PYSIDE6_ALL_OPTIONAL_MODULES)) + +PYTHON_PYSIDE6_CONF_ENV = \ + LLVM_INSTALL_DIR=$(HOST_DIR) + +PYTHON_PYSIDE6_CONF_OPTS = \ + -DMODULES=$(PYTHON_PYSIDE6_MODULES) \ + -DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \ + -DSTANDALONE=ON \ + -DPYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM=ON \ + -DSHIBOKEN_GENERATOR_EXTRA_FLAGS='\ + --compiler-path=$(HOST_DIR)/bin/clang' + +$(eval $(cmake-package))package/python-shiboken6/Config.in new file +22
-0@@ -0,0 +1,22 @@ +config BR2_PACKAGE_PYTHON_SHIBOKEN6 + bool "python-shiboken6" + depends on BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6_GL_SUPPORTS # Requirement of PySide6.QtWidgets, but not QtWidgets + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_HOST_LIBXSLT + select BR2_PACKAGE_HOST_CLANG + select BR2_PACKAGE_HOST_CMAKE + select BR2_PACKAGE_HOST_PERL + select BR2_PACKAGE_HOST_QT6BASE + select BR2_PACKAGE_HOST_QT6BASE_GUI + select BR2_PACKAGE_HOST_QT6BASE_WIDGETS + select BR2_PACKAGE_HOST_PYTHON3 + select BR2_PACKAGE_HOST_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_PYTHON3_ZLIB + help + Shiboken generates bindings for C++ libraries using + CPython source code + + https://wiki.qt.io/Qt_for_Pythonpackage/python-shiboken6/python-shiboken6.hash new file +10
-0@@ -0,0 +1,10 @@ +# Locally computed sha256 checksums +md5 0bc8a2fcc8ab4c31711b7c6e1254dae8 python-shiboken6-v6.7.2-git4.tar.gz +sha256 586a245db884a4d020f696b985d3afee0b81f11cc3aeeb62aa2c4632d43f4e67 python-shiboken6-v6.7.2-git4.tar.gz +sha256 9f0490f18656c6f2435bd14f603ef0c96434d1825615363dce43abb42ed1dcce BSD-3-Clause.txt +sha256 110535522396708cea37c72a802c5e7e81391139f5f7985631c93ef242b206a4 GFDL-1.3-no-invariants-only.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LGPL-3.0-only.txt +sha256 9b1f50aae6267f9d5e0ceb6775ee86450262c25ec7c0573e151fe5d3f18a4700 LicenseRef-Qt-Commercial.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 Qt-GPL-exception-1.0.txtpackage/python-shiboken6/python-shiboken6.mk new file +57
-0@@ -0,0 +1,57 @@ +################################################################################ +# +# python-shiboken6 +# +################################################################################ + +# Make sure to sync PYTHON_SHIBOKEN6_VERSION == QT6_VERSION +PYTHON_SHIBOKEN6_VERSION = v6.7.2 +PYTHON_SHIBOKEN6_SITE =https://code.qt.io/pyside/pyside-setup.git +PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6 +PYTHON_SHIBOKEN6_SITE_METHOD = git +PYTHON_SHIBOKEN6_CPE_ID_VENDOR = qt +PYTHON_SHIBOKEN6_CPE_ID_PRODUCT = shiboken +PYTHON_SHIBOKEN6_SUPPORTS_IN_SOURCE_BUILD = NO +PYTHON_SHIBOKEN6_INSTALL_STAGING = YES + +PYTHON_SHIBOKEN6_LICENSE = \ + GPL-2.0+ or LGPL-3.0, \ + GPL-3.0 with exception (tools), \ + GFDL-1.3 (docs), \ + Apache-2.0, \ + BSD-3-Clause + +PYTHON_SHIBOKEN6_LICENSE_FILES = \ + LICENSES/Apache-2.0.txt \ + LICENSES/BSD-3-Clause.txt \ + LICENSES/GFDL-1.3-no-invariants-only.txt \ + LICENSES/GPL-2.0-only.txt \ + LICENSES/LGPL-3.0-only.txt \ + LICENSES/GPL-3.0-only.txt \ + LICENSES/Qt-GPL-exception-1.0.txt + +PYTHON_SHIBOKEN6_DEPENDENCIES = \ + host-libxslt \ + host-clang \ + host-cmake \ + host-perl \ + host-qt6base \ + host-python3 \ + host-python-shiboken6 \ + qt6base \ + python3 + +HOST_PYTHON_SHIBOKEN6_DEPENDENCIES = \ + host-libxslt \ + host-clang \ + host-cmake \ + host-perl \ + host-qt6base \ + host-python3 + +PYTHON_SHIBOKEN6_CONF_OPTS = \ + -DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \ + -DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3 + +$(eval $(cmake-package)) +$(eval $(host-cmake-package))support/testing/tests/package/sample_python_pyside6.py new file +157
-0@@ -0,0 +1,157 @@ +# ALL_ESSENTIAL_MODULES +def test_python_pyside6_qt(): + from PySide6.QtCore import Qt + enum = Qt.white + assert(str(enum) == 'GlobalColor.white') + + +def test_python_pyside6_qtcore(): + from PySide6 import QtCore + obj = QtCore.QObject() + obj.setObjectName('MyObject') + assert(obj.objectName() == 'MyObject') + + +def test_python_pyside6_qtgui(): + from PySide6 import QtGui + color = QtGui.QColor.fromRgb(255, 255, 255, 255) + assert(color.name(QtGui.QColor.HexArgb) == "#ffffffff") + + +def test_python_pyside6_qtwidgets(): + from PySide6 import QtWidgets + app = QtWidgets.QApplication() + label = QtWidgets.QLabel('Hello World') + assert(label.text() == 'Hello World') + QtWidgets.QApplication.shutdown(app) + + +def test_python_pyside6_qtprintsupport(): + from PySide6 import QtWidgets + from PySide6 import QtPrintSupport + app = QtWidgets.QApplication() + p = QtPrintSupport.QPrinter() + assert(p.creator() == '') + QtWidgets.QApplication.shutdown(app) + + +def test_python_pyside6_qtsql(): + from PySide6 import QtSql + db = QtSql.QSqlDatabase() + assert(db.hostName() == '') + + +def test_python_pyside6_qtnetwork(): + from PySide6 import QtNetwork + host_info = QtNetwork.QHostInfo() + assert(host_info.localHostName() == 'buildroot') + + +def test_python_pyside6_qttest(): + from PySide6 import QtTest + text = QtTest.QTest.toPrettyCString('hello there', 5) + assert(text == '"hello"') + + +def test_python_pyside6_qtconcurrent(): + from PySide6 import QtConcurrent + future = QtConcurrent.QFutureQString() + assert(future.isRunning() is False) + + +# ALL_OPTIONAL_MODULES +def test_python_pyside6_qtdbus(): + from PySide6 import QtDBus + message = QtDBus.QDBusMessage() + assert(message.errorMessage() == '') + + +def test_python_pyside6_qtxml(): + from PySide6 import QtXml + doc = QtXml.QDomDocument('temp.xml') + assert(doc.toString() == '') + + +def test_python_pyside6_qtopengl(): + from PySide6 import QtOpenGL + log = QtOpenGL.QOpenGLDebugLogger() + assert(log.isLogging() is False) + + +def test_python_pyside6_qtopenglwidgets(): + from PySide6 import QtWidgets + from PySide6 import QtOpenGLWidgets + app = QtWidgets.QApplication() + _ = QtOpenGLWidgets.QOpenGLWidget() + # assert(widget.isValid() == False) + # QOpenGLWidget is not supported on this platform. + QtWidgets.QApplication.shutdown(app) + + +def test_python_pyside6_qtquickcontrols(): + from PySide6 import QtWidgets + from PySide6 import QtQuick + app = QtWidgets.QApplication() + view = QtQuick.QQuickView() + assert(str(view.status()) == 'Status.Null') + view.setSource('/usr/lib/qt6/qml/QtQuick/Controls/Universal/Label.qml') + assert(str(view.status()) == 'Status.Ready') + view.close() + QtWidgets.QApplication.shutdown(app) + + +def test_python_pyside6_qtquickwidgets(): + from PySide6 import QtWidgets + from PySide6 import QtQuickWidgets + app = QtWidgets.QApplication() + view = QtQuickWidgets.QQuickWidget() + assert(str(view.status()) == 'Status.Null') + view.setSource('/usr/lib/qt6/qml/QtQuick/Controls/Universal/Label.qml') + assert(str(view.status()) == 'Status.Ready') + QtWidgets.QApplication.shutdown(app) + + +def test_python_pyside6_qtserialport(): + # The filepath used in this test does not need to exist. The serial port is never connected. + from PySide6 import QtSerialPort + ser = QtSerialPort.QSerialPort() + ser.setPortName('/dev/tty') + assert(ser.portName() == 'tty') + + +def test_python_pyside6_qtsvg(): + from PySide6 import QtSvg + renderer = QtSvg.QSvgRenderer() + renderer.setFramesPerSecond(30) + assert(renderer.framesPerSecond() == 30) + + +def test_python_pyside6_qtsvgwidgets(): + from PySide6 import QtWidgets + from PySide6 import QtSvgWidgets + app = QtWidgets.QApplication() + widget = QtSvgWidgets.QSvgWidget() + widget.setObjectName('MyObject') + assert(widget.objectName() == 'MyObject') + QtWidgets.QApplication.shutdown(app) + + +if __name__ == "__main__": + test_python_pyside6_qt() + test_python_pyside6_qtcore() + test_python_pyside6_qtgui() + test_python_pyside6_qtwidgets() + test_python_pyside6_qtprintsupport() + test_python_pyside6_qtsql() + test_python_pyside6_qtnetwork() + test_python_pyside6_qttest() + test_python_pyside6_qtconcurrent() + test_python_pyside6_qtdbus() + test_python_pyside6_qtxml() + test_python_pyside6_qtopengl() + test_python_pyside6_qtopenglwidgets() + test_python_pyside6_qtquickcontrols() + test_python_pyside6_qtquickwidgets() + test_python_pyside6_qtserialport() + test_python_pyside6_qtsvg() + test_python_pyside6_qtsvgwidgets()support/testing/tests/package/test_python_pyside6.py new file +51
-0@@ -0,0 +1,60 @@ +import os + +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3PySide6(TestPythonPackageBase): + __test__ = True + config = \ + """ + BR2_aarch64=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" + BR2_LINUX_KERNEL=y + BR2_LINUX_KERNEL_CUSTOM_VERSION=y + BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.72" + BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y + BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config" + BR2_PACKAGE_MESA3D=y + BR2_PACKAGE_MESA3D_OSMESA_GALLIUM=y + BR2_PACKAGE_MESA3D_OPENGL_EGL=y + BR2_PACKAGE_MESA3D_OPENGL_ES=y + BR2_PACKAGE_QT6=y + BR2_PACKAGE_QT6BASE_GUI=y + BR2_PACKAGE_QT6BASE_WIDGETS=y + BR2_PACKAGE_QT6BASE_PRINTSUPPORT=y + BR2_PACKAGE_QT6BASE_SQL=y + BR2_PACKAGE_QT6BASE_SQLITE=y + BR2_PACKAGE_QT6BASE_NETWORK=y + BR2_PACKAGE_QT6BASE_TEST=y + BR2_PACKAGE_QT6BASE_CONCURRENT=y + BR2_PACKAGE_QT6BASE_DBUS=y + BR2_PACKAGE_QT6BASE_XML=y + BR2_PACKAGE_QT6BASE_OPENGL=y + BR2_PACKAGE_QT6DECLARATIVE=y + BR2_PACKAGE_QT6DECLARATIVE_QUICK=y + BR2_PACKAGE_QT6SERIALPORT=y + BR2_PACKAGE_QT6SERIALBUS=y + BR2_PACKAGE_QT6SVG=y + BR2_PACKAGE_QT6BASE_DEFAULT_QPA="offscreen" + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_PYSIDE6=y + BR2_TARGET_ROOTFS_EXT2=y + BR2_TARGET_ROOTFS_EXT2_SIZE="512M" + # BR2_TARGET_ROOTFS_TAR is not set + """ + sample_scripts = ["tests/package/sample_python_pyside6.py"] + timeout = 30 + + def login(self): + drive = os.path.join(self.builddir, "images", "rootfs.ext2") + kern = os.path.join(self.builddir, "images", "Image")
support/testing/tests/package/test_python_pyside6.py
Quoted 10 lines
support/testing/tests/package/test_python_pyside6.py new file +9
-1+ self.emulator.boot(arch="aarch64", + kernel=kern, + kernel_cmdline=["root=/dev/vda console=ttyAMA0"], + options=["-M", "virt", + "-cpu", "cortex-a57", + "-m", "512M", + "-smp", "2", + "-drive", f"file={drive},if=virtio,format=raw"]) + self.emulator.login() -- 2.34.1
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
v4 cover package/python-pyside6: new package
In reply to Dylan BespalkoHello,
this series updates an older one: "added package/python-{shiboken6, pyside6}: new packages" by Dylan Bespalko. Its last version was v3, sent in August 2024 [1].
It adds PySide6, the Python bindings of Qt6, and Shiboken6, the generator that builds them.
Dylan is still the author of the patches. I brought them up to date with the current Buildroot and Qt6, and I added myself as co-author.
The main changes since v3:
- The single patch is now three: python-shiboken6, python-pyside6 and the runtime test.
- The version goes from 6.7.2 to 6.11.3, the Qt6 version of Buildroot. Qt for Python must have the same version as Qt6, so the packages move to package/qt6/ and follow QT6_VERSION.
- The source is the release tarball, not the git repository.
- pyside-tools is not packaged. As Dylan proposed in his reply to v3, the Qt tools "uic -g python" and "rcc -g python" do the same job.
v3 added a DEVELOPERS entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers, and the test files are in my entry. Dylan, tell me if you want to be listed too.
Each patch lists its own changes below the "---" line.
This series replaces the v3 patch on patchwork [1], which can be marked as superseded.
[1] https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/
Best regards,
Angelo
Dylan Bespalko (3):
package/python-shiboken6: new package package/python-pyside6: new package support/testing: add python-pyside6 runtime test
DEVELOPERS | 2 + package/qt6/Config.in | 2 + package/qt6/python-pyside6/Config.in | 32 ++++ .../qt6/python-pyside6/python-pyside6.hash | 9 + package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++ package/qt6/python-shiboken6/Config.in | 12 ++ .../python-shiboken6/python-shiboken6.hash | 9 + .../qt6/python-shiboken6/python-shiboken6.mk | 57 ++++++ .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 10 files changed, 437 insertions(+) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 1/3 package/python-shiboken6: new package
From: Dylan Bespalko <[email protected]>
There are actually three projects combined in the PySide6 repo:
- Shiboken6 (package/python-shiboken6): A C++/Python Binding Generator
- PySide6 (package/python-pyside6): A C++/Python binding of Qt6
- pyside-tools (Not Included): which contains pyside6-uic/pyside6-rcc
This package builds Shiboken6 from the release tarball:
- The host package builds the binding generator. The generator uses libclang, from host-clang, to read the C++ headers of the target.
- The target package builds the shiboken6 library and its Python module. The generated bindings need them at run time.
Qt for Python has the same version as Qt6. So the package is in package/qt6/ and follows QT6_VERSION, like the other Qt6 modules.
---
Changes v3 -> v4:
- Split the patch in three: python-shiboken6, python-pyside6 and the runtime test
- Bump to 6.11.3. The package moves to package/qt6/ and follows QT6_VERSION, like the other Qt6 modules
- Download the release tarball from download.qt.io, not the git repository. It has an upstream hash, and python-pyside6 uses the same file
- In 6.11 the generator is in sources/shiboken6_generator. The host package builds it. The target package builds only the library and the Python module
- Drop the selects of host packages: a host package cannot be selected. Drop the select of BR2_PACKAGE_QT6_GL_SUPPORTS: it is a blind option
- Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS, for host-clang
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-shiboken6/Config.in | 12 ++++ .../python-shiboken6/python-shiboken6.hash | 9 +++ .../qt6/python-shiboken6/python-shiboken6.mk | 57 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in" source "package/qt6/qt6coap/Config.in"
package/qt6/python-shiboken6/Config.in new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_PYTHON_SHIBOKEN6 + bool "python-shiboken6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-clang + select BR2_PACKAGE_PYTHON3_ZLIB # embedded signature support + help + Shiboken6 generates the Python bindings of PySide6. This + package installs its library and its Python module, which + the bindings need at run time. + + https://doc.qt.io/qtforpython-6/shiboken6/index.html
package/qt6/python-shiboken6/python-shiboken6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-shiboken6/python-shiboken6.mk new file +57 -0
57 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 2/3 package/python-pyside6: new package
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
PySide6 is the official Python binding of Qt6, from the Qt for Python project. It is built with the Shiboken6 generator, from the same release tarball.
The bindings are built only for the Qt6 modules that are enabled in the configuration.
A PySide6 program needs a Qt platform plugin. Select one with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with the QT_QPA_PLATFORM environment variable at run time.
pyside-tools is not packaged. It holds pyside6-uic and pyside6-rcc, but the Qt host tools do the same job and write Python code:
$(HOST_DIR)/libexec/uic -g python $(HOST_DIR)/libexec/rcc -g python
Buildroot has Python bindings for Qt5 only, in python-pyqt5. This package adds the bindings for Qt6.
---
Changes v3 -> v4:
- Split from the python-shiboken6 patch
- Bump to 6.11.3. The package moves to package/qt6/, follows QT6_VERSION and uses the tarball of python-shiboken6
- Depend on BR2_PACKAGE_QT6_GL_SUPPORTS instead of selecting it: it is a blind option. Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS too
- Drop --compiler-path=$(HOST_DIR)/bin/clang: shiboken already uses the cross compiler in a cross build. Drop STANDALONE=ON: it is for wheels that bundle Qt
- Fix the condition of OpenGLWidgets. Add the Quick modules only when qt6declarative has Quick support
- Keep the upstream order of the modules in MODULES: they are built in that order
- Help text: point to "uic -g python" and "rcc -g python" instead of pyside-tools [Dylan Bespalko]
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-pyside6/Config.in | 32 +++++++ .../qt6/python-pyside6/python-pyside6.hash | 9 ++ package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-pyside6/Config.in" source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in"
package/qt6/python-pyside6/Config.in new file +32 -0
@@ -0,0 +1,32 @@ +config BR2_PACKAGE_PYTHON_PYSIDE6 + bool "python-pyside6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_QT6_GL_SUPPORTS # QtGui OpenGL classes + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # python-shiboken6 + select BR2_PACKAGE_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_OPENSSL if BR2_PACKAGE_QT6BASE_NETWORK # QtNetwork SSL classes + help + Qt for Python: the official Python bindings of Qt6. + + The bindings cover the Qt6 modules that are enabled. + + A PySide6 program needs a Qt platform plugin. Select one + with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with + the QT_QPA_PLATFORM environment variable at run time. + + pyside6-uic and pyside6-rcc are not installed. To convert + .ui and .qrc files to Python, use the Qt tools: + "$(HOST_DIR)/libexec/uic -g python" and + "$(HOST_DIR)/libexec/rcc -g python". + + https://doc.qt.io/qtforpython-6/ + +comment "python-pyside6 needs an OpenGL-capable backend" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_PACKAGE_QT6_GL_SUPPORTS
package/qt6/python-pyside6/python-pyside6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-pyside6/python-pyside6.mk new file +86 -0
86 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 3/3 support/testing: add python-pyside6 runtime test
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
The test imports the PySide6 modules, and uses a class of each one.
It runs with the offscreen Qt platform plugin, so it needs no display.
---
Changes v3 -> v4:
- Split from the package patch
- Use the current mesa3d options and an ext4 root filesystem
- Look up the QML files with QLibraryInfo
- Write the asserts as statements, for flake8
- DEVELOPERS: v3 had the test files in a new entry for Dylan. v4 has them in my entry. Dylan, tell me if you want to be listed
DEVELOPERS | 2 + .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 3 files changed, 230 insertions(+) create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
DEVELOPERS +2 -0
@@ -265,6 +265,8 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ F: package/uthash/ +F: support/testing/tests/package/sample_python_pyside6.py +F: support/testing/tests/package/test_python_pyside6.py N: Andy Shevchenko <[email protected]> F: package/fb-test-app/
support/testing/tests/package/sample_python_pyside6.py new file +165 -0
165 lines not on this page · raw message
support/testing/tests/package/test_python_pyside6.py new file +63 -0
63 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
v4 cover package/python-pyside6: new package
In reply to Dylan BespalkoHello,
this series updates an older one: "added package/python-{shiboken6, pyside6}: new packages" by Dylan Bespalko. Its last version was v3, sent in August 2024.
It adds PySide6, the Python bindings of Qt6, and Shiboken6, the generator that builds them.
Dylan is still the author of the first three patches. I brought them up to date with the current Buildroot and Qt6, and I added myself as co-author. The last two patches are new.
The main changes since v3:
- The single patch is now three: python-shiboken6, python-pyside6 and the runtime test.
- The version goes from 6.7.2 to 6.11.3, the Qt6 version of Buildroot. Qt for Python must have the same version as Qt6, so the packages move to package/qt6/ and follow QT6_VERSION.
- The source is the release tarball, not the git repository.
- pyside-tools is not packaged. As Dylan proposed in his reply to v3, the Qt tools "uic -g python" and "rcc -g python" do the same job.
- A new patch lets the Qt display of python-matplotlib use PySide6 with Qt6. With Qt5 it still uses PyQt5.
- A new runtime test checks matplotlib with Qt6. It uses the same configuration as the python-pyside6 test.
v3 added a DEVELOPERS entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers, and the test files are in my entry. Dylan, tell me if you want to be listed too.
Angelo Compagnucci (2):
package/python-matplotlib: add Qt6 support to the Qt display support/testing: add python-matplotlib runtime test
Dylan Bespalko (3):
package/python-shiboken6: new package package/python-pyside6: new package support/testing: add python-pyside6 runtime test
DEVELOPERS | 4 + package/python-matplotlib/Config.in | 15 +- .../python-matplotlib/python-matplotlib.mk | 6 + package/qt6/Config.in | 2 + package/qt6/python-pyside6/Config.in | 32 ++++ .../qt6/python-pyside6/python-pyside6.hash | 9 + package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++ package/qt6/python-shiboken6/Config.in | 12 ++ .../python-shiboken6/python-shiboken6.hash | 9 + .../qt6/python-shiboken6/python-shiboken6.mk | 57 ++++++ .../tests/package/sample_python_matplotlib.py | 39 +++++ .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_matplotlib.py | 48 +++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 14 files changed, 543 insertions(+), 4 deletions(-) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk create mode 100644 support/testing/tests/package/sample_python_matplotlib.py create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_matplotlib.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 1/5 package/python-shiboken6: new package
From: Dylan Bespalko <[email protected]>
There are actually three projects combined in the PySide6 repo:
- Shiboken6 (package/python-shiboken6): A C++/Python Binding Generator
- PySide6 (package/python-pyside6): A C++/Python binding of Qt6
- pyside-tools (Not Included): which contains pyside6-uic/pyside6-rcc
This package builds Shiboken6 from the release tarball:
- The host package builds the binding generator. The generator uses libclang, from host-clang, to read the C++ headers of the target.
- The target package builds the shiboken6 library and its Python module. The generated bindings need them at run time.
Qt for Python has the same version as Qt6. So the package is in package/qt6/ and follows QT6_VERSION, like the other Qt6 modules.
---
Changes v3 -> v4:
- Split the patch in three: python-shiboken6, python-pyside6 and the runtime test
- Bump to 6.11.3. The package moves to package/qt6/ and follows QT6_VERSION, like the other Qt6 modules
- Download the release tarball from download.qt.io, not the git repository. It has an upstream hash, and python-pyside6 uses the same file
- In 6.11 the generator is in sources/shiboken6_generator. The host package builds it. The target package builds only the library and the Python module
- Drop the selects of host packages: a host package cannot be selected. Drop the select of BR2_PACKAGE_QT6_GL_SUPPORTS: it is a blind option
- Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS, for host-clang
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-shiboken6/Config.in | 12 ++++ .../python-shiboken6/python-shiboken6.hash | 9 +++ .../qt6/python-shiboken6/python-shiboken6.mk | 57 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in" source "package/qt6/qt6coap/Config.in"
package/qt6/python-shiboken6/Config.in new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_PYTHON_SHIBOKEN6 + bool "python-shiboken6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-clang + select BR2_PACKAGE_PYTHON3_ZLIB # embedded signature support + help + Shiboken6 generates the Python bindings of PySide6. This + package installs its library and its Python module, which + the bindings need at run time. + + https://doc.qt.io/qtforpython-6/shiboken6/index.html
package/qt6/python-shiboken6/python-shiboken6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-shiboken6/python-shiboken6.mk new file +57 -0
57 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 2/5 package/python-pyside6: new package
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
PySide6 is the official Python binding of Qt6, from the Qt for Python project. It is built with the Shiboken6 generator, from the same release tarball.
The bindings are built only for the Qt6 modules that are enabled in the configuration.
A PySide6 program needs a Qt platform plugin. Select one with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with the QT_QPA_PLATFORM environment variable at run time.
pyside-tools is not packaged. It holds pyside6-uic and pyside6-rcc, but the Qt host tools do the same job and write Python code:
$(HOST_DIR)/libexec/uic -g python $(HOST_DIR)/libexec/rcc -g python
Buildroot has Python bindings for Qt5 only, in python-pyqt5. This package adds the bindings for Qt6.
---
Changes v3 -> v4:
- Split from the python-shiboken6 patch
- Bump to 6.11.3. The package moves to package/qt6/, follows QT6_VERSION and uses the tarball of python-shiboken6
- Depend on BR2_PACKAGE_QT6_GL_SUPPORTS instead of selecting it: it is a blind option. Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS too
- Drop --compiler-path=$(HOST_DIR)/bin/clang: shiboken already uses the cross compiler in a cross build. Drop STANDALONE=ON: it is for wheels that bundle Qt
- Fix the condition of OpenGLWidgets. Add the Quick modules only when qt6declarative has Quick support
- Keep the upstream order of the modules in MODULES: they are built in that order
- Help text: point to "uic -g python" and "rcc -g python" instead of pyside-tools [Dylan Bespalko]
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-pyside6/Config.in | 32 +++++++ .../qt6/python-pyside6/python-pyside6.hash | 9 ++ package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-pyside6/Config.in" source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in"
package/qt6/python-pyside6/Config.in new file +32 -0
@@ -0,0 +1,32 @@ +config BR2_PACKAGE_PYTHON_PYSIDE6 + bool "python-pyside6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_QT6_GL_SUPPORTS # QtGui OpenGL classes + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # python-shiboken6 + select BR2_PACKAGE_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_OPENSSL if BR2_PACKAGE_QT6BASE_NETWORK # QtNetwork SSL classes + help + Qt for Python: the official Python bindings of Qt6. + + The bindings cover the Qt6 modules that are enabled. + + A PySide6 program needs a Qt platform plugin. Select one + with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with + the QT_QPA_PLATFORM environment variable at run time. + + pyside6-uic and pyside6-rcc are not installed. To convert + .ui and .qrc files to Python, use the Qt tools: + "$(HOST_DIR)/libexec/uic -g python" and + "$(HOST_DIR)/libexec/rcc -g python". + + https://doc.qt.io/qtforpython-6/ + +comment "python-pyside6 needs an OpenGL-capable backend" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_PACKAGE_QT6_GL_SUPPORTS
package/qt6/python-pyside6/python-pyside6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-pyside6/python-pyside6.mk new file +86 -0
86 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 3/5 support/testing: add python-pyside6 runtime test
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
The test imports the PySide6 modules, and uses a class of each one.
It runs with the offscreen Qt platform plugin, so it needs no display.
---
Changes v3 -> v4:
- Split from the package patch
- Use the current mesa3d options and an ext4 root filesystem
- Look up the QML files with QLibraryInfo
- Write the asserts as statements, for flake8
- DEVELOPERS: v3 had the test files in a new entry for Dylan. v4 has them in my entry. Dylan, tell me if you want to be listed
DEVELOPERS | 2 + .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 3 files changed, 230 insertions(+) create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
DEVELOPERS +2 -0
@@ -265,6 +265,8 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ F: package/uthash/ +F: support/testing/tests/package/sample_python_pyside6.py +F: support/testing/tests/package/test_python_pyside6.py N: Andy Shevchenko <[email protected]> F: package/fb-test-app/
support/testing/tests/package/sample_python_pyside6.py new file +165 -0
165 lines not on this page · raw message
support/testing/tests/package/test_python_pyside6.py new file +63 -0
63 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 4/5 package/python-matplotlib: add Qt6 support to the Qt display
In reply to Angelo CompagnucciThe "qt display" option of matplotlib needs the Python bindings of Qt. Until now, it only worked with Qt5 and python-pyqt5.
With Qt6, use python-pyside6. The Qt backend of matplotlib finds the bindings at run time, and it supports both PyQt5 and PySide6.
Qt5 and Qt6 cannot be enabled together, so the option selects the bindings that match the Qt version of the configuration.
---
Changes v3 -> v4:
- New patch: the Qt display of matplotlib works with Qt6 too, with python-pyside6. With Qt5 it still uses python-pyqt5
package/python-matplotlib/Config.in | 15 +++++++++++---- package/python-matplotlib/python-matplotlib.mk | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-)
package/python-matplotlib/Config.in +11 -4
@@ -35,10 +35,17 @@ if BR2_PACKAGE_PYTHON_MATPLOTLIB config BR2_PACKAGE_PYTHON_MATPLOTLIB_QT bool "qt display" - depends on BR2_PACKAGE_QT5 # python-pyqt5 - select BR2_PACKAGE_PYTHON_PYQT5 - select BR2_PACKAGE_QT5BASE_FONTCONFIG - select BR2_PACKAGE_QT5BASE_WIDGETS + depends on BR2_PACKAGE_QT5 || \ + (BR2_PACKAGE_QT6 && \ + BR2_PACKAGE_QT6_GL_SUPPORTS && \ + BR2_PACKAGE_LLVM_ARCH_SUPPORTS) # python-pyside6 + # Qt5 + select BR2_PACKAGE_PYTHON_PYQT5 if BR2_PACKAGE_QT5 + select BR2_PACKAGE_QT5BASE_FONTCONFIG if BR2_PACKAGE_QT5 + select BR2_PACKAGE_QT5BASE_WIDGETS if BR2_PACKAGE_QT5 + # Qt6 + select BR2_PACKAGE_PYTHON_PYSIDE6 if BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_FONTCONFIG if BR2_PACKAGE_QT6 endif
package/python-matplotlib/python-matplotlib.mk +6 -0
@@ -27,8 +27,14 @@ PYTHON_MATPLOTLIB_CONF_ENV += \ _PYTHON_SYSCONFIGDATA_NAME=$(PKG_PYTHON_SYSCONFIGDATA_NAME) \ PYTHONPATH=$(PYTHON3_PATH) +# The Qt backend of matplotlib finds the Python bindings of Qt at run +# time: PyQt5 with Qt5, PySide6 with Qt6. ifeq ($(BR2_PACKAGE_PYTHON_MATPLOTLIB_QT),y) +ifeq ($(BR2_PACKAGE_QT5),y) PYTHON_MATPLOTLIB_DEPENDENCIES += python-pyqt5 +else +PYTHON_MATPLOTLIB_DEPENDENCIES += python-pyside6 +endif endif $(eval $(meson-package))
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v4 5/5 support/testing: add python-matplotlib runtime test
In reply to Angelo CompagnucciThe test uses the same configuration as the python-pyside6 test: Qt6 with the offscreen platform, on an Aarch64 machine. It checks two backends of matplotlib:
- Agg, the default one, which draws to PNG and SVG files;
- QtAgg, the Qt backend, which must find the PySide6 bindings.
---
Changes v3 -> v4:
- New patch: a runtime test of matplotlib with Qt6, based on the python-pyside6 test
DEVELOPERS | 2 + .../tests/package/sample_python_matplotlib.py | 39 +++++++++++++++ .../tests/package/test_python_matplotlib.py | 48 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 support/testing/tests/package/sample_python_matplotlib.py create mode 100644 support/testing/tests/package/test_python_matplotlib.py
DEVELOPERS +2 -0
@@ -265,7 +265,9 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ F: package/uthash/ +F: support/testing/tests/package/sample_python_matplotlib.py F: support/testing/tests/package/sample_python_pyside6.py +F: support/testing/tests/package/test_python_matplotlib.py F: support/testing/tests/package/test_python_pyside6.py N: Andy Shevchenko <[email protected]>
support/testing/tests/package/sample_python_matplotlib.py new file +39 -0
@@ -0,0 +1,39 @@ +import os + +import matplotlib + + +def plot(name): + import matplotlib.pyplot as plt + fig, ax = plt.subplots() + ax.plot([1, 2, 3], [1, 4, 9]) + fig.canvas.draw() + fig.savefig(name) + assert os.path.getsize(name) > 0 + return fig + + +def test_agg(): + # The default backend, with no display + matplotlib.use("Agg") + fig = plot("/tmp/plot.png") + assert type(fig.canvas).__name__ == "FigureCanvasAgg" + plot("/tmp/plot.svg") + + +def test_qtagg(): + # Without DISPLAY, matplotlib takes the system for headless, and + # refuses the Qt backend. With a QApplication running, it accepts it. + from PySide6.QtWidgets import QApplication + app = QApplication([]) + matplotlib.use("QtAgg") + from matplotlib.backends.qt_compat import QT_API + assert QT_API == "PySide6" + fig = plot("/tmp/plot-qt.png") + assert type(fig.canvas).__name__ == "FigureCanvasQTAgg" + QApplication.shutdown(app) + + +if __name__ == "__main__": + test_agg() + test_qtagg()
support/testing/tests/package/test_python_matplotlib.py new file +48 -0
48 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
v5 cover package/python-pyside6: new package
In reply to Angelo CompagnucciHello,
v4 of this series was sent twice by mistake, with the same version
number: first with three patches, then with five. This v5 has the five patches, unchanged since the second v4. Please ignore both v4.
This series updates an older one: "added package/python-{shiboken6, pyside6}: new packages" by Dylan Bespalko. Its last version was v3, sent in August 2024.
It adds PySide6, the Python bindings of Qt6, and Shiboken6, the generator that builds them.
Dylan is still the author of the first three patches. I brought them up to date with the current Buildroot and Qt6, and I added myself as co-author. The last two patches are new.
The main changes since v3:
- The single patch is now three: python-shiboken6, python-pyside6 and the runtime test.
- The version goes from 6.7.2 to 6.11.3, the Qt6 version of Buildroot. Qt for Python must have the same version as Qt6, so the packages move to package/qt6/ and follow QT6_VERSION.
- The source is the release tarball, not the git repository.
- pyside-tools is not packaged. As Dylan proposed in his reply to v3, the Qt tools "uic -g python" and "rcc -g python" do the same job.
- A new patch lets the Qt display of python-matplotlib use PySide6 with Qt6. With Qt5 it still uses PyQt5.
- A new runtime test checks matplotlib with Qt6. It uses the same configuration as the python-pyside6 test.
v3 added a DEVELOPERS entry for Dylan. This series does not: the packages are now in package/qt6/, which already has maintainers, and the test files are in my entry. Dylan, tell me if you want to be listed too.
Angelo Compagnucci (2):
package/python-matplotlib: add Qt6 support to the Qt display support/testing: add python-matplotlib runtime test
Dylan Bespalko (3):
package/python-shiboken6: new package package/python-pyside6: new package support/testing: add python-pyside6 runtime test
DEVELOPERS | 4 + package/python-matplotlib/Config.in | 15 +- .../python-matplotlib/python-matplotlib.mk | 6 + package/qt6/Config.in | 2 + package/qt6/python-pyside6/Config.in | 32 ++++ .../qt6/python-pyside6/python-pyside6.hash | 9 + package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++ package/qt6/python-shiboken6/Config.in | 12 ++ .../python-shiboken6/python-shiboken6.hash | 9 + .../qt6/python-shiboken6/python-shiboken6.mk | 57 ++++++ .../tests/package/sample_python_matplotlib.py | 39 +++++ .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_matplotlib.py | 48 +++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 14 files changed, 543 insertions(+), 4 deletions(-) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk create mode 100644 support/testing/tests/package/sample_python_matplotlib.py create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_matplotlib.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 1/5 package/python-shiboken6: new package
From: Dylan Bespalko <[email protected]>
There are actually three projects combined in the PySide6 repo:
- Shiboken6 (package/python-shiboken6): A C++/Python Binding Generator
- PySide6 (package/python-pyside6): A C++/Python binding of Qt6
- pyside-tools (Not Included): which contains pyside6-uic/pyside6-rcc
This package builds Shiboken6 from the release tarball:
- The host package builds the binding generator. The generator uses libclang, from host-clang, to read the C++ headers of the target.
- The target package builds the shiboken6 library and its Python module. The generated bindings need them at run time.
Qt for Python has the same version as Qt6. So the package is in package/qt6/ and follows QT6_VERSION, like the other Qt6 modules.
---
Changes v4 -> v5:
- No change
Changes v3 -> v4:
- Split the patch in three: python-shiboken6, python-pyside6 and the runtime test
- Bump to 6.11.3. The package moves to package/qt6/ and follows QT6_VERSION, like the other Qt6 modules
- Download the release tarball from download.qt.io, not the git repository. It has an upstream hash, and python-pyside6 uses the same file
- In 6.11 the generator is in sources/shiboken6_generator. The host package builds it. The target package builds only the library and the Python module
- Drop the selects of host packages: a host package cannot be selected. Drop the select of BR2_PACKAGE_QT6_GL_SUPPORTS: it is a blind option
- Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS, for host-clang
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-shiboken6/Config.in | 12 ++++ .../python-shiboken6/python-shiboken6.hash | 9 +++ .../qt6/python-shiboken6/python-shiboken6.mk | 57 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 package/qt6/python-shiboken6/Config.in create mode 100644 package/qt6/python-shiboken6/python-shiboken6.hash create mode 100644 package/qt6/python-shiboken6/python-shiboken6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in" source "package/qt6/qt6coap/Config.in"
package/qt6/python-shiboken6/Config.in new file +12 -0
@@ -0,0 +1,12 @@ +config BR2_PACKAGE_PYTHON_SHIBOKEN6 + bool "python-shiboken6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # host-clang + select BR2_PACKAGE_PYTHON3_ZLIB # embedded signature support + help + Shiboken6 generates the Python bindings of PySide6. This + package installs its library and its Python module, which + the bindings need at run time. + + https://doc.qt.io/qtforpython-6/shiboken6/index.html
package/qt6/python-shiboken6/python-shiboken6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-shiboken6/python-shiboken6.mk new file +57 -0
57 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 2/5 package/python-pyside6: new package
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
PySide6 is the official Python binding of Qt6, from the Qt for Python project. It is built with the Shiboken6 generator, from the same release tarball.
The bindings are built only for the Qt6 modules that are enabled in the configuration.
A PySide6 program needs a Qt platform plugin. Select one with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with the QT_QPA_PLATFORM environment variable at run time.
pyside-tools is not packaged. It holds pyside6-uic and pyside6-rcc, but the Qt host tools do the same job and write Python code:
$(HOST_DIR)/libexec/uic -g python $(HOST_DIR)/libexec/rcc -g python
Buildroot has Python bindings for Qt5 only, in python-pyqt5. This package adds the bindings for Qt6.
---
Changes v4 -> v5:
- No change
Changes v3 -> v4:
- Split from the python-shiboken6 patch
- Bump to 6.11.3. The package moves to package/qt6/, follows QT6_VERSION and uses the tarball of python-shiboken6
- Depend on BR2_PACKAGE_QT6_GL_SUPPORTS instead of selecting it: it is a blind option. Depend on BR2_PACKAGE_LLVM_ARCH_SUPPORTS too
- Drop --compiler-path=$(HOST_DIR)/bin/clang: shiboken already uses the cross compiler in a cross build. Drop STANDALONE=ON: it is for wheels that bundle Qt
- Fix the condition of OpenGLWidgets. Add the Quick modules only when qt6declarative has Quick support
- Keep the upstream order of the modules in MODULES: they are built in that order
- Help text: point to "uic -g python" and "rcc -g python" instead of pyside-tools [Dylan Bespalko]
- DEVELOPERS: v3 added an entry for Dylan. v4 does not: the packages are now in package/qt6/, which already has maintainers. Dylan, tell me if you want to be listed
package/qt6/Config.in | 1 + package/qt6/python-pyside6/Config.in | 32 +++++++ .../qt6/python-pyside6/python-pyside6.hash | 9 ++ package/qt6/python-pyside6/python-pyside6.mk | 86 +++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 package/qt6/python-pyside6/Config.in create mode 100644 package/qt6/python-pyside6/python-pyside6.hash create mode 100644 package/qt6/python-pyside6/python-pyside6.mk
package/qt6/Config.in +1 -0
@@ -43,6 +43,7 @@ menuconfig BR2_PACKAGE_QT6 if BR2_PACKAGE_QT6 +source "package/qt6/python-pyside6/Config.in" source "package/qt6/python-shiboken6/Config.in" source "package/qt6/qt6base/Config.in" source "package/qt6/qt6charts/Config.in"
package/qt6/python-pyside6/Config.in new file +32 -0
@@ -0,0 +1,32 @@ +config BR2_PACKAGE_PYTHON_PYSIDE6 + bool "python-pyside6" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_QT6_GL_SUPPORTS # QtGui OpenGL classes + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS # python-shiboken6 + select BR2_PACKAGE_PYTHON_SHIBOKEN6 + select BR2_PACKAGE_QT6BASE_GUI + select BR2_PACKAGE_QT6BASE_OPENGL + select BR2_PACKAGE_QT6BASE_WIDGETS + select BR2_PACKAGE_OPENSSL if BR2_PACKAGE_QT6BASE_NETWORK # QtNetwork SSL classes + help + Qt for Python: the official Python bindings of Qt6. + + The bindings cover the Qt6 modules that are enabled. + + A PySide6 program needs a Qt platform plugin. Select one + with BR2_PACKAGE_QT6BASE_DEFAULT_QPA at build time, or with + the QT_QPA_PLATFORM environment variable at run time. + + pyside6-uic and pyside6-rcc are not installed. To convert + .ui and .qrc files to Python, use the Qt tools: + "$(HOST_DIR)/libexec/uic -g python" and + "$(HOST_DIR)/libexec/rcc -g python". + + https://doc.qt.io/qtforpython-6/ + +comment "python-pyside6 needs an OpenGL-capable backend" + depends on BR2_PACKAGE_PYTHON3 + depends on BR2_PACKAGE_QT6 + depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS + depends on !BR2_PACKAGE_QT6_GL_SUPPORTS
package/qt6/python-pyside6/python-pyside6.hash new file +9 -0
@@ -0,0 +1,9 @@ +# From https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-6.11.3-src/pyside-setup-everywhere-src-6.11.3.tar.xz.sha256 +sha256 050819cb05e14d6689f42b56e4fa9c8ff63be2bb339e0c094c45b990b7cabde1 pyside-setup-everywhere-src-6.11.3.tar.xz + +# Hash for license files +sha256 62803a6fcceef9091a129d7293d2469ea332b35d30f5e1bc4c628a9f35f3d29c LICENSES/BSD-3-Clause.txt +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 LICENSES/GPL-2.0-only.txt +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 LICENSES/GPL-3.0-only.txt +sha256 da7eabb7bafdf7d3ae5e9f223aa5bdc1eece45ac569dc21b3b037520b4464768 LICENSES/LGPL-3.0-only.txt +sha256 40678d338ce53cd93f8b22b281a2ecbcaa3ee65ce60b25ffb0c462b0530846b2 LICENSES/Qt-GPL-exception-1.0.txt
package/qt6/python-pyside6/python-pyside6.mk new file +86 -0
86 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 3/5 support/testing: add python-pyside6 runtime test
In reply to Angelo CompagnucciFrom: Dylan Bespalko <[email protected]>
The test imports the PySide6 modules, and uses a class of each one.
It runs with the offscreen Qt platform plugin, so it needs no display.
---
Changes v4 -> v5:
- No change
Changes v3 -> v4:
- Split from the package patch
- Use the current mesa3d options and an ext4 root filesystem
- Look up the QML files with QLibraryInfo
- Write the asserts as statements, for flake8
- DEVELOPERS: v3 had the test files in a new entry for Dylan. v4 has them in my entry. Dylan, tell me if you want to be listed
DEVELOPERS | 2 + .../tests/package/sample_python_pyside6.py | 165 ++++++++++++++++++ .../tests/package/test_python_pyside6.py | 63 +++++++ 3 files changed, 230 insertions(+) create mode 100644 support/testing/tests/package/sample_python_pyside6.py create mode 100644 support/testing/tests/package/test_python_pyside6.py
DEVELOPERS +2 -0
@@ -265,6 +265,8 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ F: package/uthash/ +F: support/testing/tests/package/sample_python_pyside6.py +F: support/testing/tests/package/test_python_pyside6.py N: Andy Shevchenko <[email protected]> F: package/fb-test-app/
support/testing/tests/package/sample_python_pyside6.py new file +165 -0
165 lines not on this page · raw message
support/testing/tests/package/test_python_pyside6.py new file +63 -0
63 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 4/5 package/python-matplotlib: add Qt6 support to the Qt display
In reply to Angelo CompagnucciThe "qt display" option of matplotlib needs the Python bindings of Qt. Until now, it only worked with Qt5 and python-pyqt5.
With Qt6, use python-pyside6. The Qt backend of matplotlib finds the bindings at run time, and it supports both PyQt5 and PySide6.
Qt5 and Qt6 cannot be enabled together, so the option selects the bindings that match the Qt version of the configuration.
---
Changes v4 -> v5:
- New patch: the Qt display of matplotlib works with Qt6 too, with python-pyside6. With Qt5 it still uses python-pyqt5. It was already in the second v4, sent by mistake
package/python-matplotlib/Config.in | 15 +++++++++++---- package/python-matplotlib/python-matplotlib.mk | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-)
package/python-matplotlib/Config.in +11 -4
@@ -35,10 +35,17 @@ if BR2_PACKAGE_PYTHON_MATPLOTLIB config BR2_PACKAGE_PYTHON_MATPLOTLIB_QT bool "qt display" - depends on BR2_PACKAGE_QT5 # python-pyqt5 - select BR2_PACKAGE_PYTHON_PYQT5 - select BR2_PACKAGE_QT5BASE_FONTCONFIG - select BR2_PACKAGE_QT5BASE_WIDGETS + depends on BR2_PACKAGE_QT5 || \ + (BR2_PACKAGE_QT6 && \ + BR2_PACKAGE_QT6_GL_SUPPORTS && \ + BR2_PACKAGE_LLVM_ARCH_SUPPORTS) # python-pyside6 + # Qt5 + select BR2_PACKAGE_PYTHON_PYQT5 if BR2_PACKAGE_QT5 + select BR2_PACKAGE_QT5BASE_FONTCONFIG if BR2_PACKAGE_QT5 + select BR2_PACKAGE_QT5BASE_WIDGETS if BR2_PACKAGE_QT5 + # Qt6 + select BR2_PACKAGE_PYTHON_PYSIDE6 if BR2_PACKAGE_QT6 + select BR2_PACKAGE_QT6BASE_FONTCONFIG if BR2_PACKAGE_QT6 endif
package/python-matplotlib/python-matplotlib.mk +6 -0
@@ -27,8 +27,14 @@ PYTHON_MATPLOTLIB_CONF_ENV += \ _PYTHON_SYSCONFIGDATA_NAME=$(PKG_PYTHON_SYSCONFIGDATA_NAME) \ PYTHONPATH=$(PYTHON3_PATH) +# The Qt backend of matplotlib finds the Python bindings of Qt at run +# time: PyQt5 with Qt5, PySide6 with Qt6. ifeq ($(BR2_PACKAGE_PYTHON_MATPLOTLIB_QT),y) +ifeq ($(BR2_PACKAGE_QT5),y) PYTHON_MATPLOTLIB_DEPENDENCIES += python-pyqt5 +else +PYTHON_MATPLOTLIB_DEPENDENCIES += python-pyside6 +endif endif $(eval $(meson-package))
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v5 5/5 support/testing: add python-matplotlib runtime test
In reply to Angelo CompagnucciThe test uses the same configuration as the python-pyside6 test: Qt6 with the offscreen platform, on an Aarch64 machine. It checks two backends of matplotlib:
- Agg, the default one, which draws to PNG and SVG files;
- QtAgg, the Qt backend, which must find the PySide6 bindings.
---
Changes v4 -> v5:
- New patch: a runtime test of matplotlib with Qt6, based on the python-pyside6 test. It was already in the second v4, sent by mistake
DEVELOPERS | 2 + .../tests/package/sample_python_matplotlib.py | 39 +++++++++++++++ .../tests/package/test_python_matplotlib.py | 48 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 support/testing/tests/package/sample_python_matplotlib.py create mode 100644 support/testing/tests/package/test_python_matplotlib.py
DEVELOPERS +2 -0
@@ -265,7 +265,9 @@ F: package/sshguard/ F: package/sunwait/ F: package/sysdig/ F: package/uthash/ +F: support/testing/tests/package/sample_python_matplotlib.py F: support/testing/tests/package/sample_python_pyside6.py +F: support/testing/tests/package/test_python_matplotlib.py F: support/testing/tests/package/test_python_pyside6.py N: Andy Shevchenko <[email protected]>
support/testing/tests/package/sample_python_matplotlib.py new file +39 -0
@@ -0,0 +1,39 @@ +import os + +import matplotlib + + +def plot(name): + import matplotlib.pyplot as plt + fig, ax = plt.subplots() + ax.plot([1, 2, 3], [1, 4, 9]) + fig.canvas.draw() + fig.savefig(name) + assert os.path.getsize(name) > 0 + return fig + + +def test_agg(): + # The default backend, with no display + matplotlib.use("Agg") + fig = plot("/tmp/plot.png") + assert type(fig.canvas).__name__ == "FigureCanvasAgg" + plot("/tmp/plot.svg") + + +def test_qtagg(): + # Without DISPLAY, matplotlib takes the system for headless, and + # refuses the Qt backend. With a QApplication running, it accepts it. + from PySide6.QtWidgets import QApplication + app = QApplication([]) + matplotlib.use("QtAgg") + from matplotlib.backends.qt_compat import QT_API + assert QT_API == "PySide6" + fig = plot("/tmp/plot-qt.png") + assert type(fig.canvas).__name__ == "FigureCanvasQTAgg" + QApplication.shutdown(app) + + +if __name__ == "__main__": + test_agg() + test_qtagg()
support/testing/tests/package/test_python_matplotlib.py new file +48 -0
48 lines not on this page · raw message
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot