Skip to contentSkip to conversation

add initial support for libcamera's qcam

RFC PATCH Superseded Quentin Schulz 2 participants 6 messages Apr 8, 2025 – May 16, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover add initial support for libcamera's qcam

This adds initial support for qcam example GUI from libcamera. It is based on Qt6 and uses openGL.

Sadly, the qt module from meson is currently broken (see first patch in the series) and requires patching. Upstream isn't really happy with what I suggested but I haven't understood what they don't like about it so cannot currently suggest anything better, hence the RFC.

While qcam currently renders the camera liveview, all characters of the GUI are squares. I have enabled fontconfig and UTF-8 locales but after building everything (though I dircleaned qt6base once), so not entirely sure what's missing or if it's PEBKAC, hence the RFC. Though that may be acceptable? Do not know. Would appreciate pointers on how to debug this (assumed) font issue.

I'm not planning on actively working on this as the only product we have that could use this is currently stuck on qt5 so cannot use new qcam and it would anyway only be for debug firmware releases. See this as a code dump essentially. If there are hints or limited work required to have this merged, I'll happily try to find time doing it but feel free to take over the series or disregard it entirely.

This is based on top of
https://lore.kernel.org/buildroot/[email protected]/T/#t

---
Quentin Schulz (2):
package/meson: look for qt6 tools on Buildroot host machine package/libcamera: initial support for Qt6 qcam

 package/libcamera/libcamera.mk                     |  5 ++
 ...e-look-for-qt-tools-only-on-build-machine.patch | 56 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)

---
base-commit: 43abcd4c7dd8ad65d2f2012f3d4292362550a3ed
change-id: 20250404-libcamera-qcam-e8269c47e2f9
prerequisite-change-id: 20250404-libcamera-0-5-0-b9ecf899ddb4:v1
prerequisite-patch-id: 854e58d76fc57aa774ca0d315ecae56b67c00c8a
prerequisite-patch-id: 4873ac99203f0d789d64aec048249d9ba6a15a82
prerequisite-patch-id: c4d504c6563a911ba550be263063cfd7bf04bcbe
prerequisite-patch-id: 4a74788db759d3b67650f1456ee4d64f9394f50a
prerequisite-patch-id: 73a4b5a3204b1a901da74a3ffe1672055404dd2f
prerequisite-patch-id: 90b567b9a37abb58747d965ea2e0fef41358844b
prerequisite-patch-id: 946aac34b70f001c24fc6fe86caab759a4591359
prerequisite-patch-id: cee428a4219c83704347f6f194694f21093034da
prerequisite-patch-id: 6bbbdc80dc639a1b2918d79ae101e1030f3312bd

Best regards,

Signature · 6 lines
Quentin Schulz <[email protected]>

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

RFC PATCH 1/2 package/meson: look for qt6 tools on Buildroot host machine

From: Quentin Schulz <[email protected]>

Qt tools that are looked by the meson qt module are only required as a build time dependency, to be run on the Buildroot host machine.

Therefore, meson should be looking for them on the host machine and not on the Buildroot target.

This fixes Buildroot meson not being able to find the qt6 tools whenever necessary (e.g. for libcamera qcam, whose support is added in a later commit).

---
 ...e-look-for-qt-tools-only-on-build-machine.patch | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
