All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages
@ 2024-08-12  8:03 Dylan Bespalko
  2024-08-14  6:02 ` Dylan Bespalko
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Dylan Bespalko @ 2024-08-12  8:03 UTC (permalink / raw)
  To: thomas.petazzoni, buildroot
  Cc: Dylan Bespalko, James Hilliard, Samuel Martin, Asaf Kahlon

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index d7d0af3543..eca9e3a9f8 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -876,6 +876,12 @@ F:	package/unscd/
 N:	Dushara Jayasinghe <nidujay@gmail.com>
 F:	package/prosody/
 
+N:	Dylan Bespalko <dylan.bespalko@gmail.com>
+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 <bonet@grenoble.cnrs.fr>
 F:	board/acmesystems/acqua-a5/
 F:	configs/acmesystems_acqua_a5_256mb_defconfig
diff --git a/package/Config.in b/package/Config.in
index f2c63ffb6e..2086f5ed19 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/python-pyside6/Config.in b/package/python-pyside6/Config.in
new file mode 100644
index 0000000000..6bc754e1cf
--- /dev/null
+++ b/package/python-pyside6/Config.in
@@ -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
diff --git a/package/python-pyside6/python-pyside6.hash b/package/python-pyside6/python-pyside6.hash
new file mode 100644
index 0000000000..361ae66124
--- /dev/null
+++ b/package/python-pyside6/python-pyside6.hash
@@ -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
diff --git a/package/python-pyside6/python-pyside6.mk b/package/python-pyside6/python-pyside6.mk
new file mode 100644
index 0000000000..af28384676
--- /dev/null
+++ b/package/python-pyside6/python-pyside6.mk
@@ -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))
diff --git a/package/python-shiboken6/Config.in b/package/python-shiboken6/Config.in
new file mode 100644
index 0000000000..04c5818536
--- /dev/null
+++ b/package/python-shiboken6/Config.in
@@ -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
diff --git a/package/python-shiboken6/python-shiboken6.hash b/package/python-shiboken6/python-shiboken6.hash
new file mode 100644
index 0000000000..d6f479a477
--- /dev/null
+++ b/package/python-shiboken6/python-shiboken6.hash
@@ -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
diff --git a/package/python-shiboken6/python-shiboken6.mk b/package/python-shiboken6/python-shiboken6.mk
new file mode 100644
index 0000000000..bb7843a3ec
--- /dev/null
+++ b/package/python-shiboken6/python-shiboken6.mk
@@ -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))
diff --git a/support/testing/tests/package/sample_python_pyside6.py b/support/testing/tests/package/sample_python_pyside6.py
new file mode 100644
index 0000000000..5806565041
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pyside6.py
@@ -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()
diff --git a/support/testing/tests/package/test_python_pyside6.py b/support/testing/tests/package/test_python_pyside6.py
new file mode 100644
index 0000000000..a5a4872182
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyside6.py
@@ -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")
+        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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages
  2024-08-12  8:03 [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages Dylan Bespalko
@ 2024-08-14  6:02 ` Dylan Bespalko
  2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
  2 siblings, 0 replies; 18+ messages in thread
From: Dylan Bespalko @ 2024-08-14  6:02 UTC (permalink / raw)
  To: thomas.petazzoni, buildroot; +Cc: James Hilliard, Samuel Martin, Asaf Kahlon

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:

On 8/12/24 01:03, Dylan Bespalko wrote:
> 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.

>    
> 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<dylan.bespalko@gmail.com>
> ---
> 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
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index d7d0af3543..eca9e3a9f8 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -876,6 +876,12 @@ F:	package/unscd/
>   N:	Dushara Jayasinghe<nidujay@gmail.com>
>   F:	package/prosody/
>   
> +N:	Dylan Bespalko<dylan.bespalko@gmail.com>
> +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<bonet@grenoble.cnrs.fr>
>   F:	board/acmesystems/acqua-a5/
>   F:	configs/acmesystems_acqua_a5_256mb_defconfig
> diff --git a/package/Config.in b/package/Config.in
> index f2c63ffb6e..2086f5ed19 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -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"
> diff --git a/package/python-pyside6/Config.in b/package/python-pyside6/Config.in
> new file mode 100644
> index 0000000000..6bc754e1cf
> --- /dev/null
> +++ b/package/python-pyside6/Config.in
> @@ -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> 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.

       https://wiki.qt.io/Qt_for_Python

