From 68f5f854cc4f89b5dcb3ad73595b0d3931e915e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20P=C3=B6tzsch?= Date: Fri, 5 Dec 2025 21:24:53 +0100 Subject: [PATCH 1/3] libs:qt6: improvements - Add host config build & share this between the base lib & the tools build - some tools have dependencies on other Qt libs than Qt6 base - to be able to build such tools, we need to build a Qt6 base in the host configuration first, build than the lib and after that the tool itself - add more paths to some of the qt6Package... functions & make it possible to add more when calling those functions - be more specific when installing files in the various steps --- classes/qt6-base.yaml | 13 +-- classes/qt6-tools.yaml | 23 +++-- recipes/libs/qt6-base.yaml | 207 ++++++++++++++++++++----------------- 3 files changed, 139 insertions(+), 104 deletions(-) diff --git a/classes/qt6-base.yaml b/classes/qt6-base.yaml index 6351dbe8..9e5fe9e6 100644 --- a/classes/qt6-base.yaml +++ b/classes/qt6-base.yaml @@ -46,20 +46,21 @@ buildSetup: | packageSetup: | qt6PackageDev() { - cmakePackageDev "${1:-}" "/usr/plugins/***" "/usr/qml/***" \ - "/usr/mkspecs/***" "/usr/metatypes/***" + cmakePackageDev "${1:-}" "${@:2}" "/usr/plugins/***" "/usr/qml/***" \ + "/usr/mkspecs/***" "/usr/metatypes/***" \ + "/usr/lib/objects-Bob/***" } qt6PackageLib() { - cmakePackageLib "${1:-}" "/usr/plugins/***" "/usr/qml/***" + cmakePackageLib "${1:-}" "${@:2}" "/usr/plugins/***" "/usr/qml/***" } qt6PackageBin() { - cmakePackageBin "${1:-}" "!/usr/doc" "!/usr/mkspecs" \ - "!/usr/metatypes" "!/usr/modules" \ - "!*objects-Bob*" "!*.prl" + cmakePackageBin "${1:-}" "${@:2}" "!/usr/doc" "!/usr/mkspecs" \ + "!/usr/metatypes" "!/usr/modules" \ + "!*objects-Bob*" "!*.prl" } qt6PackageTgt() diff --git a/classes/qt6-tools.yaml b/classes/qt6-tools.yaml index a72886b0..e390abaa 100644 --- a/classes/qt6-tools.yaml +++ b/classes/qt6-tools.yaml @@ -1,16 +1,27 @@ inherit: [qt6-base] +environment: + # for the tools always use the host Qt6 configuration + QT6_BASE_HOST_BUILD: '1' + depends: + # all tools need at least qt6 core + the core tools + - libs::qt6-base-dev + + - use: [] + depends: + - libs::qt6-base-tgt + # depend on the host tools build - name: libs::qt6-base-tools - tools: - target-toolchain: host-native-toolchain use: [tools] buildTools: [qt6-base-tools] packageScript: | - # We have to package everything for the tools, including cmake - # configs, ... files. - cmakePackageDev - cmakePackageBin + qt6PackageBin + # We have to supply more than just the bins: + # 1. The tools itself are found by Qt with the corresponding cmake + # files. + # 2. Some tools provide libs other tools may want to link against. + installCopy "${_CMAKE_BUILD_PATH}/install/" "/usr/" "/usr/lib/***" "!*" diff --git a/recipes/libs/qt6-base.yaml b/recipes/libs/qt6-base.yaml index 15fc8506..33b8e7fb 100644 --- a/recipes/libs/qt6-base.yaml +++ b/recipes/libs/qt6-base.yaml @@ -6,6 +6,61 @@ metaEnvironment: GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception (tools), GFDL-1.3 (docs), Apache-2.0, BSD-3-Clause, BSL-1.0, MIT +Config: + QT6_BASE_HOST_BUILD: + type: bool + default: False + help: "Host tools build with reduced dependencies" + +privateEnvironment: + HOST_CONF: >- + -DFEATURE_network=ON + -DFEATURE_xml=ON + -DFEATURE_gui=ON + -DFEATURE_concurrent=ON + -DFEATURE_freetype=OFF + -DFEATURE_vulkan=OFF + -DFEATURE_linuxfb=OFF + -DFEATURE_xcb=OFF + -DFEATURE_opengl=OFF -DINPUT_opengl=no + -DFEATURE_harfbuzz=OFF + -DFEATURE_png=OFF + -DFEATURE_gif=OFF + -DFEATURE_jpeg=OFF + -DFEATURE_printsupport=OFF + -DFEATURE_kms=OFF + -DFEATURE_fontconfig=OFF + -DFEATURE_widgets=OFF + -DFEATURE_libinput=OFF + -DFEATURE_tslib=OFF + -DFEATURE_eglfs=OFF + -DFEATURE_sql=OFF + -DFEATURE_testlib=OFF + -DFEATURE_dbus=OFF + -DFEATURE_icu=OFF + -DFEATURE_glib=OFF + -DFEATURE_force_bundled_libs=ON + DEFAULT_CONF: >- + -DFEATURE_opengl=ON + -DFEATURE_opengles2=ON + -DFEATURE_opengl_desktop=OFF + -DFEATURE_gui=ON + -DFEATURE_kms=ON + -DFEATURE_libinput=ON + -DFEATURE_freetype=ON + -DFEATURE_xml=ON + -DFEATURE_network=ON + -DFEATURE_concurrent=ON + -DFEATURE_printsupport=OFF + -DFEATURE_directfb=OFF + -DFEATURE_vnc=OFF + -DFEATURE_sql=OFF + -DFEATURE_testlib=OFF + -DFEATURE_dbus=OFF + -DFEATURE_icu=OFF + -DFEATURE_force_system_libs=ON + -DQT_QPA_DEFAULT_PLATFORM=eglfs + checkoutSCM: scm: url url: ${QT6_MIRROR}/qtbase-everywhere-src-${PKG_VERSION}.tar.xz @@ -15,39 +70,44 @@ checkoutSCM: multiPackage: "": depends: - - libs::zlib-dev - - libs::pcre2-dev - - libs::libb2-dev - - libs::glib-dev - - libs::libpng-dev - - virtual::libs::libjpeg-dev - - libs::freetype-dev - - libs::fontconfig-dev - - libs::harfbuzz-dev - - libs::double-conversion-dev - - libs::openssl-dev - - virtual::libs::libdrm-dev - - virtual::libs::libegl-dev - - virtual::libs::libgles-dev - - - use: [] + - if: !expr > + !"${QT6_BASE_HOST_BUILD}" depends: - - libs::libc-openmp-tgt - - libs::libc-stdc++-tgt - - libs::zlib-tgt - - libs::pcre2-tgt - - libs::libb2-tgt - - libs::glib-tgt - - libs::libpng-tgt - - virtual::libs::libjpeg-tgt - - libs::freetype-tgt - - libs::fontconfig-tgt - - libs::harfbuzz-tgt - - libs::double-conversion-tgt - - libs::openssl-tgt - - virtual::libs::libdrm-tgt - - virtual::libs::libegl-tgt - - virtual::libs::libgles-tgt + - libs::zlib-dev + - libs::pcre2-dev + - libs::libb2-dev + - libs::glib-dev + - libs::libinput-dev + - libs::libpng-dev + - virtual::libs::libjpeg-dev + - libs::freetype-dev + - libs::fontconfig-dev + - libs::harfbuzz-dev + - libs::double-conversion-dev + - libs::openssl-dev + - virtual::libs::libdrm-dev + - virtual::libs::libegl-dev + - virtual::libs::libgles-dev + + - use: [] + depends: + - libs::libc-openmp-tgt + - libs::libc-stdc++-tgt + - libs::zlib-tgt + - libs::pcre2-tgt + - libs::libb2-tgt + - libs::glib-tgt + - libs::libinput-tgt + - libs::libpng-tgt + - virtual::libs::libjpeg-tgt + - libs::freetype-tgt + - libs::fontconfig-tgt + - libs::harfbuzz-tgt + - libs::double-conversion-tgt + - libs::openssl-tgt + - virtual::libs::libdrm-tgt + - virtual::libs::libegl-tgt + - virtual::libs::libgles-tgt # depend on our self for the host tools build - name: libs::qt6-base-tools @@ -56,83 +116,46 @@ multiPackage: use: [tools] buildTools: [qt6-base-tools] + buildVars: [QT6_BASE_HOST_BUILD, HOST_CONF, DEFAULT_CONF] buildScript: | - qt6Build $1 \ - -DQT_HOST_PATH=${BOB_TOOL_PATHS[qt6-base-tools]}/.. \ - -DFEATURE_opengl=ON \ - -DFEATURE_opengles2=ON \ - -DFEATURE_opengl_desktop=OFF \ - -DFEATURE_gui=ON \ - -DFEATURE_kms=ON \ - -DFEATURE_xml=ON \ - -DFEATURE_network=ON \ - -DFEATURE_concurrent=ON \ - -DFEATURE_directfb=OFF \ - -DFEATURE_vnc=OFF \ - -DFEATURE_sql=OFF \ - -DFEATURE_testlib=OFF \ - -DFEATURE_dbus=OFF \ - -DFEATURE_icu=OFF \ - -DFEATURE_force_system_libs=ON \ - -DQT_QPA_DEFAULT_PLATFORM=eglfs + if [[ ${QT6_BASE_HOST_BUILD} -eq 1 ]] ; then + qt6Build $1 \ + ${HOST_CONF} + else + qt6Build $1 \ + -DQT_HOST_PATH=${BOB_TOOL_PATHS[qt6-base-tools]}/.. \ + ${DEFAULT_CONF} + fi multiPackage: - # We are not supporting building Qt6 apps on the target right now. - # The Qt6 tools build here seem to refer build paths which do not - # exist on the target. Needs investigation if required later. - # "": - # depends: - # - name: libs::qt6-base-tgt - # use: [] - # packageScript: qt6PackageBin - # provideDeps: [ "*-tgt" ] - dev: - packageScript: qt6PackageDev + packageScript: | + qt6PackageDev + # we also need to install the bins even if they are not + # used; Qt's cmake files to refer to them and the build + # fails if they are missing + qt6PackageBin provideDeps: [ "*-dev" ] tgt: - packageScript: qt6PackageLib + packageScript: | + qt6PackageLib provideDeps: [ "*-tgt" ] tools: + buildVars: [HOST_CONF] buildScript: | # Unfortunately have we to turn on a lot of stuff (even GUI!) for # the host build. Lots of depending host tools from other Qt # packages are written in Qt and depend on this. qt6Build $1 \ - -DFEATURE_network=ON \ - -DFEATURE_xml=ON \ - -DFEATURE_gui=ON \ - -DFEATURE_freetype=OFF \ - -DFEATURE_vulkan=OFF \ - -DFEATURE_linuxfb=ON \ - -DFEATURE_xcb=OFF \ - -DFEATURE_opengl=OFF -DINPUT_opengl=no \ - -DFEATURE_harfbuzz=OFF \ - -DFEATURE_png=OFF \ - -DFEATURE_gif=OFF \ - -DFEATURE_jpeg=OFF \ - -DFEATURE_printsupport=OFF \ - -DFEATURE_kms=OFF \ - -DFEATURE_fontconfig=OFF \ - -DFEATURE_widgets=OFF \ - -DFEATURE_libinput=OFF \ - -DFEATURE_tslib=OFF \ - -DFEATURE_eglfs=OFF \ - -DFEATURE_concurrent=OFF \ - -DFEATURE_sql=OFF \ - -DFEATURE_testlib=OFF \ - -DFEATURE_dbus=OFF \ - -DFEATURE_icu=OFF \ - -DFEATURE_glib=OFF \ - -DFEATURE_force_bundled_libs=ON + ${HOST_CONF} packageScript: | - # We have to package everything for the tools, including cmake - # configs, ... files. - cmakePackageDev - cmakePackageBin + # We have to supply more than just the bins: + # 1. The tools itself are found by Qt with the corresponding cmake + # files + qt6PackageBin "" "/usr/lib/cmake/***" provideTools: qt6-base-tools: "usr/bin" From 4bbde85a39a994fcbda1c461e8e092b1b236bfed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20P=C3=B6tzsch?= Date: Fri, 5 Dec 2025 21:32:32 +0100 Subject: [PATCH 2/3] libs::qt6-declarative: add libs::qt6-svg dependency Add support for loading/processing svg files in QtQuick. Therefore, libs::qt6-svg as dependency is required. --- recipes/libs/qt6-declarative.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/recipes/libs/qt6-declarative.yaml b/recipes/libs/qt6-declarative.yaml index 16079bf1..aae29e43 100644 --- a/recipes/libs/qt6-declarative.yaml +++ b/recipes/libs/qt6-declarative.yaml @@ -21,10 +21,12 @@ multiPackage: inherit: [qt6] depends: - libs::qt6-shadertools-dev + - libs::qt6-svg-dev - use: [] depends: - libs::qt6-shadertools-tgt + - libs::qt6-svg-tgt # depend on our self for the host tools build - tools: @@ -35,21 +37,11 @@ multiPackage: - libs::qt6-declarative-tools buildToolsWeak: [python3] - buildTools: [qt6-declarative-tools, qt6-shadertools-tools] + buildTools: [qt6-shadertools-tools, qt6-declarative-tools] buildScript: | qt6Build $1 multiPackage: - # We are not supporting building Qt6 apps on the target right now. - # The Qt6 tools build here seem to refer build paths which do not - # exist on the target. Needs investigation if required later. - # "": - # depends: - # - name: libs::qt6-declarative-tgt - # use: [] - # packageScript: qt6PackageBin - # provideDeps: [ "*-tgt" ] - dev: packageScript: qt6PackageDev provideDeps: [ "*-dev" ] @@ -61,6 +53,12 @@ multiPackage: tools: inherit: [qt6-tools] depends: + - libs::qt6-svg-dev + + - use: [] + depends: + - libs::qt6-svg-tgt + - name: libs::qt6-shadertools-tools use: [tools] From 4f4a8d97e75540fc26bcfe2eea52c2f565c01967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20P=C3=B6tzsch?= Date: Fri, 5 Dec 2025 23:43:18 +0100 Subject: [PATCH 3/3] libs::qt6-shadertools: remove unrelated options There are no options for wayland in shadertools. Remove them. --- recipes/libs/qt6-shadertools.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/libs/qt6-shadertools.yaml b/recipes/libs/qt6-shadertools.yaml index b083ddd2..5ec69004 100644 --- a/recipes/libs/qt6-shadertools.yaml +++ b/recipes/libs/qt6-shadertools.yaml @@ -37,9 +37,7 @@ multiPackage: inherit: [qt6-tools] buildScript: | # tools only version usually used for building - qt6Build $1 \ - -DFEATURE_wayland_client=OFF \ - -DFEATURE_wayland_server=OFF + qt6Build $1 provideTools: qt6-shadertools-tools: "usr/bin"