package/meson/0001-qt-module-look-for-qt-tools-only-on-build-machine.patch new file +56 -0
new file mode 100644
index 0000000000000000000000000000000000000000..c00ae0dbc3c63296afdc8a3d245091ee8337ddd8
@@ -0,0 +1,56 @@
+From b42daeeb3396df1a02c95d2f583058a74e7854e3 Mon Sep 17 00:00:00 2001
+From: Quentin Schulz <[email protected]>
+Date: Tue, 18 Mar 2025 15:07:53 +0100
+Subject: [PATCH] qt module: look for qt tools only on build machine
+
+Qt tools may be needed at build time, let's make their detection based
+on the build machine rather than the host machine as currently done.
+
+This incidentally fixes cross-compilation search for moc, rcc, uic and
+lrelease Qt tools because they are installed in libexec dir and that
+path is somehow not properly looked for otherwise.
+
+Before:
+
+"""
+Detecting Qt6 tools
+Run-time dependency qt6 (modules: Core) found: YES 6.8.1 (pkg-config)
+Program /usr/bin/moc found: NO
+Program /usr/lib/qt6/libexec/moc found: NO
+Program moc6 found: NO
+Program moc-qt6 found: NO
+Program moc found: NO
+"""
+
+After:
+
+"""
+Detecting Qt6 tools
+Found pkg-config: YES (/home/qschulz/work/upstream/buildroot/output/host/bin/pkg-config) 2.3.0
+Build-time dependency qt6 (modules: Core) found: YES 6.8.1 (pkg-config)
+Program /home/qschulz/work/upstream/buildroot/output/host/bin/moc found: NO
+Program /home/qschulz/work/upstream/buildroot/output/host/libexec/moc found: YES 6.8.1 6.8.1 (/home/qschulz/work/upstream/buildroot/output/host/libexec/moc)
+"""
+
+Suggested-by: Ross Burton <[email protected]>
+Signed-off-by: Quentin Schulz <[email protected]>
+Upstream: Submitted [https://github.com/mesonbuild/meson/pull/14381]
+Signed-off-by: Quentin Schulz <[email protected]>
+---
+ mesonbuild/modules/_qt.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mesonbuild/modules/_qt.py b/mesonbuild/modules/_qt.py
+index 7d52842f9..309068c51 100644
+--- a/mesonbuild/modules/_qt.py
++++ b/mesonbuild/modules/_qt.py
+@@ -270,6 +270,9 @@ class QtBaseModule(ExtensionModule):
+         self._tools_detected = True
+         mlog.log(f'Detecting Qt{self.qt_version} tools')
+         kwargs = {'required': required, 'modules': 'Core', 'method': method}
++        # Tools are for compile-time steps, so force native check for
++        # compatibility with cross-compile scenarios
++        kwargs["native"] = True
+         # Just pick one to make mypy happy
+         qt = T.cast('QtPkgConfigDependency', find_external_dependency(f'qt{self.qt_version}', state.environment, kwargs))
+         if qt.found():
Signature · 6 lines
2.49.0

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

RFC PATCH 2/2 package/libcamera: initial support for Qt6 qcam

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

This enables initial support for Qt6 qcam example application from libcamera.

fontconfig is recommended otherwise the following messages can be observed:

"""
QFontDatabase: Cannot find font directory /usr/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig. """

It seems to depend on UTF-8 as well (via BR2_GENERATE_LOCALE) otherwise the following messages can be observed:

"""
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, but has failed to switch to one.
If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
"""

Finally, while qcam starts and renders a liveview, the characters are still rendered as square characters for now. Not sure what the issue is.

---
 package/libcamera/libcamera.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libcamera/libcamera.mk +5 -0
index 6877662bdf02df1c7f8ff37039b3096e96e52481..892f9cf275d9fd117f3a57795220a1673c2455d7 100644
@@ -85,6 +85,11 @@ LIBCAMERA_CONF_OPTS += -Dcam=enabled
 LIBCAMERA_DEPENDENCIES += libevent
 endif
 
+ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS)$(BR2_PACKAGE_QT6BASE_OPENGL),yy)
+LIBCAMERA_CONF_OPTS += -Dqcam=enabled
+LIBCAMERA_DEPENDENCIES += qt6base
+endif
+
 ifeq ($(BR2_PACKAGE_ELFUTILS),y)
 # Optional dependency on libdw
 LIBCAMERA_DEPENDENCIES += elfutils
Signature · 6 lines
2.49.0

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

Hello Quentin,

Quoted 7 lines · Quentin Schulz

This adds initial support for qcam example GUI from libcamera. It is based on Qt6 and uses openGL.

Sadly, the qt module from meson is currently broken (see first patch in the series) and requires patching. Upstream isn't really happy with what I suggested but I haven't understood what they don't like about it so cannot currently suggest anything better, hence the RFC.

The following buildroot patch works for me (for the qcam case):

Makefile +1 -1
index 5bf5abfe3b..8787a9065f 100644
@@ -468,7 +468,7 @@ $(STAGING_DIR_SYMLINK): | $(BASE_DIR)
        ln -snf $(STAGING_DIR) $(STAGING_DIR_SYMLINK)
 
 # Quotes are needed for spaces and all in the original PATH content.
-BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
+BR_PATH = "$(HOST_DIR)/libexec:$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
 
 # Location of a file giving a big fat warning that output/target
 # should not be used as the root filesystem.
Quoted 7 lines

While qcam currently renders the camera liveview, all characters of the GUI are squares. I have enabled fontconfig and UTF-8 locales but after building everything (though I dircleaned qt6base once), so not entirely sure what's missing or if it's PEBKAC, hence the RFC. Though that may be acceptable? Do not know. Would appreciate pointers on how to debug this (assumed) font issue.

Font rendering (and video output from a cheap USB cam) seems to work with the following RPi4 defconfig (and additional 'dtoverlay=vc4-kms-v3d-pi4'):

BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_BINUTILS_VERSION_2_44_X=y
BR2_GCC_VERSION_14_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_GDB_VERSION_16=y
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_DHCP="eth0"
BR2_GENERATE_LOCALE="C en_US"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,576cc10e1ed50a9eacffc7a05c796051d7343ea4)/linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b broadcom/bcm2711-rpi-400 broadcom/bcm2711-rpi-cm4 broadcom/bcm2711-rpi-cm4s" BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_QT6=y
BR2_PACKAGE_QT6BASE_GUI=y
BR2_PACKAGE_QT6BASE_EGLFS=y
BR2_PACKAGE_QT6BASE_DEFAULT_QPA="eglfs"
BR2_PACKAGE_QT6BASE_FONTCONFIG=y
BR2_PACKAGE_QT6BASE_HARFBUZZ=y
BR2_PACKAGE_QT6BASE_GIF=y
BR2_PACKAGE_QT6BASE_JPEG=y
BR2_PACKAGE_QT6BASE_PNG=y
BR2_PACKAGE_QT6BASE_WIDGETS=y
BR2_PACKAGE_QT6BASE_NETWORK=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi4/config_4.txt"
BR2_PACKAGE_LIBEXIF=y
BR2_PACKAGE_TIFF=y
BR2_PACKAGE_LIBV4L=y
BR2_PACKAGE_LIBV4L_UTILS=y
BR2_PACKAGE_LIBXKBCOMMON=y
BR2_PACKAGE_LIBCAMERA=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_KMOD_XZ=y
BR2_PACKAGE_HOST_MTOOLS=y

The UTF-8 locale warning vanishes if I start qcam with

	$ LANG=C.UTF-8 qcam

or

	$ LANG=en_US.UTF-8 qcam

Regards,
Peter

Quoted 34 lines

I'm not planning on actively working on this as the only product we have that could use this is currently stuck on qt5 so cannot use new qcam and it would anyway only be for debug firmware releases. See this as a code dump essentially. If there are hints or limited work required to have this merged, I'll happily try to find time doing it but feel free to take over the series or disregard it entirely.

This is based on top of
https://lore.kernel.org/buildroot/[email protected]/T/#t

---
Quentin Schulz (2):
package/meson: look for qt6 tools on Buildroot host machine package/libcamera: initial support for Qt6 qcam

 package/libcamera/libcamera.mk                     |  5 ++
 ...e-look-for-qt-tools-only-on-build-machine.patch | 56 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)

---
base-commit: 43abcd4c7dd8ad65d2f2012f3d4292362550a3ed
change-id: 20250404-libcamera-qcam-e8269c47e2f9
prerequisite-change-id: 20250404-libcamera-0-5-0-b9ecf899ddb4:v1
prerequisite-patch-id: 854e58d76fc57aa774ca0d315ecae56b67c00c8a
prerequisite-patch-id: 4873ac99203f0d789d64aec048249d9ba6a15a82
prerequisite-patch-id: c4d504c6563a911ba550be263063cfd7bf04bcbe
prerequisite-patch-id: 4a74788db759d3b67650f1456ee4d64f9394f50a
prerequisite-patch-id: 73a4b5a3204b1a901da74a3ffe1672055404dd2f
prerequisite-patch-id: 90b567b9a37abb58747d965ea2e0fef41358844b
prerequisite-patch-id: 946aac34b70f001c24fc6fe86caab759a4591359
prerequisite-patch-id: cee428a4219c83704347f6f194694f21093034da
prerequisite-patch-id: 6bbbdc80dc639a1b2918d79ae101e1030f3312bd