> diff --git a/package/python-pyside6/python-pyside6.hash b/package/python-pyside6/python-pyside6.hash
> new file mode 100644
> index 0000000000..361ae66124
> --- /dev/null
> +++ b/package/python-pyside6/python-pyside6.hash
> @@ -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
> diff --git a/package/python-pyside6/python-pyside6.mk b/package/python-pyside6/python-pyside6.mk
> new file mode 100644
> index 0000000000..af28384676
> --- /dev/null
> +++ b/package/python-pyside6/python-pyside6.mk
> @@ -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))
> diff --git a/package/python-shiboken6/Config.in b/package/python-shiboken6/Config.in
> new file mode 100644
> index 0000000000..04c5818536
> --- /dev/null
> +++ b/package/python-shiboken6/Config.in
> @@ -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
> diff --git a/package/python-shiboken6/python-shiboken6.hash b/package/python-shiboken6/python-shiboken6.hash
> new file mode 100644
> index 0000000000..d6f479a477
> --- /dev/null
> +++ b/package/python-shiboken6/python-shiboken6.hash
> @@ -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
> diff --git a/package/python-shiboken6/python-shiboken6.mk b/package/python-shiboken6/python-shiboken6.mk
> new file mode 100644
> index 0000000000..bb7843a3ec
> --- /dev/null
> +++ b/package/python-shiboken6/python-shiboken6.mk
> @@ -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))
> diff --git a/support/testing/tests/package/sample_python_pyside6.py b/support/testing/tests/package/sample_python_pyside6.py
> new file mode 100644
> index 0000000000..5806565041
> --- /dev/null
> +++ b/support/testing/tests/package/sample_python_pyside6.py
> @@ -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()
> diff --git a/support/testing/tests/package/test_python_pyside6.py b/support/testing/tests/package/test_python_pyside6.py
> new file mode 100644
> index 0000000000..a5a4872182
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_pyside6.py
> @@ -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")
> +        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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package
  2024-08-12  8:03 [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages Dylan Bespalko
  2024-08-14  6:02 ` Dylan Bespalko
@ 2026-11-16 15:56 ` Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 1/3] package/python-shiboken6: " Angelo Compagnucci
                     ` (2 more replies)
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
  2 siblings, 3 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 15:56 UTC (permalink / raw)
  To: buildroot
  Cc: Dylan Bespalko, Roy Kollen Svendsen, Thomas Petazzoni,
	Angelo Compagnucci

Hello,

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/20240812080307.553359-1-dylan.bespalko@gmail.com/

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

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 1/3] package/python-shiboken6: new package
  2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
@ 2026-11-16 15:56   ` Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 2/3] package/python-pyside6: " Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 3/3] support/testing: add python-pyside6 runtime test Angelo Compagnucci
  2 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 15:56 UTC (permalink / raw)
  To: buildroot
  Cc: Dylan Bespalko, Roy Kollen Svendsen, Thomas Petazzoni,
	Angelo Compagnucci

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index f3a540e9f8..42a24f0c0a 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-shiboken6/Config.in b/package/qt6/python-shiboken6/Config.in
new file mode 100644
index 0000000000..6ded490baf
--- /dev/null
+++ b/package/qt6/python-shiboken6/Config.in
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.hash b/package/qt6/python-shiboken6/python-shiboken6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.hash
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.mk b/package/qt6/python-shiboken6/python-shiboken6.mk
new file mode 100644
index 0000000000..6433678d71
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.mk
@@ -0,0 +1,57 @@
+################################################################################
+#
+# python-shiboken6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_SHIBOKEN6_VERSION = $(QT6_VERSION)
+PYTHON_SHIBOKEN6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_SHIBOKEN6_VERSION)-src
+PYTHON_SHIBOKEN6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_SHIBOKEN6_VERSION).tar.xz
+PYTHON_SHIBOKEN6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (library, module), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (generator), \
+	BSD-3-Clause (cmake)
+PYTHON_SHIBOKEN6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_SHIBOKEN6_CPE_ID_VENDOR = qt
+PYTHON_SHIBOKEN6_CPE_ID_PRODUCT = shiboken
+PYTHON_SHIBOKEN6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_SHIBOKEN6_INSTALL_STAGING = YES
+
+# The target package builds the shiboken6 library and its Python
+# module. The host package builds the binding generator, which the
+# target package and python-pyside6 need at build time.
+PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6
+HOST_PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6_generator
+
+PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python3 \
+	qt6base
+
+PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+HOST_PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-clang \
+	host-llvm \
+	host-python3 \
+	host-qt6base
+
+HOST_PYTHON_SHIBOKEN6_CONF_ENV = \
+	LLVM_INSTALL_DIR=$(HOST_DIR)
+
+# libxslt is only used to extract the documentation
+HOST_PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DCMAKE_DISABLE_FIND_PACKAGE_LibXslt=ON
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 2/3] package/python-pyside6: new package
  2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 1/3] package/python-shiboken6: " Angelo Compagnucci
