Fix build with libxml2-2.12.0

https://gitlab.com/libosinfo/libosinfo/-/merge_requests/155
This commit is contained in:
Yaakov Selkowitz 2023-12-12 19:39:07 -05:00
parent 704db82afb
commit 563386cce5
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From 5bbdd06503456784c5ffa22409e8bab50470d673 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
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.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
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 5800f374..303245a1 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;
--
GitLab

View File

@ -12,6 +12,12 @@ Release: %autorelease
License: LGPL-2.1-or-later
Source: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
URL: https://libosinfo.org/
### Patches ###
# Fix build with libxml2-2.12.0
# https://gitlab.com/libosinfo/libosinfo/-/merge_requests/155
Patch: 0001-osinfo-Make-xmlError-struct-constant.patch
BuildRequires: meson
BuildRequires: gcc
BuildRequires: gtk-doc