Add patch to compile gnutls with gcrypt 1.6
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 6 Aug 2014 12:37:43 +0000 (12:37 +0000)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 6 Aug 2014 12:37:43 +0000 (12:37 +0000)
    * patches/gnutls-2.12.23/fix-gcrypt-private-api-usage.patch: New.

patches/gnutls-2.12.23/fix-gcrypt-private-api-usage.patch [new file with mode: 0755]

diff --git a/patches/gnutls-2.12.23/fix-gcrypt-private-api-usage.patch b/patches/gnutls-2.12.23/fix-gcrypt-private-api-usage.patch
new file mode 100755 (executable)
index 0000000..c4efe34
--- /dev/null
@@ -0,0 +1,44 @@
+#! /bin/sh
+patch -p0 -l -f $* < $0
+exit $?
+
+2014-08-06  Andre Heinecke  <aheinecke@intevation.de>
+
+       * lib/gcrypt/init.c: Use GCRY_THREAD_OPTION_PTHREAD_IMPL macro
+       instead of defining the gcry_thread_cbs structure itself.
+
+--- lib/gcrypt/init.c.oirg     2014-08-06 11:52:26.858064946 +0000
++++ lib/gcrypt/init.c  2014-08-06 12:10:31.121726144 +0000
+@@ -32,16 +32,9 @@
+ /* Functions that refer to the initialization of the libgcrypt library.
+  */
+
+-static struct gcry_thread_cbs gct = {
+-  .option = (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),
+-  .init = NULL,
+-  .select = NULL,
+-  .waitpid = NULL,
+-  .accept = NULL,
+-  .connect = NULL,
+-  .sendmsg = NULL,
+-  .recvmsg = NULL,
+-};
++GCRY_THREAD_OPTION_PTHREAD_IMPL;
++
++static struct gcry_thread_cbs gct;
+
+ int
+ gnutls_crypto_init (void)
+@@ -53,11 +46,12 @@
+
+       if (gnutls_mutex_init != NULL)
+         {
++#if GCRYPT_VERSION_NUMBER < 0x010600
+           gct.mutex_init = gnutls_mutex_init;
+           gct.mutex_destroy = gnutls_mutex_deinit;
+           gct.mutex_lock = gnutls_mutex_lock;
+           gct.mutex_unlock = gnutls_mutex_unlock;
+-
++#endif
+           gcry_control (GCRYCTL_SET_THREAD_CBS, &gct);
+         }