@ 2026-11-16 15:56   ` Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 3/3] support/testing: add python-pyside6 runtime test Angelo Compagnucci
  2 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 15:56 UTC (permalink / raw)
  To: buildroot
  Cc: Dylan Bespalko, Roy Kollen Svendsen, Thomas Petazzoni,
	Angelo Compagnucci

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index 42a24f0c0a..b6295ed295 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-pyside6/Config.in b/package/qt6/python-pyside6/Config.in
new file mode 100644
index 0000000000..1b1a2ecc04
--- /dev/null
+++ b/package/qt6/python-pyside6/Config.in
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.hash b/package/qt6/python-pyside6/python-pyside6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.hash
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.mk b/package/qt6/python-pyside6/python-pyside6.mk
new file mode 100644
index 0000000000..28656d8f18
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.mk
@@ -0,0 +1,86 @@
+################################################################################
+#
+# python-pyside6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_PYSIDE6_VERSION = $(QT6_VERSION)
+PYTHON_PYSIDE6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_PYSIDE6_VERSION)-src
+PYTHON_PYSIDE6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_PYSIDE6_VERSION).tar.xz
+PYTHON_PYSIDE6_DL_SUBDIR = python-shiboken6
+PYTHON_PYSIDE6_SUBDIR = sources/pyside6
+PYTHON_PYSIDE6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (bindings), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (tools), \
+	BSD-3-Clause (examples, cmake)
+PYTHON_PYSIDE6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_PYSIDE6_CPE_ID_VENDOR = qt
+PYTHON_PYSIDE6_CPE_ID_PRODUCT = pyside
+PYTHON_PYSIDE6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_PYSIDE6_INSTALL_STAGING = YES
+
+PYTHON_PYSIDE6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python-shiboken6 \
+	qt6base
+
+# The modules are built in the order of this list, and a module needs
+# the ones before it. Keep the order of ALL_ESSENTIAL_MODULES and
+# ALL_OPTIONAL_MODULES in sources/pyside6/cmake/PySideHelpers.cmake.
+PYTHON_PYSIDE6_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) \
+	$(if $(BR2_PACKAGE_QT6BASE_DBUS),DBus) \
+	$(if $(BR2_PACKAGE_QT6BASE_XML),Xml) \
+	OpenGL \
+	OpenGLWidgets
+
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6declarative
+PYTHON_PYSIDE6_MODULES += Qml
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE_QUICK),y)
+PYTHON_PYSIDE6_MODULES += \
+	Quick \
+	QuickControls2 \
+	$(if $(BR2_PACKAGE_QT6BASE_TEST),QuickTest) \
+	QuickWidgets
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SERIALPORT),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialport
+PYTHON_PYSIDE6_MODULES += SerialPort
+ifeq ($(BR2_PACKAGE_QT6SERIALBUS),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialbus
+PYTHON_PYSIDE6_MODULES += SerialBus
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SVG),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6svg
+PYTHON_PYSIDE6_MODULES += Svg SvgWidgets
+endif
+
+# The Qt headers are in the sysroot, so shiboken takes them for system
+# headers and skips them. PYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM
+# makes it process them.
+PYTHON_PYSIDE6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DMODULES="$(subst $(space),;,$(strip $(PYTHON_PYSIDE6_MODULES)))" \
+	-DPYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM=ON \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+$(eval $(cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 3/3] support/testing: add python-pyside6 runtime test
  2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 1/3] package/python-shiboken6: " Angelo Compagnucci
  2026-11-16 15:56   ` [Buildroot] [PATCH v4 2/3] package/python-pyside6: " Angelo Compagnucci
@ 2026-11-16 15:56   ` Angelo Compagnucci
  2 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 15:56 UTC (permalink / raw)
  To: buildroot
  Cc: Dylan Bespalko, Roy Kollen Svendsen, Thomas Petazzoni,
	Angelo Compagnucci

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 1d2960f9b3..14aac54303 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <andy.shevchenko@gmail.com>
 F:	package/fb-test-app/
diff --git a/support/testing/tests/package/sample_python_pyside6.py b/support/testing/tests/package/sample_python_pyside6.py
new file mode 100644
index 0000000000..f2677c6286
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pyside6.py
@@ -0,0 +1,165 @@
+import os
+
+
+def qml_file(name):
+    from PySide6.QtCore import QLibraryInfo
+    qml_dir = QLibraryInfo.path(QLibraryInfo.LibraryPath.QmlImportsPath)
+    return os.path.join(qml_dir, name)
+
+
+# The essential modules: ALL_ESSENTIAL_MODULES in PySideHelpers.cmake
+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
+
+
+# The optional modules: ALL_OPTIONAL_MODULES in PySideHelpers.cmake
+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()
+    # QOpenGLWidget is not supported on this platform: only create it.
+    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(qml_file('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(qml_file('QtQuick/Controls/Universal/Label.qml'))
+    assert str(view.status()) == 'Status.Ready'
+    QtWidgets.QApplication.shutdown(app)
+
+
+def test_python_pyside6_qtserialport():
+    # The port does not need to exist: the test never opens it.
+    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()
diff --git a/support/testing/tests/package/test_python_pyside6.py b/support/testing/tests/package/test_python_pyside6.py
new file mode 100644
index 0000000000..d93be0bb26
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyside6.py
@@ -0,0 +1,63 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+# gitlab-runner: 2xlarge
+class TestPythonPy3PySide6(TestPythonPackageBase):
+    __test__ = True
+    # This test needs its own configuration:
+    # - Aarch64, to have more than 256 MB of memory;
+    # - an ext4 root filesystem on a virtio disk, not a cpio initrd.
+    #   The image is big, and this saves memory.
+    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.81"
+        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_GALLIUM_DRIVER_SOFTPIPE=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_QT6BASE_DEFAULT_QPA="offscreen"
+        BR2_PACKAGE_QT6DECLARATIVE=y
+        BR2_PACKAGE_QT6DECLARATIVE_QUICK=y
+        BR2_PACKAGE_QT6SERIALPORT=y
+        BR2_PACKAGE_QT6SERIALBUS=y
+        BR2_PACKAGE_QT6SVG=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PYSIDE6=y
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_4=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    sample_scripts = ["tests/package/sample_python_pyside6.py"]
+    timeout = 60
+
+    def login(self):
+        drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M",
+                                    "-drive", f"file={drive},if=virtio,format=raw"])
+        self.emulator.login()
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package
  2024-08-12  8:03 [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages Dylan Bespalko
  2024-08-14  6:02 ` Dylan Bespalko
  2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
@ 2026-11-16 21:29 ` Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 1/5] package/python-shiboken6: " Angelo Compagnucci
                     ` (5 more replies)
  2 siblings, 6 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

