diff mbox series

[1/1] package/libiio: fix build with libxml2 >= 2.12

Message ID 20231229220427.47110-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/libiio: fix build with libxml2 >= 2.12 | expand

Commit Message

Fabrice Fontaine Dec. 29, 2023, 10:04 p.m. UTC
Fix the following build failure raised since bump of libxml2 to version
2.12.1 in commit d8ac52108c12f0fcc9641b63e7922009270f96c6:

/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c: In function 'xml_create_context':
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:15: warning: implicit declaration of function 'xmlReadFile' [-Wimplicit-function-declaration]
  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |               ^~~~~~~~~~~
/home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:43: error: 'XML_PARSE_DTDVALID' undeclared (first use in this function); did you mean 'XML_DOC_DTDVALID'?
  481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
      |                                           ^~~~~~~~~~~~~~~~~~
      |                                           XML_DOC_DTDVALID

Fixes:
 - http://autobuild.buildroot.org/results/f97c2db33e07a02699e4650caf97de5f3c475eb8

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...l-Fix-compatibility-with-libxml-2-12.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch

Comments

Thomas Petazzoni Jan. 1, 2024, 8:36 p.m. UTC | #1
On Fri, 29 Dec 2023 23:04:27 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure raised since bump of libxml2 to version
> 2.12.1 in commit d8ac52108c12f0fcc9641b63e7922009270f96c6:
> 
> /home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c: In function 'xml_create_context':
> /home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:15: warning: implicit declaration of function 'xmlReadFile' [-Wimplicit-function-declaration]
>   481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
>       |               ^~~~~~~~~~~
> /home/buildroot/autobuild/instance-1/output-1/build/libiio-0.25/xml.c:481:43: error: 'XML_PARSE_DTDVALID' undeclared (first use in this function); did you mean 'XML_DOC_DTDVALID'?
>   481 |         doc = xmlReadFile(xml_file, NULL, XML_PARSE_DTDVALID);
>       |                                           ^~~~~~~~~~~~~~~~~~
>       |                                           XML_DOC_DTDVALID
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/f97c2db33e07a02699e4650caf97de5f3c475eb8
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...l-Fix-compatibility-with-libxml-2-12.patch | 33 +++++++++++++++++++
>  1 file changed, 33 insertions(+)
>  create mode 100644 package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch

Applied to master, thanks.

Thomas
diff mbox series

Patch

diff --git a/package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch b/package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch
new file mode 100644
index 0000000000..56c272aad3
--- /dev/null
+++ b/package/libiio/0001-xml-Fix-compatibility-with-libxml-2-12.patch
@@ -0,0 +1,33 @@ 
+From b1170cacff24cdfd3858edc2285c51cadef11488 Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <jtojnar@gmail.com>
+Date: Sun, 10 Dec 2023 21:52:05 +0100
+Subject: [PATCH] xml: Fix compatibility with libxml 2.12
+
+libxml 2.12.0 reorganized includes, resulting in the following no longer being in scope:
+
+- XML_PARSE_DTDVALID
+- xmlReadMemory
+- xmlReadFile
+- xmlCleanupParser
+
+Signed-off-by: Jan Tojnar <jtojnar@gmail.com>
+(cherry picked from commit bb688d04294dda45e68dfaf13e3bc1187841e52a)
+
+Upstream: https://github.com/analogdevicesinc/libiio/commit/b1170cacff24cdfd3858edc2285c51cadef11488
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ xml.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/xml.c b/xml.c
+index 33f026103..3eaed92b3 100644
+--- a/xml.c
++++ b/xml.c
+@@ -10,6 +10,7 @@
+ #include "iio-private.h"
+ 
+ #include <errno.h>
++#include <libxml/parser.h>
+ #include <libxml/tree.h>
+ #include <string.h>
+