From 87779ef30618af3c3b660c4d063f868bb8f01b54 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Sun, 27 Apr 2025 22:51:23 +0200 Subject: libosinfo: update 1.11.0 -> 1.12.0 - remove backported patch - add a patch to fix: | ../git/osinfo/osinfo_loader.c:357:5: error: 'content' is deprecated [-Werror=deprecated-declarations] | 357 | ret = g_strdup((char *)buf->content); | | ^~~ | In file included from /home/flk/poky/build/tmp/work/corei7-64-poky-linux/libosinfo/1.12.0/recipe-sysroot/usr/include/libxml2/libxml/parser.h:16, | from ../git/osinfo/osinfo_loader.c:29: | /home/flk/poky/build/tmp/work/corei7-64-poky-linux/libosinfo/1.12.0/recipe-sysroot/usr/include/libxml2/libxml/tree.h:103:14: note: declared here | 103 | xmlChar *content XML_DEPRECATED_MEMBER; | | ^~~~~~~ | ../git/osinfo/osinfo_loader.c: At top level: | ../git/osinfo/osinfo_loader.c:1905:42: error: expected ';', ',' or ')' before 'ATTRIBUTE_UNUSED' | 1905 | catchXMLError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...) | | ^~~~~~~~~~~~~~~~ | ../git/osinfo/osinfo_loader.c: In function 'osinfo_loader_process_xml': | ../git/osinfo/osinfo_loader.c:1948:25: error: 'catchXMLError' undeclared (first use in this function) | 1948 | pctxt->sax->error = catchXMLError; | | ^~~~~~~~~~~~~ | ../git/osinfo/osinfo_loader.c:1948:25: note: each undeclared identifier is reported only once for each function it appears in | cc1: all warnings being treated as errors 1.12.0 - Oct 23, 2023 ===================== - Some memory leak fixes #156 - Adapt to change in libxml2 #155 - Several CI improvements - Several translations improvements Signed-off-by: Markus Volk Signed-off-by: Khem Raj --- ...-xmlError-struct-constant-in-propagate_li.patch | 32 -------- .../0adf38535637ec668e658d43f04f60f11f51574f.patch | 86 ++++++++++++++++++++++ .../recipes-support/libosinfo/libosinfo_1.11.0.bb | 35 --------- .../recipes-support/libosinfo/libosinfo_1.12.0.bb | 35 +++++++++ 4 files changed, 121 insertions(+), 67 deletions(-) delete mode 100644 meta-oe/recipes-support/libosinfo/libosinfo/0001-osinfo-Make-xmlError-struct-constant-in-propagate_li.patch create mode 100644 meta-oe/recipes-support/libosinfo/libosinfo/0adf38535637ec668e658d43f04f60f11f51574f.patch delete mode 100644 meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb create mode 100644 meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb diff --git a/meta-oe/recipes-support/libosinfo/libosinfo/0001-osinfo-Make-xmlError-struct-constant-in-propagate_li.patch b/meta-oe/recipes-support/libosinfo/libosinfo/0001-osinfo-Make-xmlError-struct-constant-in-propagate_li.patch deleted file mode 100644 index 467c6b4baf..0000000000 --- a/meta-oe/recipes-support/libosinfo/libosinfo/0001-osinfo-Make-xmlError-struct-constant-in-propagate_li.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5bbdd06503456784c5ffa22409e8bab50470d673 Mon Sep 17 00:00:00 2001 -From: Michal Privoznik -Date: Mon, 27 Nov 2023 15:11:45 +0100 -Subject: [PATCH] osinfo: Make xmlError struct constant in - propagate_libxml_error() - -In libxml2 commit v2.12.0~14 the API changed so that -xmlGetLastError() returns pointer to a constant xmlError struct. -Reflect this change in our code. - -Upstream-Status: Backport [https://gitlab.com/libosinfo/libosinfo/-/merge_requests/155] -Signed-off-by: Michal Privoznik ---- - osinfo/osinfo_install_script.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c -index 5800f37..303245a 100644 ---- a/osinfo/osinfo_install_script.c -+++ b/osinfo/osinfo_install_script.c -@@ -769,7 +769,7 @@ static void propagate_libxml_error(GError **error, const char *format, ...) G_GN - - static void propagate_libxml_error(GError **error, const char *format, ...) - { -- xmlErrorPtr err = xmlGetLastError(); -+ const xmlError *err = xmlGetLastError(); - char *prefix; - va_list ap; - --- -2.44.0 - diff --git a/meta-oe/recipes-support/libosinfo/libosinfo/0adf38535637ec668e658d43f04f60f11f51574f.patch b/meta-oe/recipes-support/libosinfo/libosinfo/0adf38535637ec668e658d43f04f60f11f51574f.patch new file mode 100644 index 0000000000..f76aef8b25 --- /dev/null +++ b/meta-oe/recipes-support/libosinfo/libosinfo/0adf38535637ec668e658d43f04f60f11f51574f.patch @@ -0,0 +1,86 @@ +From 0adf38535637ec668e658d43f04f60f11f51574f Mon Sep 17 00:00:00 2001 +From: Roman Bogorodskiy +Date: Thu, 10 Apr 2025 13:54:02 +0200 +Subject: [PATCH] loader: don't use libxml2 deprecated APIs + +Address the following items: + + - Deprecated direct access to buf's content + - Mismatching error function signature + - Deprecated direct access to ctxt's lastError + +Signed-off-by: Roman Bogorodskiy +Signed-off-by: Markus Volk + +Upstream-Status: Backport [https://gitlab.com/libosinfo/libosinfo/-/commit/0adf38535637ec668e658d43f04f60f11f51574f.patch] +--- + osinfo/osinfo_loader.c | 42 +++++++++++++++++++++++------------------- + 1 file changed, 23 insertions(+), 19 deletions(-) + +diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c +index 0a9004af..b3fd4535 100644 +--- a/osinfo/osinfo_loader.c ++++ b/osinfo/osinfo_loader.c +@@ -354,7 +354,7 @@ osinfo_loader_doc(const char *xpath, + xmlXPathFreeObject(obj); + OSINFO_LOADER_SET_ERROR(err, "Cannot format stylesheet"); + } +- ret = g_strdup((char *)buf->content); ++ ret = g_strdup((char *)xmlBufferContent(buf)); + + xmlBufferFree(buf); + xmlXPathFreeObject(obj); +@@ -1902,28 +1902,32 @@ static void osinfo_loader_root(OsinfoLoader *loader, + } + + static void +-catchXMLError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...) ++catchXMLError(void *ctx, const char *msg, ...) + { + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; ++ const xmlError *xmlErr = NULL; ++ g_autofree gchar *xmlmsg = NULL; + +- if (ctxt && ctxt->_private) { +- GError **err = ctxt->_private; +- if (!error_is_set(err)) { +- gchar *xmlmsg; +- if (ctxt->lastError.file) { +- xmlmsg = g_strdup_printf("%s:%d: %s", +- ctxt->lastError.file, +- ctxt->lastError.line, +- ctxt->lastError.message); +- } else { +- xmlmsg = g_strdup_printf("at line %d: %s", +- ctxt->lastError.line, +- ctxt->lastError.message); +- } +- OSINFO_LOADER_SET_ERROR(ctxt->_private, xmlmsg); +- g_free(xmlmsg); +- } ++ if (!ctxt || !ctxt->_private) ++ return; ++ ++ if (error_is_set(ctxt->_private)) ++ return; ++ ++ if (!(xmlErr = xmlCtxtGetLastError(ctx))) ++ return; ++ ++ if (xmlErr->file) { ++ xmlmsg = g_strdup_printf("%s:%d: %s", ++ xmlErr->file, ++ xmlErr->line, ++ xmlErr->message); ++ } else { ++ xmlmsg = g_strdup_printf("at line %d: %s", ++ xmlErr->line, ++ xmlErr->message); + } ++ OSINFO_LOADER_SET_ERROR(ctxt->_private, xmlmsg); + } + + static void osinfo_loader_process_xml(OsinfoLoader *loader, +-- +GitLab + diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb b/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb deleted file mode 100644 index 727d5ecf89..0000000000 --- a/meta-oe/recipes-support/libosinfo/libosinfo_1.11.0.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "API for managing information about operating systems, hypervisors and the (virtual) hardware devices." -HOMEPAGE = "https://libosinfo.org" - -LICENSE = "LGPL-2.1-only & GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=2b0e9926530c269f5ae95560370195af" -LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" - -SRC_URI = " \ - git://gitlab.com/libosinfo/libosinfo.git;branch=main;protocol=https \ - file://0001-meson.build-allow-crosscompiling-gir.patch \ - file://0001-osinfo-Make-xmlError-struct-constant-in-propagate_li.patch \ -" - -SRCREV = "ca9dd5b810dc04ea38048ae9be491654c8596ef9" - -S = "${WORKDIR}/git" - -inherit meson pkgconfig gtk-doc gobject-introspection vala - -DEPENDS = "glib-2.0 libsoup libxslt" - -VALA_MESON_OPTION = 'enable-vala' -VALA_MESON_ENABLE_FLAG = 'enabled' -VALA_MESON_DISABLE_FLAG = 'disabled' -GIR_MESON_OPTION = "enable-introspection" -GIR_MESON_ENABLE_FLAG = 'enabled' -GIR_MESON_DISABLE_FLAG = 'disabled' -GTKDOC_MESON_OPTION = "enable-gtk-doc" - -EXTRA_OEMESON += " \ - -Dwith-pci-ids-path=${datadir}/hwdata/pci.ids \ - -Dwith-usb-ids-path=${datadir}/hwdata/usb.ids \ -" - -RDEPENDS:${PN} = "hwdata osinfo-db" diff --git a/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb b/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb new file mode 100644 index 0000000000..edcebf522a --- /dev/null +++ b/meta-oe/recipes-support/libosinfo/libosinfo_1.12.0.bb @@ -0,0 +1,35 @@ +SUMMARY = "API for managing information about operating systems, hypervisors and the (virtual) hardware devices." +HOMEPAGE = "https://libosinfo.org" + +LICENSE = "LGPL-2.1-only & GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=2b0e9926530c269f5ae95560370195af" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI = " \ + git://gitlab.com/libosinfo/libosinfo.git;branch=main;protocol=https \ + file://0001-meson.build-allow-crosscompiling-gir.patch \ + file://0adf38535637ec668e658d43f04f60f11f51574f.patch \ +" + +SRCREV = "b505ef5161d2552102a743acd4ad83298d3d8f99" + +S = "${WORKDIR}/git" + +inherit meson pkgconfig gtk-doc gobject-introspection vala + +DEPENDS = "glib-2.0 libsoup libxslt" + +VALA_MESON_OPTION = 'enable-vala' +VALA_MESON_ENABLE_FLAG = 'enabled' +VALA_MESON_DISABLE_FLAG = 'disabled' +GIR_MESON_OPTION = "enable-introspection" +GIR_MESON_ENABLE_FLAG = 'enabled' +GIR_MESON_DISABLE_FLAG = 'disabled' +GTKDOC_MESON_OPTION = "enable-gtk-doc" + +EXTRA_OEMESON += " \ + -Dwith-pci-ids-path=${datadir}/hwdata/pci.ids \ + -Dwith-usb-ids-path=${datadir}/hwdata/usb.ids \ +" + +RDEPENDS:${PN} = "hwdata osinfo-db" -- cgit v1.2.3-54-g00ecf