Hello,

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

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 1/5] package/python-shiboken6: new package
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
@ 2026-11-16 21:29   ` Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 2/5] package/python-pyside6: " Angelo Compagnucci
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index f3a540e9f8..42a24f0c0a 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-shiboken6/Config.in b/package/qt6/python-shiboken6/Config.in
new file mode 100644
index 0000000000..6ded490baf
--- /dev/null
+++ b/package/qt6/python-shiboken6/Config.in
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.hash b/package/qt6/python-shiboken6/python-shiboken6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.hash
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.mk b/package/qt6/python-shiboken6/python-shiboken6.mk
new file mode 100644
index 0000000000..6433678d71
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.mk
@@ -0,0 +1,57 @@
+################################################################################
+#
+# python-shiboken6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_SHIBOKEN6_VERSION = $(QT6_VERSION)
+PYTHON_SHIBOKEN6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_SHIBOKEN6_VERSION)-src
+PYTHON_SHIBOKEN6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_SHIBOKEN6_VERSION).tar.xz
+PYTHON_SHIBOKEN6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (library, module), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (generator), \
+	BSD-3-Clause (cmake)
+PYTHON_SHIBOKEN6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_SHIBOKEN6_CPE_ID_VENDOR = qt
+PYTHON_SHIBOKEN6_CPE_ID_PRODUCT = shiboken
+PYTHON_SHIBOKEN6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_SHIBOKEN6_INSTALL_STAGING = YES
+
+# The target package builds the shiboken6 library and its Python
+# module. The host package builds the binding generator, which the
+# target package and python-pyside6 need at build time.
+PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6
+HOST_PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6_generator
+
+PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python3 \
+	qt6base
+
+PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+HOST_PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-clang \
+	host-llvm \
+	host-python3 \
+	host-qt6base
+
+HOST_PYTHON_SHIBOKEN6_CONF_ENV = \
+	LLVM_INSTALL_DIR=$(HOST_DIR)
+
+# libxslt is only used to extract the documentation
+HOST_PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DCMAKE_DISABLE_FIND_PACKAGE_LibXslt=ON
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 2/5] package/python-pyside6: new package
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 1/5] package/python-shiboken6: " Angelo Compagnucci
@ 2026-11-16 21:29   ` Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index 42a24f0c0a..b6295ed295 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-pyside6/Config.in b/package/qt6/python-pyside6/Config.in
new file mode 100644
index 0000000000..1b1a2ecc04
--- /dev/null
+++ b/package/qt6/python-pyside6/Config.in
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.hash b/package/qt6/python-pyside6/python-pyside6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.hash
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.mk b/package/qt6/python-pyside6/python-pyside6.mk
new file mode 100644
index 0000000000..28656d8f18
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.mk
@@ -0,0 +1,86 @@
+################################################################################
+#
+# python-pyside6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_PYSIDE6_VERSION = $(QT6_VERSION)
+PYTHON_PYSIDE6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_PYSIDE6_VERSION)-src
+PYTHON_PYSIDE6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_PYSIDE6_VERSION).tar.xz
+PYTHON_PYSIDE6_DL_SUBDIR = python-shiboken6
+PYTHON_PYSIDE6_SUBDIR = sources/pyside6
+PYTHON_PYSIDE6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (bindings), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (tools), \
+	BSD-3-Clause (examples, cmake)
+PYTHON_PYSIDE6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_PYSIDE6_CPE_ID_VENDOR = qt
+PYTHON_PYSIDE6_CPE_ID_PRODUCT = pyside
+PYTHON_PYSIDE6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_PYSIDE6_INSTALL_STAGING = YES
+
+PYTHON_PYSIDE6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python-shiboken6 \
+	qt6base
+
+# The modules are built in the order of this list, and a module needs
+# the ones before it. Keep the order of ALL_ESSENTIAL_MODULES and
+# ALL_OPTIONAL_MODULES in sources/pyside6/cmake/PySideHelpers.cmake.
+PYTHON_PYSIDE6_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) \
+	$(if $(BR2_PACKAGE_QT6BASE_DBUS),DBus) \
+	$(if $(BR2_PACKAGE_QT6BASE_XML),Xml) \
+	OpenGL \
+	OpenGLWidgets
+
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6declarative
+PYTHON_PYSIDE6_MODULES += Qml
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE_QUICK),y)
+PYTHON_PYSIDE6_MODULES += \
+	Quick \
+	QuickControls2 \
+	$(if $(BR2_PACKAGE_QT6BASE_TEST),QuickTest) \
+	QuickWidgets
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SERIALPORT),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialport
+PYTHON_PYSIDE6_MODULES += SerialPort
+ifeq ($(BR2_PACKAGE_QT6SERIALBUS),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialbus
+PYTHON_PYSIDE6_MODULES += SerialBus
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SVG),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6svg
+PYTHON_PYSIDE6_MODULES += Svg SvgWidgets
+endif
+
+# The Qt headers are in the sysroot, so shiboken takes them for system
+# headers and skips them. PYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM
+# makes it process them.
+PYTHON_PYSIDE6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DMODULES="$(subst $(space),;,$(strip $(PYTHON_PYSIDE6_MODULES)))" \
+	-DPYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM=ON \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+$(eval $(cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 3/5] support/testing: add python-pyside6 runtime test
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 1/5] package/python-shiboken6: " Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 2/5] package/python-pyside6: " Angelo Compagnucci
@ 2026-11-16 21:29   ` Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 1d2960f9b3..14aac54303 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <andy.shevchenko@gmail.com>
 F:	package/fb-test-app/
diff --git a/support/testing/tests/package/sample_python_pyside6.py b/support/testing/tests/package/sample_python_pyside6.py
new file mode 100644
index 0000000000..f2677c6286
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pyside6.py
@@ -0,0 +1,165 @@
+import os
+
+
+def qml_file(name):
+    from PySide6.QtCore import QLibraryInfo
+    qml_dir = QLibraryInfo.path(QLibraryInfo.LibraryPath.QmlImportsPath)
+    return os.path.join(qml_dir, name)
+
+
+# The essential modules: ALL_ESSENTIAL_MODULES in PySideHelpers.cmake
+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
+
+
+# The optional modules: ALL_OPTIONAL_MODULES in PySideHelpers.cmake
+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()
+    # QOpenGLWidget is not supported on this platform: only create it.
+    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(qml_file('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(qml_file('QtQuick/Controls/Universal/Label.qml'))
+    assert str(view.status()) == 'Status.Ready'
+    QtWidgets.QApplication.shutdown(app)
+
+
+def test_python_pyside6_qtserialport():
+    # The port does not need to exist: the test never opens it.
+    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()
diff --git a/support/testing/tests/package/test_python_pyside6.py b/support/testing/tests/package/test_python_pyside6.py
new file mode 100644
index 0000000000..d93be0bb26
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyside6.py
@@ -0,0 +1,63 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+# gitlab-runner: 2xlarge
+class TestPythonPy3PySide6(TestPythonPackageBase):
+    __test__ = True
+    # This test needs its own configuration:
+    # - Aarch64, to have more than 256 MB of memory;
+    # - an ext4 root filesystem on a virtio disk, not a cpio initrd.
+    #   The image is big, and this saves memory.
+    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.81"
+        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_GALLIUM_DRIVER_SOFTPIPE=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_QT6BASE_DEFAULT_QPA="offscreen"
+        BR2_PACKAGE_QT6DECLARATIVE=y
+        BR2_PACKAGE_QT6DECLARATIVE_QUICK=y
+        BR2_PACKAGE_QT6SERIALPORT=y
+        BR2_PACKAGE_QT6SERIALBUS=y
+        BR2_PACKAGE_QT6SVG=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PYSIDE6=y
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_4=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    sample_scripts = ["tests/package/sample_python_pyside6.py"]
+    timeout = 60
+
+    def login(self):
+        drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M",
+                                    "-drive", f"file={drive},if=virtio,format=raw"])
+        self.emulator.login()
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 4/5] package/python-matplotlib: add Qt6 support to the Qt display
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
                     ` (2 preceding siblings ...)
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
@ 2026-11-16 21:29   ` Angelo Compagnucci
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
  5 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

The "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.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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(-)

diff --git a/package/python-matplotlib/Config.in b/package/python-matplotlib/Config.in
index 13894004aa..8cd931ffb0 100644
--- a/package/python-matplotlib/Config.in
+++ b/package/python-matplotlib/Config.in
@@ -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
 
diff --git a/package/python-matplotlib/python-matplotlib.mk b/package/python-matplotlib/python-matplotlib.mk
index 067bd68685..244663f719 100644
--- a/package/python-matplotlib/python-matplotlib.mk
+++ b/package/python-matplotlib/python-matplotlib.mk
@@ -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))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v4 5/5] support/testing: add python-matplotlib runtime test
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
                     ` (3 preceding siblings ...)
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
@ 2026-11-16 21:29   ` Angelo Compagnucci
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
  5 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:29 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

The 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.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 14aac54303..5fb0c78b80 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <andy.shevchenko@gmail.com>
diff --git a/support/testing/tests/package/sample_python_matplotlib.py b/support/testing/tests/package/sample_python_matplotlib.py
new file mode 100644
index 0000000000..beb84da680
--- /dev/null
+++ b/support/testing/tests/package/sample_python_matplotlib.py
@@ -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()
diff --git a/support/testing/tests/package/test_python_matplotlib.py b/support/testing/tests/package/test_python_matplotlib.py
new file mode 100644
index 0000000000..de07c1975b
--- /dev/null
+++ b/support/testing/tests/package/test_python_matplotlib.py
@@ -0,0 +1,48 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+# gitlab-runner: 2xlarge
+class TestPythonPy3MatplotlibQt6(TestPythonPackageBase):
+    __test__ = True
+    # The same configuration as the python-pyside6 test:
+    # - Aarch64, to have more than 256 MB of memory;
+    # - an ext4 root filesystem on a virtio disk, not a cpio initrd.
+    #   The image is big, and this saves memory.
+    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.81"
+        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_GALLIUM_DRIVER_SOFTPIPE=y
+        BR2_PACKAGE_MESA3D_OPENGL_EGL=y
+        BR2_PACKAGE_MESA3D_OPENGL_ES=y
+        BR2_PACKAGE_QT6=y
+        BR2_PACKAGE_QT6BASE_DEFAULT_QPA="offscreen"
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_MATPLOTLIB=y
+        BR2_PACKAGE_PYTHON_MATPLOTLIB_QT=y
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_4=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    sample_scripts = ["tests/package/sample_python_matplotlib.py"]
+    timeout = 60
+
+    def login(self):
+        drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M",
+                                    "-drive", f"file={drive},if=virtio,format=raw"])
+        self.emulator.login()
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package
  2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
                     ` (4 preceding siblings ...)
  2026-11-16 21:29   ` [Buildroot] [PATCH v4 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci
@ 2026-11-16 21:36   ` Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 1/5] package/python-shiboken6: " Angelo Compagnucci
                       ` (4 more replies)
  5 siblings, 5 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

Hello,

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

-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 1/5] package/python-shiboken6: new package
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
@ 2026-11-16 21:36     ` Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 2/5] package/python-pyside6: " Angelo Compagnucci
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index f3a540e9f8..42a24f0c0a 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-shiboken6/Config.in b/package/qt6/python-shiboken6/Config.in
new file mode 100644
index 0000000000..6ded490baf
--- /dev/null
+++ b/package/qt6/python-shiboken6/Config.in
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.hash b/package/qt6/python-shiboken6/python-shiboken6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.hash
@@ -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
diff --git a/package/qt6/python-shiboken6/python-shiboken6.mk b/package/qt6/python-shiboken6/python-shiboken6.mk
new file mode 100644
index 0000000000..6433678d71
--- /dev/null
+++ b/package/qt6/python-shiboken6/python-shiboken6.mk
@@ -0,0 +1,57 @@
+################################################################################
+#
+# python-shiboken6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_SHIBOKEN6_VERSION = $(QT6_VERSION)
+PYTHON_SHIBOKEN6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_SHIBOKEN6_VERSION)-src
+PYTHON_SHIBOKEN6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_SHIBOKEN6_VERSION).tar.xz
+PYTHON_SHIBOKEN6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (library, module), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (generator), \
+	BSD-3-Clause (cmake)
+PYTHON_SHIBOKEN6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_SHIBOKEN6_CPE_ID_VENDOR = qt
+PYTHON_SHIBOKEN6_CPE_ID_PRODUCT = shiboken
+PYTHON_SHIBOKEN6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_SHIBOKEN6_INSTALL_STAGING = YES
+
+# The target package builds the shiboken6 library and its Python
+# module. The host package builds the binding generator, which the
+# target package and python-pyside6 need at build time.
+PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6
+HOST_PYTHON_SHIBOKEN6_SUBDIR = sources/shiboken6_generator
+
+PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python3 \
+	qt6base
+
+PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+HOST_PYTHON_SHIBOKEN6_DEPENDENCIES = \
+	host-clang \
+	host-llvm \
+	host-python3 \
+	host-qt6base
+
+HOST_PYTHON_SHIBOKEN6_CONF_ENV = \
+	LLVM_INSTALL_DIR=$(HOST_DIR)
+
+# libxslt is only used to extract the documentation
+HOST_PYTHON_SHIBOKEN6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DCMAKE_DISABLE_FIND_PACKAGE_LibXslt=ON
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 2/5] package/python-pyside6: new package
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 1/5] package/python-shiboken6: " Angelo Compagnucci
@ 2026-11-16 21:36     ` Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/package/qt6/Config.in b/package/qt6/Config.in
index 42a24f0c0a..b6295ed295 100644
--- a/package/qt6/Config.in
+++ b/package/qt6/Config.in
@@ -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"
diff --git a/package/qt6/python-pyside6/Config.in b/package/qt6/python-pyside6/Config.in
new file mode 100644
index 0000000000..1b1a2ecc04
--- /dev/null
+++ b/package/qt6/python-pyside6/Config.in
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.hash b/package/qt6/python-pyside6/python-pyside6.hash
new file mode 100644
index 0000000000..739dc15ea9
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.hash
@@ -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
diff --git a/package/qt6/python-pyside6/python-pyside6.mk b/package/qt6/python-pyside6/python-pyside6.mk
new file mode 100644
index 0000000000..28656d8f18
--- /dev/null
+++ b/package/qt6/python-pyside6/python-pyside6.mk
@@ -0,0 +1,86 @@
+################################################################################
+#
+# python-pyside6
+#
+################################################################################
+
+# Qt for Python must have the same version as Qt6
+PYTHON_PYSIDE6_VERSION = $(QT6_VERSION)
+PYTHON_PYSIDE6_SITE = https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-$(PYTHON_PYSIDE6_VERSION)-src
+PYTHON_PYSIDE6_SOURCE = pyside-setup-everywhere-src-$(PYTHON_PYSIDE6_VERSION).tar.xz
+PYTHON_PYSIDE6_DL_SUBDIR = python-shiboken6
+PYTHON_PYSIDE6_SUBDIR = sources/pyside6
+PYTHON_PYSIDE6_LICENSE = \
+	LGPL-3.0 or GPL-2.0 or GPL-3.0 (bindings), \
+	GPL-3.0 with Qt-GPL-exception-1.0 (tools), \
+	BSD-3-Clause (examples, cmake)
+PYTHON_PYSIDE6_LICENSE_FILES = \
+	LICENSES/BSD-3-Clause.txt \
+	LICENSES/GPL-2.0-only.txt \
+	LICENSES/GPL-3.0-only.txt \
+	LICENSES/LGPL-3.0-only.txt \
+	LICENSES/Qt-GPL-exception-1.0.txt
+PYTHON_PYSIDE6_CPE_ID_VENDOR = qt
+PYTHON_PYSIDE6_CPE_ID_PRODUCT = pyside
+PYTHON_PYSIDE6_SUPPORTS_IN_SOURCE_BUILD = NO
+PYTHON_PYSIDE6_INSTALL_STAGING = YES
+
+PYTHON_PYSIDE6_DEPENDENCIES = \
+	host-python-shiboken6 \
+	python-shiboken6 \
+	qt6base
+
+# The modules are built in the order of this list, and a module needs
+# the ones before it. Keep the order of ALL_ESSENTIAL_MODULES and
+# ALL_OPTIONAL_MODULES in sources/pyside6/cmake/PySideHelpers.cmake.
+PYTHON_PYSIDE6_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) \
+	$(if $(BR2_PACKAGE_QT6BASE_DBUS),DBus) \
+	$(if $(BR2_PACKAGE_QT6BASE_XML),Xml) \
+	OpenGL \
+	OpenGLWidgets
+
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6declarative
+PYTHON_PYSIDE6_MODULES += Qml
+ifeq ($(BR2_PACKAGE_QT6DECLARATIVE_QUICK),y)
+PYTHON_PYSIDE6_MODULES += \
+	Quick \
+	QuickControls2 \
+	$(if $(BR2_PACKAGE_QT6BASE_TEST),QuickTest) \
+	QuickWidgets
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SERIALPORT),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialport
+PYTHON_PYSIDE6_MODULES += SerialPort
+ifeq ($(BR2_PACKAGE_QT6SERIALBUS),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6serialbus
+PYTHON_PYSIDE6_MODULES += SerialBus
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_QT6SVG),y)
+PYTHON_PYSIDE6_DEPENDENCIES += qt6svg
+PYTHON_PYSIDE6_MODULES += Svg SvgWidgets
+endif
+
+# The Qt headers are in the sysroot, so shiboken takes them for system
+# headers and skips them. PYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM
+# makes it process them.
+PYTHON_PYSIDE6_CONF_OPTS = \
+	-DBUILD_TESTS=OFF \
+	-DMODULES="$(subst $(space),;,$(strip $(PYTHON_PYSIDE6_MODULES)))" \
+	-DPYSIDE_TREAT_QT_INCLUDE_DIRS_AS_NON_SYSTEM=ON \
+	-DQFP_SHIBOKEN_HOST_PATH=$(HOST_DIR) \
+	-DQFP_PYTHON_HOST_PATH=$(HOST_DIR)/bin/python3
+
+$(eval $(cmake-package))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 3/5] support/testing: add python-pyside6 runtime test
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 1/5] package/python-shiboken6: " Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 2/5] package/python-pyside6: " Angelo Compagnucci
@ 2026-11-16 21:36     ` Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci
  4 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

