From d8de9186cd9abedf552b52e7cf5971cc4c66c1fc Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Sat, 4 Oct 2025 10:33:08 +0200 Subject: [PATCH] gnu: libspatialite: Fix build with libxml2 >= 2.14. * gnu/packages/patches/libspatialite-libxml2-2.14.patch: New file. * gnu/local.mk (dist_pach_DATA): Register it. * gnu/packages/geo.scm (libspatialite)[source]: Use it. Change-Id: I24ac907c11c0592d3e9bdbba8e7f44585c1055d0 --- gnu/local.mk | 1 + gnu/packages/geo.scm | 3 +- .../patches/libspatialite-libxml2-2.14.patch | 52 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libspatialite-libxml2-2.14.patch diff --git a/gnu/local.mk b/gnu/local.mk index 4794f642464..217bdec2ecc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1773,6 +1773,7 @@ dist_patch_DATA = \ %D%/packages/patches/libsecret-fix-test-paths.patch \ %D%/packages/patches/libsepol-versioned-docbook.patch \ %D%/packages/patches/libskk-fix-invalid-escape.patch \ + %D%/packages/patches/libspatialite-libxml2-2.14.patch \ %D%/packages/patches/libtar-CVE-2013-4420.patch \ %D%/packages/patches/libtar-CVE-2021-33643-CVE-2021-33644.patch \ %D%/packages/patches/libtar-CVE-2021-33645-CVE-2021-33646.patch \ diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 1a21290caa7..1cf4335c79e 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -822,7 +822,8 @@ coverages using a SpatiaLite DBMS.") version ".tar.gz")) (sha256 (base32 - "102hc18fvwr1kw8aap53zqi8r0l52b8wa00lvlbf1zys979jvgj3")))) + "102hc18fvwr1kw8aap53zqi8r0l52b8wa00lvlbf1zys979jvgj3")) + (patches (search-patches "libspatialite-libxml2-2.14.patch")))) (build-system gnu-build-system) (native-inputs (list pkg-config)) diff --git a/gnu/packages/patches/libspatialite-libxml2-2.14.patch b/gnu/packages/patches/libspatialite-libxml2-2.14.patch new file mode 100644 index 00000000000..d45897aac78 --- /dev/null +++ b/gnu/packages/patches/libspatialite-libxml2-2.14.patch @@ -0,0 +1,52 @@ +Source: https://www.gaia-gis.it/fossil/libspatialite/tktview?name=ac85f0fca3 + +Index: spatialite-5.1.0/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -61,6 +61,8 @@ AH_TEMPLATE([OMIT_FREEXL], + [Should be defined in order to disable FREEXL support.]) + AH_TEMPLATE([ENABLE_LIBXML2], + [Should be defined in order to enable LIBXML2 support.]) ++AH_TEMPLATE([ENABLE_LIBXML2_NANOHTTP], ++ [Should be defined in order to enable LIBXML2 HTTP support.]) + AH_TEMPLATE([ENABLE_MINIZIP], + [Should be defined in order to enable MiniZIP support.]) + AH_TEMPLATE([ENABLE_GEOPACKAGE], +@@ -441,6 +443,7 @@ if test x"$enable_libxml2" != "xno"; the + AC_SUBST(LIBXML2_CFLAGS) + AC_SUBST(LIBXML2_LIBS) + AC_DEFINE(ENABLE_LIBXML2) ++ AC_SEARCH_LIBS(xmlNanoHTTPCleanup,xml2,AC_DEFINE(ENABLE_LIBXML2_NANOHTTP),,) + fi + + #----------------------------------------------------------------------- +Index: spatialite-5.1.0/src/wfs/wfs_in.c +=================================================================== +--- a/src/wfs/wfs_in.c ++++ b/src/wfs/wfs_in.c +@@ -76,7 +76,10 @@ Regione Toscana - Settore Sistema Inform + #ifdef ENABLE_LIBXML2 /* LIBXML2 enabled: supporting XML documents */ + + #include ++ ++#ifdef ENABLE_LIBXML2_NANOHTTP + #include ++#endif + + #define MAX_GTYPES 28 + +@@ -4636,8 +4639,13 @@ get_wfs_schema_column_info (gaiaWFScolum + SPATIALITE_DECLARE void + reset_wfs_http_connection (void) + { ++#ifdef ENABLE_LIBXML2_NANOHTTP + /* Resets the libxml2 "nano HTTP": useful when changing the HTTP_PROXY settings */ + xmlNanoHTTPCleanup (); ++#else ++/* LIBXML2 doesn't have HTTP support: does absolutely nothing */ ++ return; ++#endif + } + + #else /* LIBXML2 isn't enabled */