Fix build with libxml2 2.12

https://github.com/abrt/libreport/pull/801
This commit is contained in:
Yaakov Selkowitz 2023-12-19 08:22:58 -05:00
parent d1f5aea9e3
commit 3d476b7c77
2 changed files with 46 additions and 1 deletions

42
801.patch Normal file
View File

@ -0,0 +1,42 @@
From 9be0010e109d307921a049d10078813423227582 Mon Sep 17 00:00:00 2001
From: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
Date: Fri, 15 Dec 2023 18:03:33 +0100
Subject: [PATCH] Fix compatibility with libxml2 2.12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since libxml2 2.12, xmlNodePtr is no longer included by libxml/encoding.h.
This leads to build errors such as:
CC reporter_mantisbt-reporter-mantisbt.o
In file included from reporter-mantisbt.c:22:
mantisbt.h:48:5: error: unknown type name xmlNodePtr
48 | xmlNodePtr sr_root;
| ^~~~~~~~~~
mantisbt.h:49:5: error: unknown type name xmlNodePtr
49 | xmlNodePtr sr_body;
| ^~~~~~~~~~
mantisbt.h:50:5: error: unknown type name xmlNodePtr
50 | xmlNodePtr sr_method;
| ^~~~~~~~~~
Fix this by including libxml/tree.h.
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
---
src/plugins/mantisbt.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/plugins/mantisbt.h b/src/plugins/mantisbt.h
index 1feaf8f88..6979e7244 100644
--- a/src/plugins/mantisbt.h
+++ b/src/plugins/mantisbt.h
@@ -25,6 +25,7 @@ extern "C" {
#endif
#include <libxml/encoding.h>
+#include <libxml/tree.h>
#include "problem_report.h"
#define SOAP_STRING "ns2:string"

View File

@ -19,6 +19,9 @@ Release: 3%{?dist}
License: GPL-2.0-or-later
URL: https://abrt.readthedocs.org/
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
# Fix compatibility with libxml2 2.12
Patch: https://github.com/abrt/%{name}/pull/801.patch
BuildRequires: %{dbus_devel}
BuildRequires: gtk3-devel
BuildRequires: curl-devel
@ -286,7 +289,7 @@ data over ftp/scp...
%endif
%prep
%autosetup
%autosetup -p1
%build
./autogen.sh