From: Dylan Bespalko <dylan.bespalko@gmail.com>

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.

Signed-off-by: Dylan Bespalko <dylan.bespalko@gmail.com>
Co-authored-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 1d2960f9b3..14aac54303 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <andy.shevchenko@gmail.com>
 F:	package/fb-test-app/
diff --git a/support/testing/tests/package/sample_python_pyside6.py b/support/testing/tests/package/sample_python_pyside6.py
new file mode 100644
index 0000000000..f2677c6286
--- /dev/null
+++ b/support/testing/tests/package/sample_python_pyside6.py
@@ -0,0 +1,165 @@
+import os
+
+
+def qml_file(name):
+    from PySide6.QtCore import QLibraryInfo
+    qml_dir = QLibraryInfo.path(QLibraryInfo.LibraryPath.QmlImportsPath)
+    return os.path.join(qml_dir, name)
+
+
+# The essential modules: ALL_ESSENTIAL_MODULES in PySideHelpers.cmake
+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
+
+
+# The optional modules: ALL_OPTIONAL_MODULES in PySideHelpers.cmake
+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()
+    # QOpenGLWidget is not supported on this platform: only create it.
+    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(qml_file('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(qml_file('QtQuick/Controls/Universal/Label.qml'))
+    assert str(view.status()) == 'Status.Ready'
+    QtWidgets.QApplication.shutdown(app)
+
+
+def test_python_pyside6_qtserialport():
+    # The port does not need to exist: the test never opens it.
+    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()
diff --git a/support/testing/tests/package/test_python_pyside6.py b/support/testing/tests/package/test_python_pyside6.py
new file mode 100644
index 0000000000..d93be0bb26
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyside6.py
@@ -0,0 +1,63 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+# gitlab-runner: 2xlarge
+class TestPythonPy3PySide6(TestPythonPackageBase):
+    __test__ = True
+    # This test needs its own configuration:
+    # - Aarch64, to have more than 256 MB of memory;
+    # - an ext4 root filesystem on a virtio disk, not a cpio initrd.
+    #   The image is big, and this saves memory.
+    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.81"
+        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_GALLIUM_DRIVER_SOFTPIPE=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_QT6BASE_DEFAULT_QPA="offscreen"
+        BR2_PACKAGE_QT6DECLARATIVE=y
+        BR2_PACKAGE_QT6DECLARATIVE_QUICK=y
+        BR2_PACKAGE_QT6SERIALPORT=y
+        BR2_PACKAGE_QT6SERIALBUS=y
+        BR2_PACKAGE_QT6SVG=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PYSIDE6=y
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_4=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    sample_scripts = ["tests/package/sample_python_pyside6.py"]
+    timeout = 60
+
+    def login(self):
+        drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M",
+                                    "-drive", f"file={drive},if=virtio,format=raw"])
+        self.emulator.login()
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 4/5] package/python-matplotlib: add Qt6 support to the Qt display
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
                       ` (2 preceding siblings ...)
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
@ 2026-11-16 21:36     ` Angelo Compagnucci
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci
  4 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

