diff mbox series

[2/2] appstream: add qt6 PACKAGECONFIG option

Message ID 20240729150907.1552685-2-marc.ferland@sonatest.com
State Accepted, archived
Commit 95b9227eabec5ace9c6a69695758b8f9c37ffa75
Headers show
Series [1/2] appstream: refresh patch | expand

Commit Message

Marc Ferland July 29, 2024, 3:09 p.m. UTC
From: Marc Ferland <marc.ferland@sonatest.com>

This will enable building the libAppStreamQt library. This is required
by the 'discover' application from the meta-kde layer.

Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
---
 .../0002-Do-not-build-qt-tests.patch          | 34 +++++++++++++
 ...IX_DIR-in-qt-cmake-AppStreamQtConfig.patch | 49 +++++++++++++++++++
 .../appstream/appstream_1.0.3.bb              |  9 ++++
 3 files changed, 92 insertions(+)
 create mode 100644 meta/recipes-support/appstream/appstream/0002-Do-not-build-qt-tests.patch
 create mode 100644 meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch

Comments

patchtest@automation.yoctoproject.org July 29, 2024, 3:24 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/2-2-appstream-add-qt6-PACKAGECONFIG-option.patch

FAIL: test Signed-off-by presence: A patch file has been added without a Signed-off-by tag: '0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch' (test_patch.TestPatch.test_signed_off_by_presence)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-support/appstream/appstream/0002-Do-not-build-qt-tests.patch b/meta/recipes-support/appstream/appstream/0002-Do-not-build-qt-tests.patch
new file mode 100644
index 0000000000..9a725ab8e4
--- /dev/null
+++ b/meta/recipes-support/appstream/appstream/0002-Do-not-build-qt-tests.patch
@@ -0,0 +1,34 @@ 
+From a7721cf4f412fbe18fe15127bea7b1457b99f684 Mon Sep 17 00:00:00 2001
+From: Marc Ferland <marc.ferland@sonatest.com>
+Date: Fri, 26 Jul 2024 15:41:00 -0400
+Subject: [PATCH] Do not build qt/tests
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes the following build failure:
+
+| In file included from /home/marc/mnt/yocto-kde/build/tmp/work/x86_64-linux/appstream-native/1.0.3/recipe-sysroot-native/usr/include/QtTest/QtTest:11,
+|                  from ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp:21:
+| ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp: In function β€˜int main(int, char**)’:
+| ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp:117:1: error: expected primary-expression before β€˜)’ token
+|   117 | QTEST_MAIN(PoolReadTest)
+|       | ^~~~~~~~~~
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
+---
+ qt/meson.build | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/qt/meson.build b/qt/meson.build
+index 1909bcf7..c3ca20fb 100644
+--- a/qt/meson.build
++++ b/qt/meson.build
+@@ -148,5 +148,3 @@ install_data (
+ 
+ # end of Qt version loop
+ endforeach
+-
+-subdir('tests/')
diff --git a/meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch b/meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch
new file mode 100644
index 0000000000..aa49b65c65
--- /dev/null
+++ b/meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch
@@ -0,0 +1,49 @@ 
+From c36b6226479a20ebd910f355deddb9d5c7571213 Mon Sep 17 00:00:00 2001
+From: Marc Ferland <marc.ferland@sonatest.com>
+Date: Mon, 29 Jul 2024 09:35:51 -0400
+Subject: [PATCH] Fix PACKAGE_PREFIX_DIR in qt/cmake/AppStreamQtConfig.cmake.in
+
+PACKAGE_PREFIX_DIR points to an invalid directory. This breaks
+librairies linking to appstream-qt.
+
+For example, when building the 'discover' package from the meta-kde
+layer we get the following build error:
+
+| CMake Error in libdiscover/CMakeLists.txt:
+|   Imported target "AppStreamQt" includes non-existent path
+|
+|     "/path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/include/"
+|
+|   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
+|
+|   * The path was deleted, renamed, or moved to another location.
+|
+|   * An install or uninstall procedure did not complete successfully.
+|
+|   * The installation package was faulty and references files it does not
+|   provide.
+
+The path above should've been:
+
+    /path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/usr/include/
+
+instead of:
+
+    /path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/include/
+
+Upstream-Status: Inappropriate [upstream ticket https://github.com/ximion/appstream/issues/643]
+---
+ qt/cmake/AppStreamQtConfig.cmake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qt/cmake/AppStreamQtConfig.cmake.in b/qt/cmake/AppStreamQtConfig.cmake.in
+index 63df65f2..5ab2d0ec 100644
+--- a/qt/cmake/AppStreamQtConfig.cmake.in
++++ b/qt/cmake/AppStreamQtConfig.cmake.in
+@@ -1,5 +1,5 @@
+ 
+-get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE)
++get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+ 
+ # Use original install prefix when loaded through a "/usr move"
+ # cross-prefix symbolic link such as /lib -> /usr/lib.
diff --git a/meta/recipes-support/appstream/appstream_1.0.3.bb b/meta/recipes-support/appstream/appstream_1.0.3.bb
index 625e85a0ae..092d85d1a0 100644
--- a/meta/recipes-support/appstream/appstream_1.0.3.bb
+++ b/meta/recipes-support/appstream/appstream_1.0.3.bb
@@ -27,6 +27,8 @@  GIDOCGEN_MESON_OPTION = "apidocs"
 SRC_URI = " \
 	https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz \
 	file://0001-remove-hardcoded-path.patch \
+	file://0002-Do-not-build-qt-tests.patch \
+	file://0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch \
 "
 SRC_URI[sha256sum] = "5ab6f6cf644e7875a9508593962e56bb430f4e59ae0bf03be6be7029deb6baa4"
 
@@ -36,9 +38,16 @@  PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 
 PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
 PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer"
+PACKAGECONFIG[qt6] = "-Dqt=true,-Dqt=false,qtbase"
 
 FILES:${PN} += "${datadir}"
 
 EXTRA_OEMESON += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)}"
 
 BBCLASSEXTEND = "native"
+
+# Fix meson not finding the Qt build tools in cross-compilation
+# setups. See: https://github.com/mesonbuild/meson/issues/13018
+do_configure:prepend:class-target() {
+    export PATH=${STAGING_DIR_NATIVE}${libexecdir}:$PATH
+}