Quoted 1 line

Best regards,

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

#5 lore raw

Hi Peter,

Quoted 20 lines · Peter Seiderer

Hello Quentin,

Quoted 7 lines · Quentin Schulz

This adds initial support for qcam example GUI from libcamera. It is based on Qt6 and uses openGL.

Sadly, the qt module from meson is currently broken (see first patch in the series) and requires patching. Upstream isn't really happy with what I suggested but I haven't understood what they don't like about it so cannot currently suggest anything better, hence the RFC.

The following buildroot patch works for me (for the qcam case):

Makefile +0 -0
index 5bf5abfe3b..8787a9065f 100644

Makefile $(STAGING_DIR_SYMLINK): | $(BASE_DIR) · line 474

Quoted 8 lines
Makefile +1 -1
@@ -468,7 +468,7 @@ $(STAGING_DIR_SYMLINK): | $(BASE_DIR)
         ln -snf $(STAGING_DIR) $(STAGING_DIR_SYMLINK)
 
  # Quotes are needed for spaces and all in the original PATH content.
-BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
+BR_PATH = "$(HOST_DIR)/libexec:$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
 
  # Location of a file giving a big fat warning that output/target
  # should not be used as the root filesystem.

OK so this "works".

The issue is that meson still believes it's looking for a runtime dependency (though it finds the binaries and runs them on Buildroot host machine).

I guess this is possibly more acceptable for Buildroot (and in any case not exclusive with the meson patch) as /libexec stores binaries that could be executed? Though [1] says "internal binaries that are not intended to be executed directly by users or shell scripts".

[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

Quoted 77 lines
Quoted 8 lines

While qcam currently renders the camera liveview, all characters of the GUI are squares. I have enabled fontconfig and UTF-8 locales but after building everything (though I dircleaned qt6base once), so not entirely sure what's missing or if it's PEBKAC, hence the RFC. Though that may be acceptable? Do not know. Would appreciate pointers on how to debug this (assumed) font issue.

Font rendering (and video output from a cheap USB cam) seems to work with the following RPi4 defconfig (and additional 'dtoverlay=vc4-kms-v3d-pi4'):

BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_BINUTILS_VERSION_2_44_X=y
BR2_GCC_VERSION_14_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_GDB_VERSION_16=y
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_DHCP="eth0"
BR2_GENERATE_LOCALE="C en_US"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,576cc10e1ed50a9eacffc7a05c796051d7343ea4)/linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b broadcom/bcm2711-rpi-400 broadcom/bcm2711-rpi-cm4 broadcom/bcm2711-rpi-cm4s" BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_QT6=y
BR2_PACKAGE_QT6BASE_GUI=y
BR2_PACKAGE_QT6BASE_EGLFS=y
BR2_PACKAGE_QT6BASE_DEFAULT_QPA="eglfs"
BR2_PACKAGE_QT6BASE_FONTCONFIG=y
BR2_PACKAGE_QT6BASE_HARFBUZZ=y
BR2_PACKAGE_QT6BASE_GIF=y
BR2_PACKAGE_QT6BASE_JPEG=y
BR2_PACKAGE_QT6BASE_PNG=y
BR2_PACKAGE_QT6BASE_WIDGETS=y
BR2_PACKAGE_QT6BASE_NETWORK=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi4/config_4.txt"
BR2_PACKAGE_LIBEXIF=y
BR2_PACKAGE_TIFF=y
BR2_PACKAGE_LIBV4L=y
BR2_PACKAGE_LIBV4L_UTILS=y
BR2_PACKAGE_LIBXKBCOMMON=y
BR2_PACKAGE_LIBCAMERA=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_KMOD_XZ=y
BR2_PACKAGE_HOST_MTOOLS=y

Quoted 8 lines

The UTF-8 locale warning vanishes if I start qcam with

	$ LANG=C.UTF-8 qcam

or

	$ LANG=en_US.UTF-8 qcam

Removed all the BSP parts and could generate a rootfs for my PX30 Ringneck that displayed everything...

