Skip to contentSkip to conversation

Very initial Qt6 packaging

PATCH In review Thomas Petazzoni via buildroot 2 participants 7 messages Jul 25, 2022 – Jul 26, 2022

lore
Share & tools
lore
#0 lore raw

cover Very initial Qt6 packaging

Hello,

Here is a small patch series that introduce an initial, extremely minimal package for Qt6. Don't be excited too soon: it is so minimal that even GUI support is not included!

The goal of this series is just to get the process of Qt6 packaging started, and be able to progressively on top of this initial base rather than having one huge patch series to review.

I have taken some initial work from Peter Seiderer as a starting point for this series (for the double-conversion and libb2 packages), but for Qt6 I took a different approach than Peter in his initial series at [1]: I made the qt6base package strictly minimal for now.

The individual patches have more details, especially the patch adding qt6base itself.

Let me know if you have any question.

Thanks!

Thomas

[1] https://patchwork.ozlabs.org/project/buildroot/list/?series=229448

Peter Seiderer (2):
package/double-conversion: new package
package/libb2: new package

Thomas Petazzoni (3):
package/pcre2: add pcre2-16 to the host variant package/qt6/qt6base: new package support/misc/toolchainfile.cmake.in: add definitions needed by Qt6

 DEVELOPERS                                    |  5 ++
 package/Config.in                             |  3 +
 package/double-conversion/Config.in           | 11 +++
 .../double-conversion/double-conversion.hash  |  3 +
 .../double-conversion/double-conversion.mk    | 14 ++++
 package/libb2/Config.in                       |  6 ++
 package/libb2/libb2.hash                      |  3 +
 package/libb2/libb2.mk                        | 18 +++++
 package/pcre2/pcre2.mk                        |  3 +
 package/qt6/Config.in                         | 43 ++++++++++
 package/qt6/qt6.mk                            | 12 +++
 ...al-qsimd_p.h-fix-build-on-ARM-v7-due.patch | 49 ++++++++++++
 package/qt6/qt6base/Config.in                 | 16 ++++
 package/qt6/qt6base/qt6base.mk                | 79 +++++++++++++++++++
 support/misc/toolchainfile.cmake.in           |  9 +++
 15 files changed, 274 insertions(+)
 create mode 100644 package/double-conversion/Config.in
 create mode 100644 package/double-conversion/double-conversion.hash
 create mode 100644 package/double-conversion/double-conversion.mk
 create mode 100644 package/libb2/Config.in
 create mode 100644 package/libb2/libb2.hash
 create mode 100644 package/libb2/libb2.mk
 create mode 100644 package/qt6/Config.in
 create mode 100644 package/qt6/qt6.mk
 create mode 100644 package/qt6/qt6base/0001-src-corelib-global-qsimd_p.h-fix-build-on-ARM-v7-due.patch
 create mode 100644 package/qt6/qt6base/Config.in
 create mode 100644 package/qt6/qt6base/qt6base.mk
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/5 package/double-conversion: new package

From: Peter Seiderer <[email protected]>

Both the target and host variants of this package will be needed by qt6base.

Our reading of double-conversion/utils.h in the code base seems to show that all architectures currently supported in Buildroot (to the exception of csky, which we intend to remove, and is anyway not usable/testable today) are supported by double-conversion.

---
 DEVELOPERS                                       |  2 ++
 package/Config.in                                |  1 +
 package/double-conversion/Config.in              | 11 +++++++++++
 package/double-conversion/double-conversion.hash |  3 +++
 package/double-conversion/double-conversion.mk   | 14 ++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/double-conversion/Config.in
 create mode 100644 package/double-conversion/double-conversion.hash
 create mode 100644 package/double-conversion/double-conversion.mk
DEVELOPERS +2 -0
index 2a07ae100b..c580d3ebd8 100644
@@ -2320,6 +2320,7 @@ F:	package/bcm2835/
 F:	package/ddrescue/
 F:	package/dejavu/
 F:	package/dillo/
