summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Ferland <marc.ferland@sonatest.com>2024-07-31 11:28:58 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-05 14:33:12 +0100
commita1c5e16c62f26401be8f5c0673efebfa18ed5abd (patch)
treefc34741730d001b408c234c25247a051b44b1de2
parent36b0291c43c0012c1d64eae6739a257561c3b787 (diff)
downloadpoky-a1c5e16c62f26401be8f5c0673efebfa18ed5abd.tar.gz
appstream: add qt6 PACKAGECONFIG option
This will enable building the libAppStreamQt library. This is required by the 'discover' application from the meta-kde layer. (From OE-Core rev: 95b9227eabec5ace9c6a69695758b8f9c37ffa75) Signed-off-by: Marc Ferland <marc.ferland@sonatest.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/appstream/appstream/0002-Do-not-build-qt-tests.patch34
-rw-r--r--meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch51
-rw-r--r--meta/recipes-support/appstream/appstream_1.0.3.bb9
3 files changed, 94 insertions, 0 deletions
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 @@
1From a7721cf4f412fbe18fe15127bea7b1457b99f684 Mon Sep 17 00:00:00 2001
2From: Marc Ferland <marc.ferland@sonatest.com>
3Date: Fri, 26 Jul 2024 15:41:00 -0400
4Subject: [PATCH] Do not build qt/tests
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Fixes the following build failure:
10
11| 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,
12| from ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp:21:
13| ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp: In function β€˜int main(int, char**)’:
14| ../AppStream-1.0.3/qt/tests/asqt-pool-test.cpp:117:1: error: expected primary-expression before β€˜)’ token
15| 117 | QTEST_MAIN(PoolReadTest)
16| | ^~~~~~~~~~
17
18Upstream-Status: Inappropriate [oe-specific]
19
20Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
21---
22 qt/meson.build | 2 --
23 1 file changed, 2 deletions(-)
24
25diff --git a/qt/meson.build b/qt/meson.build
26index 1909bcf7..c3ca20fb 100644
27--- a/qt/meson.build
28+++ b/qt/meson.build
29@@ -148,5 +148,3 @@ install_data (
30
31 # end of Qt version loop
32 endforeach
33-
34-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..e522a92e14
--- /dev/null
+++ b/meta/recipes-support/appstream/appstream/0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch
@@ -0,0 +1,51 @@
1From c36b6226479a20ebd910f355deddb9d5c7571213 Mon Sep 17 00:00:00 2001
2From: Marc Ferland <marc.ferland@sonatest.com>
3Date: Mon, 29 Jul 2024 09:35:51 -0400
4Subject: [PATCH] Fix PACKAGE_PREFIX_DIR in qt/cmake/AppStreamQtConfig.cmake.in
5
6PACKAGE_PREFIX_DIR points to an invalid directory. This breaks
7librairies linking to appstream-qt.
8
9For example, when building the 'discover' package from the meta-kde
10layer we get the following build error:
11
12| CMake Error in libdiscover/CMakeLists.txt:
13| Imported target "AppStreamQt" includes non-existent path
14|
15| "/path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/include/"
16|
17| in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
18|
19| * The path was deleted, renamed, or moved to another location.
20|
21| * An install or uninstall procedure did not complete successfully.
22|
23| * The installation package was faulty and references files it does not
24| provide.
25
26The path above should've been:
27
28 /path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/usr/include/
29
30instead of:
31
32 /path/to/build/tmp/work/core2-64-poky-linux/discover/6.1.3/recipe-sysroot/include/
33
34Upstream-Status: Inappropriate [upstream ticket https://github.com/ximion/appstream/issues/643]
35
36Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
37---
38 qt/cmake/AppStreamQtConfig.cmake.in | 2 +-
39 1 file changed, 1 insertion(+), 1 deletion(-)
40
41diff --git a/qt/cmake/AppStreamQtConfig.cmake.in b/qt/cmake/AppStreamQtConfig.cmake.in
42index 63df65f2..5ab2d0ec 100644
43--- a/qt/cmake/AppStreamQtConfig.cmake.in
44+++ b/qt/cmake/AppStreamQtConfig.cmake.in
45@@ -1,5 +1,5 @@
46
47-get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE)
48+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
49
50 # Use original install prefix when loaded through a "/usr move"
51 # 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"
27SRC_URI = " \ 27SRC_URI = " \
28 https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz \ 28 https://www.freedesktop.org/software/appstream/releases/AppStream-${PV}.tar.xz \
29 file://0001-remove-hardcoded-path.patch \ 29 file://0001-remove-hardcoded-path.patch \
30 file://0002-Do-not-build-qt-tests.patch \
31 file://0003-Fix-PACKAGE_PREFIX_DIR-in-qt-cmake-AppStreamQtConfig.patch \
30" 32"
31SRC_URI[sha256sum] = "5ab6f6cf644e7875a9508593962e56bb430f4e59ae0bf03be6be7029deb6baa4" 33SRC_URI[sha256sum] = "5ab6f6cf644e7875a9508593962e56bb430f4e59ae0bf03be6be7029deb6baa4"
32 34
@@ -36,9 +38,16 @@ PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
36 38
37PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd" 39PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
38PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer" 40PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer"
41PACKAGECONFIG[qt6] = "-Dqt=true,-Dqt=false,qtbase"
39 42
40FILES:${PN} += "${datadir}" 43FILES:${PN} += "${datadir}"
41 44
42EXTRA_OEMESON += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)}" 45EXTRA_OEMESON += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)}"
43 46
44BBCLASSEXTEND = "native" 47BBCLASSEXTEND = "native"
48
49# Fix meson not finding the Qt build tools in cross-compilation
50# setups. See: https://github.com/mesonbuild/meson/issues/13018
51do_configure:prepend:class-target() {
52 export PATH=${STAGING_DIR_NATIVE}${libexecdir}:$PATH
53}