Looking into which exact package/symbol is actually required to make this work so I can add it as a dependency. Or... is that expected from the user to figure out what exactly is needed and compile the app with broken font-rendering (though working camera preview)?

Thanks for the hints,
Quentin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Re: [Buildroot] [PATCH RFC 1/2] package/meson: look for qt6 tools on Buildroot host machine

In reply to Quentin Schulz
Quoted 11 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

Qt tools that are looked by the meson qt module are only required as a build time dependency, to be run on the Buildroot host machine.

Therefore, meson should be looking for them on the host machine and not on the Buildroot target.

This fixes Buildroot meson not being able to find the qt6 tools whenever necessary (e.g. for libcamera qcam, whose support is added in a later commit).

As mentioned in the other thread, we should take the upstream fixes instead.

Regards,
Arnout

Quoted 59 lines
---
  ...e-look-for-qt-tools-only-on-build-machine.patch | 56 ++++++++++++++++++++++
  1 file changed, 56 insertions(+)
package/meson/0001-qt-module-look-for-qt-tools-only-on-build-machine.patch new file +46 -0
new file mode 100644
index 0000000000000000000000000000000000000000..c00ae0dbc3c63296afdc8a3d245091ee8337ddd8
@@ -0,0 +1,56 @@
+From b42daeeb3396df1a02c95d2f583058a74e7854e3 Mon Sep 17 00:00:00 2001
+From: Quentin Schulz <[email protected]>
+Date: Tue, 18 Mar 2025 15:07:53 +0100
+Subject: [PATCH] qt module: look for qt tools only on build machine
+
+Qt tools may be needed at build time, let's make their detection based
+on the build machine rather than the host machine as currently done.
+
+This incidentally fixes cross-compilation search for moc, rcc, uic and
+lrelease Qt tools because they are installed in libexec dir and that
+path is somehow not properly looked for otherwise.
+
+Before:
+
+"""
+Detecting Qt6 tools
+Run-time dependency qt6 (modules: Core) found: YES 6.8.1 (pkg-config)
+Program /usr/bin/moc found: NO
+Program /usr/lib/qt6/libexec/moc found: NO
+Program moc6 found: NO
+Program moc-qt6 found: NO
+Program moc found: NO
+"""
+
+After:
+
+"""
+Detecting Qt6 tools
+Found pkg-config: YES (/home/qschulz/work/upstream/buildroot/output/host/bin/pkg-config) 2.3.0
+Build-time dependency qt6 (modules: Core) found: YES 6.8.1 (pkg-config)
+Program /home/qschulz/work/upstream/buildroot/output/host/bin/moc found: NO
+Program /home/qschulz/work/upstream/buildroot/output/host/libexec/moc found: YES 6.8.1 6.8.1 (/home/qschulz/work/upstream/buildroot/output/host/libexec/moc)
+"""
+
+Suggested-by: Ross Burton <[email protected]>
+Signed-off-by: Quentin Schulz <[email protected]>
+Upstream: Submitted [https://github.com/mesonbuild/meson/pull/14381]
+Signed-off-by: Quentin Schulz <[email protected]>
+---
+ mesonbuild/modules/_qt.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/mesonbuild/modules/_qt.py b/mesonbuild/modules/_qt.py
+index 7d52842f9..309068c51 100644
+--- a/mesonbuild/modules/_qt.py
++++ b/mesonbuild/modules/_qt.py

package/meson/0001-qt-module-look-for-qt-tools-only-on-build-machine.patch line 56

Quoted 10 lines
package/meson/0001-qt-module-look-for-qt-tools-only-on-build-machine.patch new file +10 -0
+@@ -270,6 +270,9 @@ class QtBaseModule(ExtensionModule):
+         self._tools_detected = True
+         mlog.log(f'Detecting Qt{self.qt_version} tools')
+         kwargs = {'required': required, 'modules': 'Core', 'method': method}
++        # Tools are for compile-time steps, so force native check for
++        # compatibility with cross-compile scenarios
++        kwargs["native"] = True
+         # Just pick one to make mypy happy
+         qt = T.cast('QtPkgConfigDependency', find_external_dependency(f'qt{self.qt_version}', state.environment, kwargs))
+         if qt.found():

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