From e4691be9fd071d880107f6c0b3b56d4ca80618a5 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 29 Nov 2023 16:05:58 +0900 Subject: [PATCH] Backport upstream patch for compilation with libxml2 2.12.0 --- mapserver-pr6975-libxml2-2_12_0.patch | 83 +++++++++++++++++++++++++++ mapserver.spec | 9 ++- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 mapserver-pr6975-libxml2-2_12_0.patch diff --git a/mapserver-pr6975-libxml2-2_12_0.patch b/mapserver-pr6975-libxml2-2_12_0.patch new file mode 100644 index 0000000..60a41fe --- /dev/null +++ b/mapserver-pr6975-libxml2-2_12_0.patch @@ -0,0 +1,83 @@ +From 2c1d4f928b9657dbb4517ecbfc8cac30cc73ae9f Mon Sep 17 00:00:00 2001 +From: Even Rouault +Date: Sat, 18 Nov 2023 22:13:46 +0100 +Subject: [PATCH 1/2] Fix compilation errors with libxml2 2.12 + +--- + mapows.c | 2 +- + mapwcs.cpp | 2 +- + mapwcs20.cpp | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/mapows.c b/mapows.c +index c2fa55521..294a64fb4 100644 +--- a/mapows.c ++++ b/mapows.c +@@ -162,7 +162,7 @@ static int msOWSPreParseRequest(cgiRequestObj *request, + #endif + if (ows_request->document == NULL + || (root = xmlDocGetRootElement(ows_request->document)) == NULL) { +- xmlErrorPtr error = xmlGetLastError(); ++ const xmlError *error = xmlGetLastError(); + msSetError(MS_OWSERR, "XML parsing error: %s", + "msOWSPreParseRequest()", error->message); + return MS_FAILURE; +diff --git a/mapwcs.cpp b/mapwcs.cpp +index 5459f5bb1..817c8a784 100644 +--- a/mapwcs.cpp ++++ b/mapwcs.cpp +@@ -383,7 +383,7 @@ static int msWCSParseRequest(cgiRequestObj *request, wcsParamsObj *params, + /* parse to DOM-Structure and get root element */ + if((doc = xmlParseMemory(request->postrequest, strlen(request->postrequest))) + == NULL) { +- xmlErrorPtr error = xmlGetLastError(); ++ const xmlError *error = xmlGetLastError(); + msSetError(MS_WCSERR, "XML parsing error: %s", + "msWCSParseRequest()", error->message); + return MS_FAILURE; +diff --git a/mapwcs20.cpp b/mapwcs20.cpp +index 355a00a80..5febbb9d6 100644 +--- a/mapwcs20.cpp ++++ b/mapwcs20.cpp +@@ -1459,7 +1459,7 @@ int msWCSParseRequest20(mapObj *map, cgiRequestObj *request, + + /* parse to DOM-Structure and get root element */ + if(doc == NULL) { +- xmlErrorPtr error = xmlGetLastError(); ++ const xmlError *error = xmlGetLastError(); + msSetError(MS_WCSERR, "XML parsing error: %s", + "msWCSParseRequest20()", error->message); + return MS_FAILURE; + } +From a1dd7a851b620be9bf72426f70d82aab21ef4661 Mon Sep 17 00:00:00 2001 +From: Even Rouault +Date: Sat, 18 Nov 2023 22:13:57 +0100 +Subject: [PATCH 2/2] Fix compile-time deprecation warnings with libxml2 2.12 + +--- + mapxml.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/mapxml.c b/mapxml.c +index cb96acc3b..c065619aa 100644 +--- a/mapxml.c ++++ b/mapxml.c +@@ -48,9 +48,6 @@ int msTransformXmlMapfile(const char *stylesheet, const char *xmlMapfile, + exsltRegisterAll(); + xsltRegisterTestModule(); + +- xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; +- + cur = xsltParseStylesheetFile((const xmlChar *)stylesheet); + if (cur == NULL) { + msSetError(MS_MISCERR, "Failed to load xslt stylesheet", "msTransformXmlMapfile()"); +@@ -58,7 +55,7 @@ int msTransformXmlMapfile(const char *stylesheet, const char *xmlMapfile, + goto done; + } + +- doc = xmlParseFile(xmlMapfile); ++ doc = xmlReadFile(xmlMapfile, NULL, XML_PARSE_NOENT | XML_PARSE_DTDLOAD); + if (doc == NULL) { + msSetError(MS_MISCERR, "Failed to load xml mapfile", "msTransformXmlMapfile()"); + goto done; diff --git a/mapserver.spec b/mapserver.spec index 5aa4f65..3dc0506 100644 --- a/mapserver.spec +++ b/mapserver.spec @@ -17,7 +17,7 @@ Name: mapserver Version: 8.0.1 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Environment for building spatially-enabled internet applications %global dashver %(echo %version | sed 's|\\.|-|g') @@ -27,7 +27,9 @@ URL: http://www.mapserver.org Source0: https://github.com/%{project_owner}/%{project_name}/archive/rel-%{dashver}/%{project_name}-%{version}.tar.gz # Avoid implicit declarations of strlcat Patch0: mapserver-implicit-declarations.patch - +# https://github.com/MapServer/MapServer/pull/6975 +# Fix build with libxml2 2.12.0 +Patch1: mapserver-pr6975-libxml2-2_12_0.patch Requires: httpd Requires: dejavu-sans-fonts @@ -312,6 +314,9 @@ rm %{buildroot}%{_sysconfdir}/mapserver-sample.conf %changelog +* Wed Nov 29 2023 Mamoru TASAKA - 8.0.1-9 +- Backport upstream patch for compilation with libxml2 2.12.0 + * Wed Nov 15 2023 Sandro Mani - 8.0.1-8 - Rebuild (gdal)