Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: buildroot@buildroot.org
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Andrea Ricchi <andrea.ricchi@amarulasolutions.com>,
	Roy Kollen Svendsen <roykollensvendsen@gmail.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Jesse Van Gavere <jesseevg@gmail.com>,
	richard.genoud@bootlin.com
Subject: [Buildroot] [PATCH v5 4/6] package/pkg-qmake: support Qt6
Date: Tue,  8 Sep 2026 16:12:51 +0200	[thread overview]
Message-ID: <20260908141253.1556634-5-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20260908141253.1556634-1-dario.binacchi@amarulasolutions.com>

The qmake infrastructure hardcodes qt5base as the Qt provider. Select
the Qt major version from BR2_PACKAGE_QT5, which is mutually exclusive
with BR2_PACKAGE_QT6, and use it to pick the qt<N>base dependency, the
QT<N>_QMAKE command and the QT<N>_QT_CONF_FIXUP hook.

The header sync hook now takes the version from QT<N>_VERSION_MAJOR and
QT<N>_VERSION instead of hardcoding 5.15.

Document in the manual which Qt base package is added to the dependencies.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

Changes v4 -> v5:
  - Drop the hardcoded Qt versions, only select the major version from
    BR2_PACKAGE_QT5
  - Take the version for the header sync hook from QT<N>_VERSION_MAJOR
    and QT<N>_VERSION
  - Document in the manual which Qt base package is added to the
    dependencies
  - Update the commit message

 docs/manual/adding-packages-qmake.adoc |  4 ++++
 package/pkg-qmake.mk                   | 18 +++++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/docs/manual/adding-packages-qmake.adoc b/docs/manual/adding-packages-qmake.adoc
index e09da166b909..1d97556abe79 100644
--- a/docs/manual/adding-packages-qmake.adoc
+++ b/docs/manual/adding-packages-qmake.adoc
@@ -55,6 +55,10 @@ All the package metadata information variables that exist in the
 xref:generic-package-reference[generic package infrastructure] also
 exist in the QMake infrastructure.
 
+The Qt base package the package is built against, +qt5base+ or
++qt6base+, is automatically added to its dependencies, depending on
+whether +BR2_PACKAGE_QT5+ or +BR2_PACKAGE_QT6+ is enabled.
+
 A few additional variables, specific to the QMake infrastructure, can
 also be defined.
 
diff --git a/package/pkg-qmake.mk b/package/pkg-qmake.mk
index ccf78692e885..7f73c3087b5f 100644
--- a/package/pkg-qmake.mk
+++ b/package/pkg-qmake.mk
@@ -20,11 +20,19 @@
 #
 ################################################################################
 
+# Qt5 and Qt6 are mutually exclusive
+ifeq ($(BR2_PACKAGE_QT5),y)
+QT_VERSION_MAJOR = 5
+else
+QT_VERSION_MAJOR = 6
+endif
+QT_BASE = qt$(QT_VERSION_MAJOR)base
+
 #
 # Hook to sync Qt headers
 #
 define QT_HEADERS_SYNC_HOOK
-	sed -e '/^MODULE_VERSION/s/5\.15\.[3456789]/$(QT5_VERSION)/' -i \
+	sed -e '/^MODULE_VERSION/s/$(subst .,\.,$(QT$(QT_VERSION_MAJOR)_VERSION_MAJOR))\.[0-9]*/$(QT$(QT_VERSION_MAJOR)_VERSION)/' -i \
 		$($(PKG)_BUILDDIR)/.qmake.conf
 	touch $($(PKG)_BUILDDIR)/.git
 endef
@@ -45,15 +53,15 @@ define inner-qmake-package
 $(2)_INSTALL_STAGING_OPTS	?= install
 $(2)_INSTALL_TARGET_OPTS	?= $$($(2)_INSTALL_STAGING_OPTS)
 
-ifneq ($(1),qt5base)
-$(2)_DEPENDENCIES 		+= qt5base
+ifneq ($(1),$(QT_BASE))
+$(2)_DEPENDENCIES 		+= $(QT_BASE)
 endif
 
 ifeq ($$($(2)_SYNC_QT_HEADERS),YES)
 $(2)_PRE_CONFIGURE_HOOKS        += QT_HEADERS_SYNC_HOOK
 endif
 
-$(2)_POST_PREPARE_HOOKS += QT5_QT_CONF_FIXUP
+$(2)_POST_PREPARE_HOOKS += QT$(QT_VERSION_MAJOR)_QT_CONF_FIXUP
 
 #
 # Configure step. Only define it if not already defined by the package
@@ -62,7 +70,7 @@ $(2)_POST_PREPARE_HOOKS += QT5_QT_CONF_FIXUP
 ifndef $(2)_CONFIGURE_CMDS
 define $(2)_CONFIGURE_CMDS
 	cd $$($(2)_BUILDDIR) && \
-	$$(TARGET_MAKE_ENV) $$($(2)_CONF_ENV) $$(QT5_QMAKE) $$($(2)_CONF_OPTS)
+	$$(TARGET_MAKE_ENV) $$($(2)_CONF_ENV) $$(QT$(QT_VERSION_MAJOR)_QMAKE) $$($(2)_CONF_OPTS)
 endef
 endif
 
-- 
2.43.0

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

  parent reply	other threads:[~2026-09-08 14:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 14:12 [Buildroot] [PATCH v5 0/6] Support qmake for Qt6 Dario Binacchi
2026-09-08 14:12 ` [Buildroot] [PATCH v5 1/6] package/qt6: Add qmake functionality Dario Binacchi
2026-09-08 14:12 ` [Buildroot] [PATCH v5 2/6] package/qt6: add QT6_QT_CONF_FIXUP hook Dario Binacchi
2026-09-08 14:12 ` [Buildroot] [PATCH v5 3/6] package/qwt: bump to version 6.3.0 Dario Binacchi
2026-09-08 14:12 ` Dario Binacchi [this message]
2026-09-08 14:12 ` [Buildroot] [PATCH v5 5/6] package/qwt: enable build with Qt6 Dario Binacchi
2026-09-08 14:12 ` [Buildroot] [PATCH v5 6/6] package/cutekeyboard: " Dario Binacchi
2026-09-10  9:52   ` Andrea Ricchi

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=20260908141253.1556634-5-dario.binacchi@amarulasolutions.com \
    --to=dario.binacchi@amarulasolutions.com \
    --cc=andrea.ricchi@amarulasolutions.com \
    --cc=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=jesseevg@gmail.com \
    --cc=richard.genoud@bootlin.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