+F:	package/double-conversion/
 F:	package/edid-decode/
 F:	package/ell/
 F:	package/ghostscript-fonts/
@@ -2835,6 +2836,7 @@ F:	package/cloop/
 F:	package/cmake/
 F:	package/cramfs/
 F:	package/dmidecode/
+F:	package/double-conversion/
 F:	package/flashrom/
 F:	package/gcc/
 F:	package/genext2fs/
package/Config.in +1 -0
index bd3d167487..b9a17c12ba 100644
@@ -1951,6 +1951,7 @@ menu "Other"
 	source "package/cracklib/Config.in"
 	source "package/dawgdic/Config.in"
 	source "package/ding-libs/Config.in"
+	source "package/double-conversion/Config.in"
 	source "package/eigen/Config.in"
 	source "package/elfutils/Config.in"
 	source "package/ell/Config.in"
package/double-conversion/Config.in new file +11 -0
new file mode 100644
index 0000000000..b858b56c27
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_DOUBLE_CONVERSION
+	bool "double-conversion"
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Provides binary-decimal and decimal-binary routines for
+	  IEEE doubles.
+
+	  https://github.com/google/double-conversion
+
+comment "double-conversion needs a toolchain w/ C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
package/double-conversion/double-conversion.hash new file +3 -0
new file mode 100644
index 0000000000..8124ec2f82
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  3dbcdf186ad092a8b71228a5962009b5c96abde9a315257a3452eb988414ea3b  double-conversion-3.2.0.tar.gz
+sha256  4af93c12062c58058378de2397dc1c92bbff9ddfb1d583a01c84127557ce97ca  COPYING
package/double-conversion/double-conversion.mk new file +14 -0
new file mode 100644
index 0000000000..ae46fa06fe
@@ -0,0 +1,14 @@
+################################################################################
+#
+# double-conversion
+#
+################################################################################
+
+DOUBLE_CONVERSION_VERSION = 3.2.0
+DOUBLE_CONVERSION_SITE = $(call github,google,double-conversion,v$(DOUBLE_CONVERSION_VERSION))
+DOUBLE_CONVERSION_LICENSE = BSD-3-Clause
+DOUBLE_CONVERSION_LICENSE_FILES = COPYING
+DOUBLE_CONVERSION_INSTALL_STAGING = YES
+
+$(eval $(cmake-package))
+$(eval $(host-cmake-package))
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/5 package/libb2: new package

In reply to Thomas Petazzoni via buildroot

From: Peter Seiderer <[email protected]>

Both the target and host variants of this package will be needed for qt6base.

---
 DEVELOPERS               |  2 ++
 package/Config.in        |  1 +
 package/libb2/Config.in  |  6 ++++++
 package/libb2/libb2.hash |  3 +++
 package/libb2/libb2.mk   | 18 ++++++++++++++++++
 5 files changed, 30 insertions(+)
 create mode 100644 package/libb2/Config.in
 create mode 100644 package/libb2/libb2.hash
 create mode 100644 package/libb2/libb2.mk
DEVELOPERS +2 -0
index c580d3ebd8..197fb24f8e 100644
@@ -2328,6 +2328,7 @@ F:	package/gstreamer1/gst1-devtools/
 F:	package/gstreamer1/gst1-interpipe/
 F:	package/gstreamer1/gstreamer1-editing-services/
 F:	package/iwd/
+F:	package/libb2/
 F:	package/libcamera-apps/
 F:	package/libevdev/
 F:	package/libuev/
@@ -2848,6 +2849,7 @@ F:	package/hiawatha/
 F:	package/igh-ethercat/
 F:	package/intltool/
 F:	package/jh71xx-tools/
+F:	package/libb2/
 F:	package/libcap/
 F:	package/libffi/
 F:	package/libsha1/
