From 11f1d702e67037de1401cfe7adbeaf49c2c18c4263cb056a620165e5bf390012 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 1 Jul 2024 19:38:41 +0000 Subject: [PATCH 1/2] - bsc#1225908 - Package osinfo-db-tools does not build with gcc14 because of new errors 001-Make-xmlError-structs-constant.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/osinfo-db-tools?expand=0&rev=29 --- 001-Make-xmlError-structs-constant.patch | 46 ++++++++++++++++++++++++ osinfo-db-tools.changes | 7 ++++ osinfo-db-tools.spec | 5 ++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 001-Make-xmlError-structs-constant.patch diff --git a/001-Make-xmlError-structs-constant.patch b/001-Make-xmlError-structs-constant.patch new file mode 100644 index 0000000..652381c --- /dev/null +++ b/001-Make-xmlError-structs-constant.patch @@ -0,0 +1,46 @@ +Subject: Make xmlError structs constant +From: Michal Privoznik mprivozn@redhat.com Mon Nov 27 15:04:43 2023 +0100 +Date: Mon Nov 27 15:04:43 2023 +0100: +Git: 34378a4ac257f2f5fcf364786d1634a8c36b304f + +In libxml2 commits v2.12.0~14 and v2.12.0~77 the API changed so +that: + +1) xmlGetLastError() returns pointer to a constant xmlError + struct, and + +2) xmlSetStructuredErrorFunc() changed the signature of callback + (validate_structured_error_nop()), it too is passed pointer to + a constant xmlError struct. + +But of course, older libxml2 expects different callback +signature. Therefore, we need to typecast it anyway. + +Also, drop obviously incorrect @error annotation in +validate_structured_error_nop; the variable is used. + +Signed-off-by: Michal Privoznik + +diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c +index a721b4d..b1434a6 100644 +--- a/tools/osinfo-db-validate.c ++++ b/tools/osinfo-db-validate.c +@@ -35,7 +35,7 @@ static void validate_generic_error_nop(void *userData G_GNUC_UNUSED, + } + + static void validate_structured_error_nop(void *userData G_GNUC_UNUSED, +- xmlErrorPtr error G_GNUC_UNUSED) ++ const xmlError *error) + { + if (error->file) + g_printerr("%s:%d %s", error->file, error->line, error->message); +@@ -173,7 +173,8 @@ static gboolean validate_files(GFile *schema, gsize nfiles, GFile **files, GErro + g_autofree gchar *schemapath = NULL; + + xmlSetGenericErrorFunc(NULL, validate_generic_error_nop); +- xmlSetStructuredErrorFunc(NULL, validate_structured_error_nop); ++ /* Drop this typecast when >=libxml2-2.12.0 is required */ ++ xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc) validate_structured_error_nop); + + schemapath = g_file_get_path(schema); + rngParser = xmlRelaxNGNewParserCtxt(schemapath); diff --git a/osinfo-db-tools.changes b/osinfo-db-tools.changes index e390e62..a786a15 100644 --- a/osinfo-db-tools.changes +++ b/osinfo-db-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jul 1 13:35:02 MDT 2024 - carnold@suse.com + +- bsc#1225908 - Package osinfo-db-tools does not build with gcc14 + because of new errors + 001-Make-xmlError-structs-constant.patch + ------------------------------------------------------------------- Mon Nov 13 13:56:39 MST 2023 - carnold@suse.com diff --git a/osinfo-db-tools.spec b/osinfo-db-tools.spec index b060150..3504c8d 100644 --- a/osinfo-db-tools.spec +++ b/osinfo-db-tools.spec @@ -24,6 +24,9 @@ License: LGPL-2.1+ and GPL-2.0+ Group: System/Management Url: https://releases.pagure.org/libosinfo/ Source: https://releases.pagure.org/libosinfo/%{name}-%{version}.tar.xz + +Patch1: 001-Make-xmlError-structs-constant.patch + BuildRequires: gettext-devel BuildRequires: glib2-devel BuildRequires: json-glib-devel @@ -40,7 +43,7 @@ This package provides tools for managing the osinfo database of information about operating systems for use with virtualization %prep -%setup -q +%autosetup -p1 %build %meson From edebcaace5d8a8aef1a846387c9d23925efcce5cff188fe1bcb76615452f5c71 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 1 Jul 2024 19:39:26 +0000 Subject: [PATCH 2/2] Update copyright year OBS-URL: https://build.opensuse.org/package/show/Virtualization/osinfo-db-tools?expand=0&rev=30 --- osinfo-db-tools.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osinfo-db-tools.spec b/osinfo-db-tools.spec index 3504c8d..57825e0 100644 --- a/osinfo-db-tools.spec +++ b/osinfo-db-tools.spec @@ -1,7 +1,7 @@ # # spec file for package osinfo-db-tools # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,9 +24,7 @@ License: LGPL-2.1+ and GPL-2.0+ Group: System/Management Url: https://releases.pagure.org/libosinfo/ Source: https://releases.pagure.org/libosinfo/%{name}-%{version}.tar.xz - Patch1: 001-Make-xmlError-structs-constant.patch - BuildRequires: gettext-devel BuildRequires: glib2-devel BuildRequires: json-glib-devel