From c87c90aaf472e07fe8e0d73215778fb43c6a34ae Mon Sep 17 00:00:00 2001 From: mio Date: Wed, 11 Sep 2024 04:07:10 +0000 Subject: [PATCH] community/pidgin-sipe: fix build with gcc 14 --- community/pidgin-sipe/APKBUILD | 4 +- .../gcc14-update-for-libxml2.patch | 68 +++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 community/pidgin-sipe/gcc14-update-for-libxml2.patch diff --git a/community/pidgin-sipe/APKBUILD b/community/pidgin-sipe/APKBUILD index ccd7d9ca5b1..f0cb3add4e3 100644 --- a/community/pidgin-sipe/APKBUILD +++ b/community/pidgin-sipe/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa pkgname=pidgin-sipe pkgver=1.25.0 -pkgrel=1 +pkgrel=2 pkgdesc="Pidgin protocol plugin to connect to MS Office Communicator" url="https://sipe.sourceforge.net/" arch="all" @@ -24,6 +24,7 @@ checkdepends="appstream" subpackages="$pkgname-lang" source="https://downloads.sourceforge.net/project/sipe/sipe/pidgin-sipe-$pkgver/pidgin-sipe-$pkgver.tar.bz2 asc.patch + gcc14-update-for-libxml2.patch " prepare() { @@ -58,4 +59,5 @@ package() { sha512sums=" 37992bc133eadb05c3f187e97cd82cf8d8bf344d176a73827e78ff9521dbd66b3d0a8ff5d3b27bc1b7eb2797d3484b289390821634d11a7545c0cd2da38953b3 pidgin-sipe-1.25.0.tar.bz2 644cc4719dc0ee3a431ec1b9232137a06bd27e48693f2232478035cce8e503bbe2109fc232032cd2d91a316addbc895e44a0f40028839b753e710c6149dca356 asc.patch +8709fafc1375b3876d2f02623a08f46e01a45e3157155e35417f83d0f9dae2888a4ecdd0674b683f4461207de6abd1d155c4a59867bed7d31902434fbdc86d95 gcc14-update-for-libxml2.patch " diff --git a/community/pidgin-sipe/gcc14-update-for-libxml2.patch b/community/pidgin-sipe/gcc14-update-for-libxml2.patch new file mode 100644 index 00000000000..d953ced9967 --- /dev/null +++ b/community/pidgin-sipe/gcc14-update-for-libxml2.patch @@ -0,0 +1,68 @@ +Source: https://src.fedoraproject.org/rpms/pidgin-sipe/blob/rawhide/f/pidgin-sipe-1.25.0-fix-libxml2-2.12-build.patch +--- +From 8c37bad762decd3aad86cfe758187a610804b196 Mon Sep 17 00:00:00 2001 +From: Stefan Becker +Date: Mon, 22 Jan 2024 22:47:20 +0200 +Subject: [PATCH 1/2] xml: update for libxml2 >= 2.12 API changes + +- error callback is now passed a const error +- provide alternative implementation for the deprecated + xmlSAXUserParseMemory() API +--- + src/core/sipe-xml.c | 31 ++++++++++++++++++++++++++++++- + 1 file changed, 30 insertions(+), 1 deletion(-) + +diff --git a/src/core/sipe-xml.c b/src/core/sipe-xml.c +index cfc53115..e69d6d02 100644 +--- a/src/core/sipe-xml.c ++++ b/src/core/sipe-xml.c +@@ -154,7 +154,13 @@ static void callback_error(void *user_data, const char *msg, ...) + g_free(errmsg); + } + +-static void callback_serror(void *user_data, xmlErrorPtr error) ++static void callback_serror(void *user_data, ++#if LIBXML_VERSION > 21200 ++ const xmlError *error ++#else ++ xmlErrorPtr error ++#endif ++) + { + struct _parser_data *pd = user_data; + +@@ -217,8 +223,31 @@ sipe_xml *sipe_xml_parse(const gchar *string, gsize length) + if (string && length) { + struct _parser_data *pd = g_new0(struct _parser_data, 1); + ++#if LIBXML_VERSION > 21200 ++ xmlParserCtxtPtr ctxt = xmlNewSAXParserCtxt(&parser, pd); ++ ++ if (ctxt) { ++ xmlCtxtReadMemory(ctxt, ++ string, ++ length, ++ NULL, ++ NULL, ++ 0); ++ ++ pd->error = !ctxt->wellFormed; ++ ++ if (ctxt->myDoc) { ++ xmlFreeDoc(ctxt->myDoc); ++ ctxt->myDoc = NULL; ++ } ++ ++ xmlFreeParserCtxt(ctxt); ++ } else ++ pd->error = TRUE; ++#else + if (xmlSAXUserParseMemory(&parser, pd, string, length)) + pd->error = TRUE; ++#endif + + if (pd->error) { + sipe_xml_free(pd->root); +-- +2.43.0 +