summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2024-08-14 15:20:02 +0800
committerKhem Raj <raj.khem@gmail.com>2024-08-14 08:15:17 -0700
commit056b8cd6522d0abc2200cda6dd87152f65b92351 (patch)
tree5557ee77cb77c46e296e97dc241ca0d48e7872f6
parent3e0ed75622afe7c1031e0505362d86af80372daf (diff)
downloadmeta-openembedded-056b8cd6522d0abc2200cda6dd87152f65b92351.tar.gz
libosinfo: add runtime dependency osinfo-db
osinfo-db is required by libosinfo to list os info. So add the recipes osinfo-db and its dependency osinfo-db-tools-native. Then add osinfo-db to RDEPENDS of libosinfo. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb2
-rw-r--r--meta-oe/recipes-support/libosinfo/osinfo-db-tools/0001-Make-xmlError-structs-constant.patch56
-rw-r--r--meta-oe/recipes-support/libosinfo/osinfo-db-tools_1.11.0.bb18
-rw-r--r--meta-oe/recipes-support/libosinfo/osinfo-db_20240701.bb21
4 files changed, 96 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb b/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb
index 8ef7ac3df0..727d5ecf89 100644
--- a/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb
+++ b/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb
@@ -32,4 +32,4 @@ EXTRA_OEMESON += " \
32 -Dwith-usb-ids-path=${datadir}/hwdata/usb.ids \ 32 -Dwith-usb-ids-path=${datadir}/hwdata/usb.ids \
33" 33"
34 34
35RDEPENDS:${PN} = "hwdata" 35RDEPENDS:${PN} = "hwdata osinfo-db"
diff --git a/meta-oe/recipes-support/libosinfo/osinfo-db-tools/0001-Make-xmlError-structs-constant.patch b/meta-oe/recipes-support/libosinfo/osinfo-db-tools/0001-Make-xmlError-structs-constant.patch
new file mode 100644
index 0000000000..edff5732c6
--- /dev/null
+++ b/meta-oe/recipes-support/libosinfo/osinfo-db-tools/0001-Make-xmlError-structs-constant.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Backport [https://gitlab.com/libosinfo/osinfo-db-tools/-/commit/34378a4]
2
3Signed-off-by: Kai Kang <kai.kang@windriver.com>
4
5From 34378a4ac257f2f5fcf364786d1634a8c36b304f Mon Sep 17 00:00:00 2001
6From: Michal Privoznik <mprivozn@redhat.com>
7Date: Mon, 27 Nov 2023 15:04:43 +0100
8Subject: [PATCH] Make xmlError structs constant
9
10In libxml2 commits v2.12.0~14 and v2.12.0~77 the API changed so
11that:
12
131) xmlGetLastError() returns pointer to a constant xmlError
14 struct, and
15
162) xmlSetStructuredErrorFunc() changed the signature of callback
17 (validate_structured_error_nop()), it too is passed pointer to
18 a constant xmlError struct.
19
20But of course, older libxml2 expects different callback
21signature. Therefore, we need to typecast it anyway.
22
23Also, drop obviously incorrect @error annotation in
24validate_structured_error_nop; the variable is used.
25
26Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
27---
28 tools/osinfo-db-validate.c | 5 +++--
29 1 file changed, 3 insertions(+), 2 deletions(-)
30
31diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c
32index a721b4d..b1434a6 100644
33--- a/tools/osinfo-db-validate.c
34+++ b/tools/osinfo-db-validate.c
35@@ -35,7 +35,7 @@ static void validate_generic_error_nop(void *userData G_GNUC_UNUSED,
36 }
37
38 static void validate_structured_error_nop(void *userData G_GNUC_UNUSED,
39- xmlErrorPtr error G_GNUC_UNUSED)
40+ const xmlError *error)
41 {
42 if (error->file)
43 g_printerr("%s:%d %s", error->file, error->line, error->message);
44@@ -173,7 +173,8 @@ static gboolean validate_files(GFile *schema, gsize nfiles, GFile **files, GErro
45 g_autofree gchar *schemapath = NULL;
46
47 xmlSetGenericErrorFunc(NULL, validate_generic_error_nop);
48- xmlSetStructuredErrorFunc(NULL, validate_structured_error_nop);
49+ /* Drop this typecast when >=libxml2-2.12.0 is required */
50+ xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc) validate_structured_error_nop);
51
52 schemapath = g_file_get_path(schema);
53 rngParser = xmlRelaxNGNewParserCtxt(schemapath);
54--
552.34.1
56
diff --git a/meta-oe/recipes-support/libosinfo/osinfo-db-tools_1.11.0.bb b/meta-oe/recipes-support/libosinfo/osinfo-db-tools_1.11.0.bb
new file mode 100644
index 0000000000..0584bee15c
--- /dev/null
+++ b/meta-oe/recipes-support/libosinfo/osinfo-db-tools_1.11.0.bb
@@ -0,0 +1,18 @@
1SUMMARY = "Tools for managing the libosinfo database files"
2HOMEPAGE = "https://libosinfo.org"
3
4LICENSE = "GPL-2.0-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6
7DEPENDS = "glib-2.0 json-glib libarchive libsoup-2.4"
8
9SRC_URI = "git://gitlab.com/libosinfo/osinfo-db-tools.git;branch=main;protocol=https \
10 file://0001-Make-xmlError-structs-constant.patch \
11 "
12SRCREV = "85a1788c6977419b6facad11dbfbf823e739eb3b"
13
14S = "${WORKDIR}/git"
15
16inherit meson pkgconfig
17
18BBCLASSEXTEND = "native"
diff --git a/meta-oe/recipes-support/libosinfo/osinfo-db_20240701.bb b/meta-oe/recipes-support/libosinfo/osinfo-db_20240701.bb
new file mode 100644
index 0000000000..d369046055
--- /dev/null
+++ b/meta-oe/recipes-support/libosinfo/osinfo-db_20240701.bb
@@ -0,0 +1,21 @@
1SUMMARY = "osinfo-db provides the database files for use with the libosinfo library"
2HOMEPAGE = "https://libosinfo.org"
3
4LICENSE = "GPL-2.0-or-later"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6
7DEPENDS = "osinfo-db-tools-native"
8
9SRC_URI = "git://gitlab.com/libosinfo/osinfo-db.git;branch=main;protocol=https"
10
11SRCREV = "cde78484ab747c87532d47cf3f09b76f280c0b74"
12
13S = "${WORKDIR}/git"
14
15inherit allarch autotools-brokensep
16
17EXTRA_OEMAKE = "OSINFO_DB_TARGET='--dir ${datadir}/osinfo'"
18
19do_configure[noexec] = "1"
20
21FILES:${PN} = "${datadir}/osinfo"