[2/2] apache2: Apply patch to make work with updated libxml2

Message ID 20231218172944.2531813-2-adolf.belka@ipfire.org
State Staged
Commit 4fc6f9cbe2dfd43cc6cf6c43119def1e08deadf3
Headers
Series [1/2] libxml2: Update to version 2.12.3 |

Commit Message

Adolf Belka Dec. 18, 2023, 5:29 p.m. UTC
  - libxml2 since version 2.12.0 has removed a variable that was specified in the apache
   apache mod_xml2enc code.
- This dependency caused the apache2 build to fail with the updated libxml2.
- This patch removes the dependency. It will be able to be removed when the next apache
   update is carried out as the patch was created from an apache commit.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 lfs/apache2                                   |  1 +
 ...emove_dependency_on_xmlstring_header.patch | 24 +++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 src/patches/apache-2.4.58_mod_xml2enc_remove_dependency_on_xmlstring_header.patch
  

Patch

diff --git a/lfs/apache2 b/lfs/apache2
index 9a0ad38a9..c1973e6d5 100644
--- a/lfs/apache2
+++ b/lfs/apache2
@@ -75,6 +75,7 @@  $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/apache-2.4.58_mod_xml2enc_remove_dependency_on_xmlstring_header.patch
 	### Add IPFire's layout, too
 	echo "# IPFire layout" >> $(DIR_APP)/config.layout
 	echo "<Layout IPFire>" >> $(DIR_APP)/config.layout
diff --git a/src/patches/apache-2.4.58_mod_xml2enc_remove_dependency_on_xmlstring_header.patch b/src/patches/apache-2.4.58_mod_xml2enc_remove_dependency_on_xmlstring_header.patch
new file mode 100644
index 000000000..c190a2648
--- /dev/null
+++ b/src/patches/apache-2.4.58_mod_xml2enc_remove_dependency_on_xmlstring_header.patch
@@ -0,0 +1,24 @@ 
+diff -Naur httpd-2.4.58-orig/changes-entries/xmlchar.txt httpd-2.4.58/changes-entries/xmlchar.txt
+--- httpd-2.4.58-orig/changes-entries/xmlchar.txt	1970-01-01 01:00:00.000000000 +0100
++++ httpd-2.4.58/changes-entries/xmlchar.txt	2023-12-18 12:31:00.719087460 +0100
+@@ -0,0 +1,2 @@
++ *) mod_xml2enc: Tolerate libxml2 2.12.0 and later.
++    [ttachi <tachihara AT hotmail.com>]
+diff -Naur httpd-2.4.58-orig/modules/filters/mod_xml2enc.c httpd-2.4.58/modules/filters/mod_xml2enc.c
+--- httpd-2.4.58-orig/modules/filters/mod_xml2enc.c	2020-02-21 01:33:40.000000000 +0100
++++ httpd-2.4.58/modules/filters/mod_xml2enc.c	2023-12-18 12:32:34.248535392 +0100
+@@ -206,11 +206,11 @@
+             }
+         }
+     }
+-  
++
+     /* to sniff, first we look for BOM */
+     if (ctx->xml2enc == XML_CHAR_ENCODING_NONE) {
+-        ctx->xml2enc = xmlDetectCharEncoding((const xmlChar*)ctx->buf,
+-                                             ctx->bytes); 
++        ctx->xml2enc = xmlDetectCharEncoding((const unsigned char*)ctx->buf,
++                                             ctx->bytes);
+         if (HAVE_ENCODING(ctx->xml2enc)) {
+             ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(01432)
+                           "Got charset from XML rules.") ;