commit 7c97fee008eb72f3e6b9bb596ac1641af0792bea
Author: Jakub Bogusz <qbo...@pld-linux.org>
Date:   Wed Jun 19 21:55:41 2024 +0200

    - updated to 2.13.1, disable bcrypt for now (too old Win32 API 
implementation)

 crossmingw32-libxml2.spec | 15 ++++++++----
 libxml2-mingw32.patch     | 30 ++++++++++++++++++++++++
 libxml2-open.gz.patch     | 58 +++++++++++++++++++++--------------------------
 3 files changed, 67 insertions(+), 36 deletions(-)
---
diff --git a/crossmingw32-libxml2.spec b/crossmingw32-libxml2.spec
index 5314580..c2fb014 100644
--- a/crossmingw32-libxml2.spec
+++ b/crossmingw32-libxml2.spec
@@ -2,15 +2,16 @@
 Summary:       libXML library - cross MinGW32 version
 Summary(pl.UTF-8):     Biblioteka libXML wersja 2 - wersja skrośna dla MinGW32
 Name:          crossmingw32-%{realname}
-Version:       2.12.8
+Version:       2.13.1
 Release:       1
 License:       MIT
 Group:         Development/Libraries
 #Source0:      ftp://xmlsoft.org/libxml2/%{realname}-%{version}.tar.gz
-Source0:       
https://download.gnome.org/sources/libxml2/2.12/%{realname}-%{version}.tar.xz
-# Source0-md5: 121a262ac4e4b4110a1104ac33676903
+Source0:       
https://download.gnome.org/sources/libxml2/2.13/%{realname}-%{version}.tar.xz
+# Source0-md5: d76c4742c94adb5d027c718fdeb726c8
 Patch0:                %{realname}-open.gz.patch
 Patch1:                %{realname}-largefile.patch
+Patch2:                %{realname}-mingw32.patch
 URL:           http://xmlsoft.org/
 BuildRequires: autoconf >= 2.68
 BuildRequires: automake >= 1:1.16.3
@@ -87,6 +88,7 @@ Biblioteka DLL libxml2 dla Windows.
 %setup -q -n %{realname}-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -101,7 +103,12 @@ CPPFLAGS="%{rpmcppflags} -DWINVER=0x0501"
        --host=%{target} \
        --disable-silent-rules \
        --enable-static \
-       --without-python
+       --with-http \
+       --with-legacy \
+       --with-lzma \
+       --without-python \
+       --with-tls \
+       --with-zlib
 
 %{__make}
 
diff --git a/libxml2-mingw32.patch b/libxml2-mingw32.patch
new file mode 100644
index 0000000..5bf12af
--- /dev/null
+++ b/libxml2-mingw32.patch
@@ -0,0 +1,30 @@
+--- libxml2-2.13.1/dict.c.orig 2024-06-12 13:17:43.000000000 +0200
++++ libxml2-2.13.1/dict.c      2024-06-19 21:40:34.925985581 +0200
+@@ -927,7 +927,6 @@ xmlDictQLookup(xmlDictPtr dict, const xm
+ #ifdef _WIN32
+   #define WIN32_LEAN_AND_MEAN
+   #include <windows.h>
+-  #include <bcrypt.h>
+ #elif defined(HAVE_GETENTROPY)
+   #ifdef HAVE_UNISTD_H
+     #include <unistd.h>
+@@ -954,7 +953,7 @@ xmlInitRandom(void) {
+     xmlInitMutex(&xmlRngMutex);
+ 
+     {
+-#ifdef _WIN32
++#ifdef TOONEW_WIN32
+         NTSTATUS status;
+ 
+         status = BCryptGenRandom(NULL, (unsigned char *) globalRngState,
+--- libxml2-2.13.1/configure.ac.orig   2024-06-19 12:13:03.000000000 +0200
++++ libxml2-2.13.1/configure.ac        2024-06-19 21:49:19.486477127 +0200
+@@ -1083,7 +1083,7 @@ dnl
+ dnl Crypto libraries
+ dnl
+ case "$host" in
+-    *-*-mingw*)
++    *-*-mingw*64*)
+         CRYPTO_LIBS="-lbcrypt"
+         ;;
+ esac
diff --git a/libxml2-open.gz.patch b/libxml2-open.gz.patch
index 644204b..1d01b0c 100644
--- a/libxml2-open.gz.patch
+++ b/libxml2-open.gz.patch
@@ -1,38 +1,32 @@
---- libxml2-2.10.0/xmlIO.c.orig        2022-08-18 16:29:32.843322082 +0200
-+++ libxml2-2.10.0/xmlIO.c     2022-08-18 16:32:12.985787850 +0200
-@@ -1115,8 +1115,33 @@ xmlGzfileOpen_real (const char *filename
+--- libxml2-2.13.0/xmlIO.c.orig        2024-06-14 12:32:12.257784372 +0200
++++ libxml2-2.13.0/xmlIO.c     2024-06-14 19:23:06.355299914 +0200
+@@ -547,6 +547,29 @@
+     fd = open(filename, flags, 0777);
+ #endif /* WIN32 */
  
-     if (path == NULL)
-       return(NULL);
--    if (!xmlCheckFilename(path))
--        return(NULL);
-+    if (!xmlCheckFilename(path)) {
-+      /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
-+       * append .gz only if filename doesn't alreay end with .gz. */
-+      if (strlen(path) < 3 || strcmp(path + strlen(path) - 3, ".gz") != 0) {
-+          char *gz_filename = xmlMalloc(strlen(path) + 4);
++#ifdef LIBXML_ZLIB_ENABLED
++    if (fd < 0 && errno == ENOENT) {
++        /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
++         * append .gz only if filename doesn't alreay end with .gz. */
++        if (strlen(filename) < 3 || strcmp(filename + strlen(filename) - 3, 
".gz") != 0) {
++            char *gz_filename = xmlMalloc(strlen(filename) + 4);
++            int gz_fd;
 +
-+          if (gz_filename == NULL) {
-+              xmlGenericError(xmlGenericErrorContext,
-+                              "xmlGzfileOpen:  %s\n",
-+                              "Failure allocating buffer for filename.");
-+              return NULL;
-+          }
++            if (gz_filename != NULL) {
++                strcpy(gz_filename, filename);
++                strcat(gz_filename, ".gz");
++            }
 +
-+          strcpy(gz_filename, path);
-+          strcat(gz_filename, ".gz");
++            gz_fd = open(gz_filename, flags, 0777);
 +
-+          fd = NULL;
++            if (gz_fd >= 0)
++                fd = gz_fd;
 +
-+          if (xmlCheckFilename(gz_filename))
-+              fd = gzopen(gz_filename, "rb");
-+
-+          xmlFree(gz_filename);
-+           
-+          return((void *) fd);
-+      } else
-+          return NULL;
++            xmlFree(gz_filename);
++        }
 +    }
- 
- #if defined(_WIN32)
-     fd = xmlWrapGzOpenUtf8(path, "rb");
++
++#endif /* LIBXML_ZLIB_ENABLED */
+     if (fd < 0) {
+         /*
+          * Windows and possibly other platforms return EINVAL
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-libxml2.git/commitdiff/7c97fee008eb72f3e6b9bb596ac1641af0792bea

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to