Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: buildroot@buildroot.org
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Roy Kollen Svendsen <roykollensvendsen@gmail.com>,
	Dylan Bespalko <dylan.bespalko@gmail.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v5 4/5] package/python-matplotlib: add Qt6 support to the Qt display
Date: Mon, 16 Nov 2026 22:36:11 +0100	[thread overview]
Message-ID: <20261116213612.873856-5-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <20261116213612.873856-1-angelo.compagnucci@gmail.com>

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

  parent reply	other threads:[~2026-11-16 21:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Angelo Compagnucci [this message]
2026-11-16 21:36     ` [Buildroot] [PATCH v5 5/5] support/testing: add python-matplotlib " Angelo Compagnucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116213612.873856-5-angelo.compagnucci@gmail.com \
    --to=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=dylan.bespalko@gmail.com \
    --cc=james.hilliard1@gmail.com \
    --cc=roykollensvendsen@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox