From b05e0d3aa2204f924be3697846080bef9d362057 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Apr 22 2014 20:38:08 +0000 Subject: Libgcrypt is not needed and used for gnutls. Thread locking should work fine by default in gnutls. --- diff --git a/abiword-3.0.0-gnutls-no-libgcrypt.patch b/abiword-3.0.0-gnutls-no-libgcrypt.patch new file mode 100644 index 0000000..99a0235 --- /dev/null +++ b/abiword-3.0.0-gnutls-no-libgcrypt.patch @@ -0,0 +1,104 @@ +diff -up abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.cpp.nogcrypt abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.cpp +--- abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.cpp.nogcrypt 2014-04-22 22:28:24.589947888 +0200 ++++ abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.cpp 2014-04-22 22:31:36.729898497 +0200 +@@ -49,89 +49,7 @@ typedef boost::shared_ptr session_ptr_t; + typedef boost::shared_ptr< std::vector > buffer_ptr_t; + +-class mutex { +-public: +- mutex() { +-#ifdef WIN32 +- repr = CreateMutex(0, FALSE, 0); +-#else +- pthread_mutex_init(&repr, NULL); +-#endif +- } +- +- void lock() { +-#ifdef WIN32 +- WaitForSingleObject(repr, INFINITE); +-#else +- pthread_mutex_lock(&repr); +-#endif +- } +- +- void unlock() { +-#ifdef WIN32 +- ReleaseMutex(repr); +-#else +- pthread_mutex_unlock(&repr); +-#endif +- } +- +- ~mutex() +- { +-#ifdef WIN32 +- CloseHandle(repr); +-#else +- pthread_mutex_destroy(&repr); +-#endif +- } +- +-private: +- mutex( const mutex& ); +- const mutex& operator=( const mutex& ); +- +-#ifdef WIN32 +- HANDLE repr; +-#else +- pthread_mutex_t repr; +-#endif +-}; +- +-static int gcry_tunnel_mutex_init(void **priv) +-{ +- if (!priv) +- return -1; +- *priv = new mutex(); +- return 0; +-} +- +-static int gcry_tunnel_mutex_destroy(void **priv) +-{ +- if (!priv || !*priv) +- return -1; +- delete reinterpret_cast(*priv); +- return 0; +-} +- +-static int gcry_tunnel_mutex_lock(void **priv) +-{ +- reinterpret_cast(*priv)->lock(); +- return 0; +-} +- +-static int gcry_tunnel_mutex_unlock(void **priv) +-{ +- reinterpret_cast(*priv)->unlock(); +- return 0; +-} +- +-static struct gcry_thread_cbs gcry_threads_tunnel = +-{ GCRY_THREAD_OPTION_USER, NULL, +- gcry_tunnel_mutex_init, gcry_tunnel_mutex_destroy, +- gcry_tunnel_mutex_lock, gcry_tunnel_mutex_unlock, +- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; +- + bool Proxy::tls_tunnel_init() { +- if (gcry_control(GCRYCTL_SET_THREAD_CBS, &tls_tunnel::gcry_threads_tunnel) != 0) +- return false; + if (gnutls_global_init() != 0) + return false; + return true; +diff -up abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.h.nogcrypt abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.h +--- abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.h.nogcrypt 2012-05-25 18:12:56.000000000 +0200 ++++ abiword-3.0.0/plugins/collab/backends/service/xp/tls_tunnel.h 2014-04-22 22:32:49.534292862 +0200 +@@ -40,7 +40,6 @@ + typedef long ssize_t; + typedef int pid_t; + #endif +-#include + #include + #include + diff --git a/abiword.spec b/abiword.spec index 839f5cc..46275f7 100644 --- a/abiword.spec +++ b/abiword.spec @@ -22,6 +22,7 @@ Patch1: abiword-2.8.3-desktop.patch Patch2: abiword-2.6.0-boolean.patch Patch3: abiword-3.0.0-fixintrospection.patch Patch4: abiword-3.0.0-fix-redraw.patch +Patch5: abiword-3.0.0-gnutls-no-libgcrypt.patch BuildRequires: aiksaurus-devel BuildRequires: aiksaurus-gtk-devel @@ -105,6 +106,7 @@ Python bindings for developing with libabiword %patch2 -p1 -b .boolean %patch3 -p1 -b .introspection %patch4 -p1 -b .redraw +%patch5 -p1 -b .nogcrypt # setup abiword documentation %setup -q -T -b 1 -n abiword-docs-%{version}