Fix building of GNUTLS and update to latest 2.x version.
authorWerner Koch <wk@gnupg.org>
Thu, 25 Apr 2013 15:54:45 +0000 (17:54 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 25 Apr 2013 15:54:45 +0000 (17:54 +0200)
* patches/gnutls-2.12.21/01-openssl-wincrypt.patch: New.
* Makefile.am: Add patch.
* src/Makefile.am (gpg4win_pkg_gnutls_configure): Force building with
libgcrypt.  Disable pkcs11 module.
(LTLIBTASN1):
(gpg4win_pkg_gnutls_make_args): Add hack to allow building latest
version.
--

gnutls 2.12.21 does not seem to be well tested with Windows.  At least
not with w64-mingw32.  This is a minimal fix which is not guarnteed to
always work.

Makefile.am
packages/packages.current
patches/gnutls-2.12.21/01-openssl-wincrypt.patch [new file with mode: 0755]
src/Makefile.am

index 433cd16..6884b50 100644 (file)
@@ -76,7 +76,9 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
        patches/libetpan-0.57/01-gnutls_compat.patch \
         patches/scute-1.2.0/01-bugfixes.patch \
         patches/scute-1.3.0/01-wsastartup.patch \
-        patches/claws-mail-3.8.0cvs30/01-glib-h-only.patch
+        patches/claws-mail-3.8.0cvs30/01-glib-h-only.patch \
+       patches/gnutls-2.12.21/01-openssl-wincrypt.patch
+
 
 copy-news:
        cp NEWS doc/website/NEWS.last
index 9ef8356..0315460 100644 (file)
@@ -44,14 +44,17 @@ chk  4aa358a95d1e5774603e6fa149c926a80df43559
 
 server ftp://ftp.gnu.org/pub/gnu
 
-file gsasl/libgsasl-1.4.4.tar.gz
-chk  d32d29a5c599b2d54f214fc5747559bc890f24de
+# checked: 2013-04-25 wk
+file gsasl/libgsasl-1.8.0.tar.gz
+chk  08fd5dfdd3d88154cf06cb0759a732790c47b4f7
 
-file libtasn1/libtasn1-2.2.tar.gz
-chk  d6e0d449cf2da04c93f498d2cf4415f572611b46
+# checked: 2013-04-25 wk
+file libtasn1/libtasn1-2.14.tar.gz
+chk  22f9e0b15f870c8e03ac9cc1ead969d4d84eb931
 
-file gnutls/gnutls-2.8.6.tar.bz2
-chk  bff911d4fd7389aa6698a644b3748eb2d23715bc
+# checked: 2013-04-25 wk
+file gnutls/gnutls-2.12.21.tar.bz2
+chk  a02bef78c7e35217d84d36d9b3135de70b46be09
 
 
 #
diff --git a/patches/gnutls-2.12.21/01-openssl-wincrypt.patch b/patches/gnutls-2.12.21/01-openssl-wincrypt.patch
new file mode 100755 (executable)
index 0000000..4c6189d
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2013-04-25  Werner Koch  <wk@gnupg.org>
+
+       Fix name clash between wincrypt.h and openssl.h.
+       * libextra/gnutls_openssl.c: Undef X509_NAME.
+       * libextra/includes/gnutls/openssl.h: Ditto.
+
+
+--- libextra/gnutls_openssl.c~ 2012-01-06 20:06:24.000000000 +0100
++++ libextra/gnutls_openssl.c  2013-04-25 11:22:22.878826900 +0200
+@@ -35,6 +35,9 @@
+    name, so restore the original name. */
+ #undef shutdown
+
++/* wincrypt.h defines a X509_NAME macro.  But it is a type for us.  */
++#undef X509_NAME
++
+ /* XXX: See lib/gnutls_int.h. */
+ #define GNUTLS_POINTER_TO_INT(_) ((int) GNUTLS_POINTER_TO_INT_CAST (_))
+ #define GNUTLS_INT_TO_POINTER(_) ((void*) GNUTLS_POINTER_TO_INT_CAST (_))
+--- libextra/includes/gnutls/openssl.h~        2012-01-06 20:06:24.000000000 +0100
++++ libextra/includes/gnutls/openssl.h 2013-04-25 11:21:52.346829024 +0200
+@@ -42,6 +42,10 @@
+
+ #include <gnutls/gnutls.h>
+
++/* wincrypt.h defines a X509_NAME macro.  But it is a type for us.  */
++#undef X509_NAME
++
++
+ /* Extra definitions that do not longer exist in gnutls.
+  */
+ #define GNUTLS_X509_CN_SIZE 256
index ef75916..f9cb9dd 100644 (file)
@@ -260,11 +260,22 @@ gpg4win_pkg_gpgex_configure = --silent \
   --with-gpg-error-prefix=$(idir) \
   --with-libassuan-prefix=$(idir)
 
+# We want to build with libgcrypt
+# We can't use pkcs11 tue to tto much additional dependencies.
 gpg4win_pkg_gnutls_configure = \
   --disable-cxx \
+  --with-libgcrypt \
+  --without-p11-kit \
   --with-libtasn1-prefix=$(idir) \
   --with-libgcrypt-prefix=$(idir)
 
+# In 2.12.21 gnutls_openssl is not linked to libtasn1, thus we use
+# this hack to here.  (Using the included minitasn does work either
+# due to a missing soruce file.)
+gpg4win_pkg_gnutls_make_args = \
+   LTLIBTASN1=-ltasn1
+
+
 gpg4win_pkg_curl_configure = \
   --with-gnutls --without-ca-bundle --with-libiconv-prefix=$(idir)
 
@@ -458,6 +469,21 @@ define gpg4win_pkg_enchant_post_install
  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
 endef
 
+define gpg4win_pkg_libgsasl_post_install
+ (cd $$$${pkgidir};                                                    \
+ perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
+endef
+
+define gpg4win_pkg_libtasn1_post_install
+ (cd $$$${pkgidir};                                                    \
+ perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
+endef
+
+define gpg4win_pkg_gnutls_post_install
+ (cd $$$${pkgidir};                                                    \
+ perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
+endef
+
 
 define gpg4win_pkg_libiconv_post_install
 (cp $(srcdir)/libiconv.def $$$${pkgidir}/lib;          \