From 6bdd9c21a2e4db7f35131fe0b02bb5a576646f45 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Apr 22 2014 19:31:29 +0000 Subject: Drop gcry_thread_cbs initialization as it is not needed anymore with libgcrypt-1.6 --- diff --git a/ccrtp-2.0.5-libgcrypt-no-threadcbs.patch b/ccrtp-2.0.5-libgcrypt-no-threadcbs.patch new file mode 100644 index 0000000..228d631 --- /dev/null +++ b/ccrtp-2.0.5-libgcrypt-no-threadcbs.patch @@ -0,0 +1,71 @@ +diff -up ccrtp-2.0.5/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp.threadcbs ccrtp-2.0.5/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp +--- ccrtp-2.0.5/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp.threadcbs 2012-06-18 17:19:04.000000000 +0200 ++++ ccrtp-2.0.5/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp 2014-04-22 21:28:21.857233486 +0200 +@@ -16,67 +16,17 @@ + */ + + #include +- + #include +-#include + #include +-#include +- +-/* +- * The following macro was copied from gcrypt.h and modified to explicitly +- * cast the pointer types to keep the compiler happy. +- */ +-#define GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL \ +-static int gcry_pthread_mutex_init (void **priv) \ +-{ \ +- int err = 0; \ +- pthread_mutex_t *lock = (pthread_mutex_t *)malloc (sizeof (pthread_mutex_t)); \ +- \ +- if (!lock) \ +- err = ENOMEM; \ +- if (!err) \ +-{ \ +- err = pthread_mutex_init (lock, NULL); \ +- if (err) \ +- free (lock); \ +- else \ +- *priv = lock; \ +-} \ +- return err; \ +-} \ +-static int gcry_pthread_mutex_destroy (void **lock) \ +-{ int err = pthread_mutex_destroy ((pthread_mutex_t *)*lock); free (*lock); return err; } \ +-static int gcry_pthread_mutex_lock (void **lock) \ +-{ return pthread_mutex_lock ((pthread_mutex_t *)*lock); } \ +-static int gcry_pthread_mutex_unlock (void **lock) \ +-{ return pthread_mutex_unlock ((pthread_mutex_t *)*lock); } \ +- \ +-static struct gcry_thread_cbs gcry_threads_pthread = \ +-{ GCRY_THREAD_OPTION_PTHREAD, NULL, \ +- gcry_pthread_mutex_init, gcry_pthread_mutex_destroy, \ +- gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock } +- +-/** Implement the locking callback functions for libgcrypt. +- * +- */ + + static int initialized = 0; + +-#ifdef __cplusplus +-extern "C" { +-#endif +-GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL; +-#ifdef __cplusplus +-} +-#endif +- + int initializeGcrypt () + { + + if (initialized) { + return 1; + } +- gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); + gcry_check_version(NULL); + gcry_control(GCRYCTL_DISABLE_SECMEM); + initialized = 1; diff --git a/ccrtp.spec b/ccrtp.spec index 244a6a6..1fce596 100644 --- a/ccrtp.spec +++ b/ccrtp.spec @@ -5,6 +5,7 @@ Release: 4%{?dist} License: GPLv2+ Group: System Environment/Libraries Source0: http://ftp.gnu.org/pub/gnu/ccrtp/ccrtp-%{version}.tar.gz +Patch1: ccrtp-2.0.5-libgcrypt-no-threadcbs.patch URL: http://www.gnu.org/software/commoncpp/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: commoncpp2-devel >= 1.7.0, doxygen, libgcrypt-devel, ucommon-devel @@ -36,6 +37,7 @@ to develop programs that use the %{name} library. %prep %setup -q +%patch1 -p1 -b .threadcbs chmod 644 src/ccrtp/rtp.h %build