package/Config.in +1 -0
index b9a17c12ba..ce0169a308 100644
@@ -1415,6 +1415,7 @@ menu "Crypto"
 	source "package/gnutls/Config.in"
 	source "package/libargon2/Config.in"
 	source "package/libassuan/Config.in"
+	source "package/libb2/Config.in"
 	source "package/libgcrypt/Config.in"
 	source "package/libgpg-error/Config.in"
 	source "package/libgpgme/Config.in"
package/libb2/Config.in new file +6 -0
new file mode 100644
index 0000000000..5cb462eb19
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_LIBB2
+	bool "libb2"
+	help
+	  C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp.
+
+	  https://github.com/BLAKE2/libb2
package/libb2/libb2.hash new file +3 -0
new file mode 100644
index 0000000000..6ef24a98ca
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  10053dbc2fa342516b780a6bbf6e7b2a2360b8d49c5ac426936bf3df82526732  libb2-0.98.1.tar.gz
+sha256  6a1ee543e5282cd9061881edf462e6fdab181f328da71fc2c9a6950a80e94d01  COPYING
package/libb2/libb2.mk new file +18 -0
new file mode 100644
index 0000000000..29df233ad2
@@ -0,0 +1,18 @@
+################################################################################
+#
+# libb2
+#
+################################################################################
+
+LIBB2_VERSION = 0.98.1
+LIBB2_SITE = $(call github,BLAKE2,libb2,v$(LIBB2_VERSION))
+LIBB2_LICENSE =  CC0-1.0
+LIBB2_LICENSE_FILES = COPYING
+LIBB2_INSTALL_STAGING = YES
+LIBB2_AUTORECONF = YES
+LIBB2_DEPENDENCIES = host-pkgconf
+LIBB2_CONF_OPTS = --disable-fat --disable-native
+HOST_LIBB2_CONF_OPTS = --disable-fat --enable-native
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH 3/5 package/pcre2: add pcre2-16 to the host variant

In reply to Thomas Petazzoni via buildroot

This will be needed by qt6base, and it is not worth creating a hidden host package option for this.

---
 package/pcre2/pcre2.mk | 3 +++
 1 file changed, 3 insertions(+)
package/pcre2/pcre2.mk +3 -0
index 043f6d866f..06a0afc9b8 100644
@@ -28,5 +28,8 @@ ifeq ($(BR2_USE_MMU),)
 PCRE2_CONF_OPTS += --disable-pcre2grep-callout
 endif
 
+# needed for qt6base
+HOST_PCRE2_CONF_OPTS = --enable-pcre2-16
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

PATCH 4/5 package/qt6/qt6base: new package

In reply to Thomas Petazzoni via buildroot

This commit proposes a very minimal package for qt6base. It only supports building QtCore, so it *really* is minimal. But that's a starting point, on top of which we can progressively build on top. It was based on initial work from Peter Seiderer.

This minimal QtCore build is however sufficient to build and run simple non-graphical Qt applications.

A number of comments:

- Even though there's only qt6base for now, many other qt6 modules will come later on, which is why we're using the same structure as for qt5, with a subdir for package/qt6/

- Qt6 is mutually exclusive with Qt5. Even though the library names on the target and the location of the header files are distinct, the host tools (qmake, moc and al.) have the same name, so at least for now, we make them mutually exclusive.

- We've chosen to use non-bundled libraries for zlib, bb2, double-conversion and pcre2, for both the target and the host qt6base packages.

- Contrary to qt5 where the target package was building the host tools, now we have a host qt6base package building the host tools, and which is needed as a dependency for the target qt6base package.

- qt6base is using CMake. However, it strongly recommends to use Ninja as a backend instead of make, a recommandation that we follow in this commit. Since we don't have support for Ninja in the cmake-package infrastructure (yet), we do this manually in qt6base.mk itself, by passing -Gninja to CMake at configure time, and then by using CMake --build at build time and CMake --install at install time, using explicitly provided build and install commands. Hopefully these can go away once we have support for Ninja directly in cmake-package.