The "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.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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(-)

diff --git a/package/python-matplotlib/Config.in b/package/python-matplotlib/Config.in
index 13894004aa..8cd931ffb0 100644
--- a/package/python-matplotlib/Config.in
+++ b/package/python-matplotlib/Config.in
@@ -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
 
diff --git a/package/python-matplotlib/python-matplotlib.mk b/package/python-matplotlib/python-matplotlib.mk
index 067bd68685..244663f719 100644
--- a/package/python-matplotlib/python-matplotlib.mk
+++ b/package/python-matplotlib/python-matplotlib.mk
@@ -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))
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v5 5/5] support/testing: add python-matplotlib runtime test
  2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
                       ` (3 preceding siblings ...)
  2026-11-16 21:36     ` [Buildroot] [PATCH v5 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
@ 2026-11-16 21:36     ` Angelo Compagnucci
  4 siblings, 0 replies; 18+ messages in thread
From: Angelo Compagnucci @ 2026-11-16 21:36 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Roy Kollen Svendsen, Dylan Bespalko,
	Angelo Compagnucci, Thomas Petazzoni

The 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.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
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

diff --git a/DEVELOPERS b/DEVELOPERS
index 14aac54303..5fb0c78b80 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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 <andy.shevchenko@gmail.com>
diff --git a/support/testing/tests/package/sample_python_matplotlib.py b/support/testing/tests/package/sample_python_matplotlib.py
new file mode 100644
index 0000000000..beb84da680
--- /dev/null
+++ b/support/testing/tests/package/sample_python_matplotlib.py
@@ -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()
diff --git a/support/testing/tests/package/test_python_matplotlib.py b/support/testing/tests/package/test_python_matplotlib.py
new file mode 100644
index 0000000000..de07c1975b
--- /dev/null
+++ b/support/testing/tests/package/test_python_matplotlib.py
@@ -0,0 +1,48 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+# gitlab-runner: 2xlarge
+class TestPythonPy3MatplotlibQt6(TestPythonPackageBase):
+    __test__ = True
+    # The same configuration as the python-pyside6 test:
+    # - Aarch64, to have more than 256 MB of memory;
+    # - an ext4 root filesystem on a virtio disk, not a cpio initrd.
+    #   The image is big, and this saves memory.
+    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.81"
+        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_GALLIUM_DRIVER_SOFTPIPE=y
+        BR2_PACKAGE_MESA3D_OPENGL_EGL=y
+        BR2_PACKAGE_MESA3D_OPENGL_ES=y
+        BR2_PACKAGE_QT6=y
+        BR2_PACKAGE_QT6BASE_DEFAULT_QPA="offscreen"
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_MATPLOTLIB=y
+        BR2_PACKAGE_PYTHON_MATPLOTLIB_QT=y
+        BR2_TARGET_ROOTFS_EXT2=y
+        BR2_TARGET_ROOTFS_EXT2_4=y
+        BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    sample_scripts = ["tests/package/sample_python_matplotlib.py"]
+    timeout = 60
+
+    def login(self):
+        drive = os.path.join(self.builddir, "images", "rootfs.ext4")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["root=/dev/vda console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M",
+                                    "-drive", f"file={drive},if=virtio,format=raw"])
+        self.emulator.login()
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-11-16 21:36 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12  8:03 [Buildroot] [PATCH v3 1/1] added package/python-{shiboken6, pyside6}: new packages Dylan Bespalko
2024-08-14  6:02 ` Dylan Bespalko
2026-11-16 15:56 ` [Buildroot] [PATCH v4 0/3] package/python-pyside6: new package Angelo Compagnucci
2026-11-16 15:56   ` [Buildroot] [PATCH v4 1/3] package/python-shiboken6: " Angelo Compagnucci
2026-11-16 15:56   ` [Buildroot] [PATCH v4 2/3] package/python-pyside6: " Angelo Compagnucci
2026-11-16 15:56   ` [Buildroot] [PATCH v4 3/3] support/testing: add python-pyside6 runtime test Angelo Compagnucci
2026-11-16 21:29 ` [Buildroot] [PATCH v4 0/5] package/python-pyside6: new package Angelo Compagnucci
2026-11-16 21:29   ` [Buildroot] [PATCH v4 1/5] package/python-shiboken6: " Angelo Compagnucci
2026-11-16 21:29   ` [Buildroot] [PATCH v4 2/5] package/python-pyside6: " Angelo Compagnucci
2026-11-16 21:29   ` [Buildroot] [PATCH v4 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
2026-11-16 21:29   ` [Buildroot] [PATCH v4 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
2026-11-16 21:29   ` [Buildroot] [PATCH v4 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci
2026-11-16 21:36   ` [Buildroot] [PATCH v5 0/5] package/python-pyside6: new package Angelo Compagnucci
2026-11-16 21:36     ` [Buildroot] [PATCH v5 1/5] package/python-shiboken6: " Angelo Compagnucci
2026-11-16 21:36     ` [Buildroot] [PATCH v5 2/5] package/python-pyside6: " Angelo Compagnucci
2026-11-16 21:36     ` [Buildroot] [PATCH v5 3/5] support/testing: add python-pyside6 runtime test Angelo Compagnucci
2026-11-16 21:36     ` [Buildroot] [PATCH v5 4/5] package/python-matplotlib: add Qt6 support to the Qt display Angelo Compagnucci
2026-11-16 21:36     ` [Buildroot] [PATCH v5 5/5] support/testing: add python-matplotlib runtime test Angelo Compagnucci

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.