summaryrefslogtreecommitdiffstats
path: root/external/gpgmepp
diff options
context:
space:
mode:
Diffstat (limited to 'external/gpgmepp')
-rw-r--r--external/gpgmepp/ExternalPackage_gpgmepp.mk4
-rw-r--r--external/gpgmepp/Library_gpgmepp.mk1
-rw-r--r--external/gpgmepp/UnpackedTarball_gpgmepp.mk1
-rwxr-xr-xexternal/gpgmepp/Wincompatible-function-pointer-types.patch4
-rw-r--r--external/gpgmepp/macos-tdf152524.patch102
-rw-r--r--external/gpgmepp/w32-build-fixes.patch.119
6 files changed, 124 insertions, 7 deletions
diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk
index ef49c398d2..be32afd6b3 100644
--- a/external/gpgmepp/ExternalPackage_gpgmepp.mk
+++ b/external/gpgmepp/ExternalPackage_gpgmepp.mk
@@ -15,8 +15,8 @@ ifneq ($(DISABLE_DYNLOADING),TRUE)
ifeq ($(OS),LINUX)
-$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.17.0))
-$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.29.0))
+$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.20.1))
+$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.32.1))
else ifeq ($(OS),MACOSX)
diff --git a/external/gpgmepp/Library_gpgmepp.mk b/external/gpgmepp/Library_gpgmepp.mk
index ac71cf8b90..8191e55d47 100644
--- a/external/gpgmepp/Library_gpgmepp.mk
+++ b/external/gpgmepp/Library_gpgmepp.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,gpgmepp,\
UnpackedTarball/gpgmepp/lang/cpp/src/keylistresult \
UnpackedTarball/gpgmepp/lang/cpp/src/scdgetinfoassuantransaction \
UnpackedTarball/gpgmepp/lang/cpp/src/signingresult \
+ UnpackedTarball/gpgmepp/lang/cpp/src/statusconsumerassuantransaction \
UnpackedTarball/gpgmepp/lang/cpp/src/swdbresult \
UnpackedTarball/gpgmepp/lang/cpp/src/tofuinfo \
UnpackedTarball/gpgmepp/lang/cpp/src/trustitem \
diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index d7b7a8ab4d..dcbda38d59 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -34,5 +34,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
external/gpgmepp/w32-include.patch \
external/gpgmepp/Wincompatible-function-pointer-types.patch \
external/gpgmepp/macos-macports-path.patch \
+ external/gpgmepp/macos-tdf152524.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/gpgmepp/Wincompatible-function-pointer-types.patch b/external/gpgmepp/Wincompatible-function-pointer-types.patch
index 050d2e55cf..cd4f1117fd 100755
--- a/external/gpgmepp/Wincompatible-function-pointer-types.patch
+++ b/external/gpgmepp/Wincompatible-function-pointer-types.patch
@@ -20,8 +20,8 @@
(void)ctx;
--- src/gpgme-w32spawn.c
+++ src/gpgme-w32spawn.c
-@@ -243,7 +243,7 @@
- handle = LoadLibrary ("user32.dll");
+@@ -24,7 +249,7 @@
+ handle = LoadLibraryA ("user32.dll");
if (handle)
{
- func = GetProcAddress (handle, "AllowSetForegroundWindow");
diff --git a/external/gpgmepp/macos-tdf152524.patch b/external/gpgmepp/macos-tdf152524.patch
new file mode 100644
index 0000000000..c1cdd047db
--- /dev/null
+++ b/external/gpgmepp/macos-tdf152524.patch
@@ -0,0 +1,102 @@
+--- src/posix-io.c 2023-02-01 11:50:48
++++ src/posix-io.c 2024-03-21 09:50:24
+@@ -67,6 +67,13 @@
+ #include "priv-io.h"
+ #include "sema.h"
+ #include "debug.h"
++
++#if HAVE_MACOS_SYSTEM
++#include <dispatch/dispatch.h>
++#include <spawn.h>
++
++extern char **environ;
++#endif
+
+
+ #ifdef USE_LINUX_GETDENTS
+@@ -515,6 +522,15 @@
+ }
+ return 0;
+ }
++
++
++#if HAVE_MACOS_SYSTEM
++static int
++_gpgme_io_spawn_macos (const char *path, char *const argv[], unsigned int flags,
++ struct spawn_fd_item_s *fd_list,
++ void (*atfork) (void *opaque, int reserved),
++ void *atforkvalue, pid_t *r_pid);
++#endif /*HAVE_MACOS_SYSTEM*/
+
+
+ /* Returns 0 on success, -1 on error. */
+@@ -523,6 +539,35 @@
+ struct spawn_fd_item_s *fd_list,
+ void (*atfork) (void *opaque, int reserved),
+ void *atforkvalue, pid_t *r_pid)
++#if HAVE_MACOS_SYSTEM
++{
++ /* tdf#152524 fork() and exec() in a separate libdispatch queue
++ * This is another attempt to stop the crashing in libdispatch by
++ * running fork() and exec() within a libdispatch task that will
++ * run in a sequential queue in a non-main thread. */
++ static dispatch_queue_t queue = NULL;
++ if (!queue)
++ queue = dispatch_queue_create ("gpgmepp",
++ DISPATCH_QUEUE_CONCURRENT);
++ if (!queue)
++ return -1;
++
++ __block int ret = -1;
++ dispatch_sync(queue, ^{
++ ret = _gpgme_io_spawn_macos (path, argv, flags,
++ fd_list, atfork,
++ atforkvalue, r_pid);
++ });
++
++ return ret;
++}
++
++static int
++_gpgme_io_spawn_macos (const char *path, char *const argv[], unsigned int flags,
++ struct spawn_fd_item_s *fd_list,
++ void (*atfork) (void *opaque, int reserved),
++ void *atforkvalue, pid_t *r_pid)
++#endif /*HAVE_MACOS_SYSTEM*/
+ {
+ pid_t pid;
+ int i;
+@@ -552,8 +597,15 @@
+ if (!pid)
+ {
+ /* Intermediate child to prevent zombie processes. */
++#if HAVE_MACOS_SYSTEM
++ /* tdf#152524 fix crash by skipping second fork()
++ * Instead of calling a second fork() in the child process, replace
++ * execv() with posix_spawn(). posix_spawn() does not call any atfork
++ * handlers so the atfork handler that crashes will be skipped. */
++#else /*HAVE_MACOS_SYSTEM*/
+ if ((pid = fork ()) == 0)
+ {
++#endif /*HAVE_MACOS_SYSTEM*/
+ /* Child. */
+ int max_fds = -1;
+ int fd;
+@@ -664,6 +716,9 @@
+ close (fd);
+ }
+
++#if HAVE_MACOS_SYSTEM
++ _exit(posix_spawn(NULL, path, NULL, NULL, argv, environ));
++#else /*HAVE_MACOS_SYSTEM*/
+ execv (path, (char *const *) argv);
+ /* Hmm: in that case we could write a special status code to the
+ status-pipe. */
+@@ -674,6 +729,7 @@
+ _exit (1);
+ else
+ _exit (0);
++#endif /*HAVE_MACOS_SYSTEM*/
+ }
+
+ TRACE_LOG ("waiting for child process pid=%i", pid);
diff --git a/external/gpgmepp/w32-build-fixes.patch.1 b/external/gpgmepp/w32-build-fixes.patch.1
index 4d9428781c..250b2022c5 100644
--- a/external/gpgmepp/w32-build-fixes.patch.1
+++ b/external/gpgmepp/w32-build-fixes.patch.1
@@ -24,6 +24,19 @@ diff -ru gpgme.orig/src/dirinfo.c gpgme/src/dirinfo.c
/* Constants used internally to select the data. */
enum
{
+diff -ru gpgme.orig/src/gpgme-w32spawn.c gpgme/src/gpgme-w32spawn.c
+--- gpgme.orig/src/gpgme-w32spawn.c 2023-10-27 21:27:30.000000000 +0900
++++ gpgme/src/gpgme-w32spawn.c 2024-02-26 17:32:59.949338645 +0900
+@@ -52,6 +52,9 @@
+ #define mystderr stderr
+ #endif
+
++#ifdef _MSC_VER
++#define snwprintf _snwprintf
++#endif
+
+
+ static wchar_t *
diff -ru gpgme.orig/src/mbox-util.c gpgme/src/mbox-util.c
--- gpgme.orig/src/mbox-util.c 2016-11-16 13:22:41.000000000 +0100
+++ gpgme/src/mbox-util.c 2017-09-30 08:18:29.270567500 +0200
@@ -53,16 +66,16 @@ diff -ru gpgme.orig/src/priv-io.h gpgme/src/priv-io.h
diff -ru gpgme.orig/src/util.h gpgme/src/util.h
--- gpgme.orig/src/util.h 2017-03-28 11:41:30.000000000 +0200
+++ gpgme/src/util.h 2017-09-30 08:10:54.194049100 +0200
-@@ -35,6 +35,9 @@
- #ifdef HAVE_UNISTD_H
+@@ -36,6 +36,9 @@
# include <unistd.h>
#endif
+ #include <stdint.h>
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
- #include "gpgme.h"
+ #include "gpgme.h"
diff -ru gpgme.orig/src/w32-util.c gpgme/src/w32-util.c
--- gpgme.orig/src/w32-util.c 2017-03-09 09:01:10.000000000 +0100
+++ gpgme/src/w32-util.c 2017-09-30 08:32:02.114330500 +0200