- We disable a number of features or external libraries using FEATURE options. However, because there are over 400 FEATURE options in qt6base, we did go all the way to explicitly disabling *all* of them (which would be needed for both the host and target packages). We expect that this list of explicit FEATURE options disabling will need to grow based on the feedback of users and issues encountered.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/qt6/Config.in                         | 43 ++++++++++
 package/qt6/qt6.mk                            | 12 +++
 ...al-qsimd_p.h-fix-build-on-ARM-v7-due.patch | 49 ++++++++++++
 package/qt6/qt6base/Config.in                 | 16 ++++
 package/qt6/qt6base/qt6base.mk                | 79 +++++++++++++++++++
 7 files changed, 201 insertions(+)
 create mode 100644 package/qt6/Config.in
 create mode 100644 package/qt6/qt6.mk
 create mode 100644 package/qt6/qt6base/0001-src-corelib-global-qsimd_p.h-fix-build-on-ARM-v7-due.patch
 create mode 100644 package/qt6/qt6base/Config.in
 create mode 100644 package/qt6/qt6base/qt6base.mk
DEVELOPERS +1 -0
index 197fb24f8e..1a83b0794f 100644
@@ -2874,6 +2874,7 @@ F:	package/python-git/
 F:	package/python-serial/
 F:	package/python-unittest-xml-reporting/
 F:	package/qextserialport/
+F:	package/qt6/
 F:	package/riscv64-elf-toolchain/
 F:	package/rpcbind/
 F:	package/rt-tests/
package/Config.in +1 -0
index ce0169a308..c365f5454e 100644
@@ -362,6 +362,7 @@ comment "Graphic libraries"
 
 comment "Other GUIs"
 	source "package/qt5/Config.in"
+	source "package/qt6/Config.in"
 if BR2_PACKAGE_QT5
 comment "QT libraries and helper libraries"
 	source "package/cutelyst/Config.in"
package/qt6/Config.in new file +43 -0

43 lines not on this page · raw message

