Skip to contentSkip to conversation

gupnp-av: Fix build with libxml2-2.11 and newer

PATCH New Khem Raj 1 participant 1 message Jun 30, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 gupnp-av: Fix build with libxml2-2.11 and newer

---
 .../0001-all-Drop-xmlRecoverMemory.patch      | 44 +++++++++++++++++++
 .../gupnp/gupnp-av_0.14.0.bb                  |  4 +-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta-multimedia/recipes-connectivity/gupnp/gupnp-av/0001-all-Drop-xmlRecoverMemory.patch
meta-multimedia/recipes-connectivity/gupnp/gupnp-av/0001-all-Drop-xmlRecoverMemory.patch new file +44 -0
new file mode 100644
index 0000000000..92b52ad98a
@@ -0,0 +1,44 @@
+From d99f71a4a52da7582d5e26992a1ab303b280d28a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 30 Jun 2023 03:23:12 -0700
+Subject: [PATCH] Drop xmlRecoverMemory
+
+newer libxml has deprecated xmlRecoverMemory therefore replace it with xmlReadMemory
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gupnp/-/commit/80e68995b745a5900eaaa1d0c424d3a9d354e42d]
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ gupnp-didl-lite-parser.c    | 2 +-
+ gupnp-feature-list-parser.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gupnp-didl-lite-parser.c b/gupnp-didl-lite-parser.c
+index 3a5727f..840d718 100644
+--- a/libgupnp-av/gupnp-didl-lite-parser.c
++++ b/libgupnp-av/gupnp-didl-lite-parser.c
+@@ -230,7 +230,7 @@ gupnp_didl_lite_parser_parse_didl_recursive (GUPnPDIDLLiteParser *parser,
+         GUPnPAVXMLDoc *xml_doc = NULL;
+         gboolean       result;
+ 
+-        doc = xmlRecoverMemory (didl, strlen (didl));
++        doc = xmlReadMemory (didl, strlen (didl), NULL, NULL, XML_PARSE_NONET | XML_PARSE_RECOVER);
+         if (doc == NULL) {
+                 g_set_error (error,
+                              G_MARKUP_ERROR,
+diff --git a/gupnp-feature-list-parser.c b/gupnp-feature-list-parser.c
+index 16208b5..f804fe7 100644
+--- a/libgupnp-av/gupnp-feature-list-parser.c
++++ b/libgupnp-av/gupnp-feature-list-parser.c
+@@ -114,7 +114,7 @@ gupnp_feature_list_parser_parse_text
+         xmlNode      *element;
+         GList        *feature_list = NULL;
+ 
+-        doc = xmlRecoverMemory (text, strlen (text));
++        doc = xmlReadMemory (text, strlen (text), NULL, NULL, XML_PARSE_NONET | XML_PARSE_RECOVER);
+         if (doc == NULL) {
+                 g_set_error (error,
+                              G_MARKUP_ERROR,
+-- 
+2.41.0
+
meta-multimedia/recipes-connectivity/gupnp/gupnp-av_0.14.0.bb +3 -1
index b253c54d92..48de5868de 100644
@@ -8,5 +8,7 @@ DEPENDS = "gupnp"
 
 inherit meson pkgconfig gobject-introspection vala
 
-SRC_URI = "${GNOME_MIRROR}/${BPN}/0.14/${BPN}-${PV}.tar.xz"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/0.14/${BPN}-${PV}.tar.xz \
+           file://0001-all-Drop-xmlRecoverMemory.patch \
+          "
 SRC_URI[sha256sum] = "20aed546fc882e78a3f186a0c8bce5c841cc3a44b7ea528298fbdc82596fb156"
Signature · 1 line
2.41.0