package/qt6/qt6.mk new file +12 -0
new file mode 100644
index 0000000000..03e87d0574
@@ -0,0 +1,12 @@
+################################################################################
+#
+# qt6
+#
+################################################################################
+
+QT6_VERSION_MAJOR = 6.3
+QT6_VERSION = $(QT6_VERSION_MAJOR).1
+QT6_SOURCE_TARBALL_PREFIX = everywhere-src
+QT6_SITE = https://download.qt.io/archive/qt/$(QT6_VERSION_MAJOR)/$(QT6_VERSION)/submodules
+
+include $(sort $(wildcard package/qt6/*/*.mk))
package/qt6/qt6base/0001-src-corelib-global-qsimd_p.h-fix-build-on-ARM-v7-due.patch new file +49 -0

49 lines not on this page · raw message

package/qt6/qt6base/Config.in new file +16 -0
new file mode 100644
index 0000000000..a489ce39fc
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_QT6BASE
+	bool "qt6base"
+	select BR2_PACKAGE_DOUBLE_CONVERSION
+	select BR2_PACKAGE_LIBB2
+	select BR2_PACKAGE_PCRE2
+	select BR2_PACKAGE_PCRE2_16
+	select BR2_PACKAGE_ZLIB
+	help
+	  Qt is a cross-platform application and UI framework for
+	  developers using C++.
+
+	  This package corresponds to the qt6base module, which
+	  contains the base Qt libraries: QtCore, QtNetwork, QtGui,
+	  QtWidgets, etc.
+
+	  http://qt.io
package/qt6/qt6base/qt6base.mk new file +79 -0

79 lines not on this page · raw message

Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

PATCH 5/5 support/misc/toolchainfile.cmake.in: add definitions needed by Qt6

In reply to Thomas Petazzoni via buildroot

When compiling Qt6 applications for the target, CMake needs to have two variables defined to find the host installation of Qt. These two variables are unconditionally defined, regardless of whether Qt6 is enabled in the configuration or not, as they do no harm when Qt6 is not present/used.

---
 support/misc/toolchainfile.cmake.in | 9 +++++++++
 1 file changed, 9 insertions(+)
support/misc/toolchainfile.cmake.in +9 -0
index 30c0e63bf2..5d2b8695b4 100644
@@ -125,3 +125,12 @@ if(@@TOOLCHAIN_HAS_FORTRAN@@)
     set(CMAKE_Fortran_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_FC@@")
   endif()
 endif()
+
+# For Qt6
+if(NOT DEFINED QT_HOST_PATH)
+  set(QT_HOST_PATH "${RELOCATED_HOST_DIR}")
+endif()
+
+if(NOT DEFINED QT_HOST_PATH_CMAKE_DIR)
+  set(QT_HOST_PATH_CMAKE_DIR "${RELOCATED_HOST_DIR}/lib/cmake")
+endif()
Signature · 6 lines
2.37.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#6 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 26 lines · Thomas Petazzoni

Hello,

Here is a small patch series that introduce an initial, extremely minimal package for Qt6. Don't be excited too soon: it is so minimal that even GUI support is not included!

The goal of this series is just to get the process of Qt6 packaging started, and be able to progressively on top of this initial base rather than having one huge patch series to review.

I have taken some initial work from Peter Seiderer as a starting point for this series (for the double-conversion and libb2 packages), but for Qt6 I took a different approach than Peter in his initial series at [1]: I made the qt6base package strictly minimal for now.

The individual patches have more details, especially the patch adding qt6base itself.

Let me know if you have any question.

Thanks!

Thomas

[1] https://patchwork.ozlabs.org/project/buildroot/list/?series=229448

Quoted 8 lines

Peter Seiderer (2):
package/double-conversion: new package
package/libb2: new package

Thomas Petazzoni (3):
package/pcre2: add pcre2-16 to the host variant package/qt6/qt6base: new package support/misc/toolchainfile.cmake.in: add definitions needed by Qt6

Series applied to master. Thanks for this work!

Regards,
Arnout

Quoted 17 lines
  DEVELOPERS                                    |  5 ++
  package/Config.in                             |  3 +
  package/double-conversion/Config.in           | 11 +++
  .../double-conversion/double-conversion.hash  |  3 +
  .../double-conversion/double-conversion.mk    | 14 ++++
  package/libb2/Config.in                       |  6 ++
  package/libb2/libb2.hash                      |  3 +
  package/libb2/libb2.mk                        | 18 +++++
  package/pcre2/pcre2.mk                        |  3 +
  package/qt6/Config.in                         | 43 ++++++++++
  package/qt6/qt6.mk                            | 12 +++
  ...al-qsimd_p.h-fix-build-on-ARM-v7-due.patch | 49 ++++++++++++
  package/qt6/qt6base/Config.in                 | 16 ++++
  package/qt6/qt6base/qt6base.mk                | 79 +++++++++++++++++++
  support/misc/toolchainfile.cmake.in           |  9 +++
  15 files changed, 274 insertions(+)
Quoted 12 lines

create mode 100644 package/double-conversion/Config.in
create mode 100644 package/double-conversion/double-conversion.hash
create mode 100644 package/double-conversion/double-conversion.mk
create mode 100644 package/libb2/Config.in
create mode 100644 package/libb2/libb2.hash
create mode 100644 package/libb2/libb2.mk
create mode 100644 package/qt6/Config.in
create mode 100644 package/qt6/qt6.mk
create mode 100644 package/qt6/qt6base/0001-src-corelib-global-qsimd_p.h-fix-build-on-ARM-v7-due.patch create mode 100644 package/qt6/qt6base/Config.in
create mode 100644 package/qt6/qt6base/qt6base.mk

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot