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/ExternalProject_gpgmepp.mk19
-rw-r--r--external/gpgmepp/Library_gpgmepp.mk4
-rw-r--r--external/gpgmepp/UnpackedTarball_gpgmepp.mk6
-rwxr-xr-xexternal/gpgmepp/Wincompatible-function-pointer-types.patch31
-rw-r--r--external/gpgmepp/asan.patch2
-rw-r--r--external/gpgmepp/configure.patch4
-rw-r--r--external/gpgmepp/find-libgpg-error-libassuan.patch6
-rw-r--r--external/gpgmepp/fix-autoconf-macros.patch8
-rw-r--r--external/gpgmepp/gcc9.patch10
-rw-r--r--external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.132
-rw-r--r--external/gpgmepp/macos-macports-path.patch11
-rw-r--r--external/gpgmepp/macos-tdf152524.patch102
-rw-r--r--external/gpgmepp/rpath.patch2
-rw-r--r--external/gpgmepp/ubsan.patch16
-rw-r--r--external/gpgmepp/w32-build-fixes.patch.157
-rw-r--r--external/gpgmepp/w32-disable-docs.patch.12
-rw-r--r--external/gpgmepp/w32-fix-libtool.patch.12
-rw-r--r--external/gpgmepp/w32-fix-win32-macro.patch.120
-rw-r--r--external/gpgmepp/w32-include.patch42
20 files changed, 267 insertions, 113 deletions
diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk
index a2b207597cdd..be32afd6b324 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.13.0))
-$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.25.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/ExternalProject_gpgmepp.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk
index a3166e94175e..d2733bf21b49 100644
--- a/external/gpgmepp/ExternalProject_gpgmepp.mk
+++ b/external/gpgmepp/ExternalProject_gpgmepp.mk
@@ -25,8 +25,9 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_
$(call gb_Trace_StartRange,gpgmepp,EXTERNAL)
$(call gb_ExternalProject_run,build, \
$(gb_WIN_GPG_cross_setup_exports) \
- && autoreconf \
+ && $(WSL) autoreconf \
&& $(gb_RUN_CONFIGURE) ./configure \
+ $(gb_CONFIGURE_PLATFORMS) \
--disable-shared \
--disable-languages \
--disable-gpgconf-test \
@@ -35,9 +36,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_
--disable-g13-test \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CFLAGS='$(CFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp)' \
$(gb_WIN_GPG_platform_switches) \
MAKE=$(MAKE) \
&& $(MAKE) \
@@ -59,18 +58,14 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build):
LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \
LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \
CFLAGS='$(CFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp)' \
CXXFLAGS='$(CXXFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(gb_COMPILERDEFS_STDLIB_DEBUG) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp) \
+ $(gb_COMPILERDEFS_STDLIB_DEBUG)' \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
- $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ $(gb_CONFIGURE_PLATFORMS) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
&& $(MAKE) \
diff --git a/external/gpgmepp/Library_gpgmepp.mk b/external/gpgmepp/Library_gpgmepp.mk
index f60301a4eb0d..8191e55d4709 100644
--- a/external/gpgmepp/Library_gpgmepp.mk
+++ b/external/gpgmepp/Library_gpgmepp.mk
@@ -58,9 +58,11 @@ $(eval $(call gb_Library_add_generated_exception_objects,gpgmepp,\
UnpackedTarball/gpgmepp/lang/cpp/src/engineinfo \
UnpackedTarball/gpgmepp/lang/cpp/src/eventloopinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/exception \
+ UnpackedTarball/gpgmepp/lang/cpp/src/gpgaddexistingsubkeyeditinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/gpgadduserideditinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/gpgagentgetinfoassuantransaction \
UnpackedTarball/gpgmepp/lang/cpp/src/gpggencardkeyinteractor \
+ UnpackedTarball/gpgmepp/lang/cpp/src/gpgrevokekeyeditinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetexpirytimeeditinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/gpgsetownertrusteditinteractor \
UnpackedTarball/gpgmepp/lang/cpp/src/gpgsignkeyeditinteractor \
@@ -70,9 +72,11 @@ $(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 \
+ UnpackedTarball/gpgmepp/lang/cpp/src/util \
UnpackedTarball/gpgmepp/lang/cpp/src/verificationresult \
UnpackedTarball/gpgmepp/lang/cpp/src/vfsmountresult \
))
diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index 05bfc9f07bf1..dcbda38d591d 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -27,11 +27,13 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
external/gpgmepp/w32-build-fixes-2.patch \
$(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \
$(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \
- external/gpgmepp/gcc9.patch \
external/gpgmepp/ubsan.patch \
external/gpgmepp/c++20.patch \
external/gpgmepp/clang-cl.patch \
external/gpgmepp/configure.patch \
- external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 \
+ 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
new file mode 100755
index 000000000000..cd4f1117fd06
--- /dev/null
+++ b/external/gpgmepp/Wincompatible-function-pointer-types.patch
@@ -0,0 +1,31 @@
+--- src/assuan-support.c
++++ src/assuan-support.c
+@@ -126,7 +126,7 @@
+ }
+
+
+-static gpgme_ssize_t
++static ssize_t
+ my_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
+ {
+ (void)ctx;
+@@ -134,7 +134,7 @@
+ }
+
+
+-static gpgme_ssize_t
++static ssize_t
+ my_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer, size_t size)
+ {
+ (void)ctx;
+--- src/gpgme-w32spawn.c
++++ src/gpgme-w32spawn.c
+@@ -24,7 +249,7 @@
+ handle = LoadLibraryA ("user32.dll");
+ if (handle)
+ {
+- func = GetProcAddress (handle, "AllowSetForegroundWindow");
++ func = (BOOL (WINAPI *)(DWORD)) GetProcAddress (handle, "AllowSetForegroundWindow");
+ if (!func)
+ FreeLibrary (handle);
+ }
diff --git a/external/gpgmepp/asan.patch b/external/gpgmepp/asan.patch
index 16d97f6ff307..e0b1c85fe51b 100644
--- a/external/gpgmepp/asan.patch
+++ b/external/gpgmepp/asan.patch
@@ -1,6 +1,6 @@
--- src/posix-io.c
+++ src/posix-io.c
-@@ -468,6 +468,9 @@
+@@ -563,6 +563,9 @@
if (atfork)
atfork (atforkvalue, 0);
diff --git a/external/gpgmepp/configure.patch b/external/gpgmepp/configure.patch
index 4b51db6bebad..ad3f97e632fb 100644
--- a/external/gpgmepp/configure.patch
+++ b/external/gpgmepp/configure.patch
@@ -1,6 +1,6 @@
--- configure.ac
+++ configure.ac
-@@ -619,6 +619,15 @@
+@@ -617,6 +617,15 @@
AC_SUBST(API__SSIZE_T)
AM_SUBST_NOTMAKE(API__SSIZE_T)
@@ -16,7 +16,7 @@
# Checks for compiler features.
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
-@@ -679,15 +679,6 @@
+@@ -677,15 +686,6 @@
AC_FUNC_FSEEKO
diff --git a/external/gpgmepp/find-libgpg-error-libassuan.patch b/external/gpgmepp/find-libgpg-error-libassuan.patch
index a65e453fc8b6..a98a7d845a34 100644
--- a/external/gpgmepp/find-libgpg-error-libassuan.patch
+++ b/external/gpgmepp/find-libgpg-error-libassuan.patch
@@ -2,7 +2,7 @@ diff --git a/configure.ac b/configure.ac
index f28480b..92a3e85 100644
--- configure.ac
+++ configure.ac
-@@ -674,15 +674,34 @@ AC_CHECK_FUNCS(setlocale)
+@@ -719,8 +719,18 @@
# Checking for libgpg-error.
have_gpg_error=no
@@ -23,6 +23,8 @@ index f28480b..92a3e85 100644
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
[The default error source for GPGME.])
+@@ -729,8 +739,17 @@
+
# And for libassuan.
have_libassuan=no
-AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
@@ -53,7 +55,7 @@ index f28480b..92a3e85 100644
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
--- lang/cpp/tests/Makefile.in 2020-06-20 00:44:49.542344510 +0200
+++ lang/cpp/tests/Makefile.in~ 2020-06-13 00:55:19.021212970 +0200
-@@ -415,7 +415,7 @@
+@@ -427,7 +427,7 @@
top_srcdir = @top_srcdir@
AM_LDFLAGS = -no-install
LDADD = ../../cpp/src/libgpgmepp.la \
diff --git a/external/gpgmepp/fix-autoconf-macros.patch b/external/gpgmepp/fix-autoconf-macros.patch
index e333168b2b33..265703b00671 100644
--- a/external/gpgmepp/fix-autoconf-macros.patch
+++ b/external/gpgmepp/fix-autoconf-macros.patch
@@ -1,7 +1,7 @@
diff -ur gpgme.org/configure.ac gpgme/configure.ac
--- configure.ac 2017-02-16 15:18:45.051417378 +0100
+++ configure.ac~ 2017-02-16 15:20:03.635059285 +0100
-@@ -35,6 +35,11 @@
+@@ -38,6 +38,11 @@
# the decimalized short revision number, a beta version string and a
# flag indicating a development version (mym4_isbeta). Note that the
# m4 processing is done by autoconf and not during the configure run.
@@ -13,10 +13,10 @@ diff -ur gpgme.org/configure.ac gpgme/configure.ac
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
mym4_package mym4_major mym4_minor mym4_micro),[:]))
m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
-@@ -90,7 +90,22 @@
+@@ -98,7 +103,22 @@
AC_CONFIG_MACRO_DIR([m4])
- AC_CONFIG_SRCDIR(src/gpgme.h.in)
- AC_CONFIG_HEADER(conf/config.h)
+ AC_CONFIG_SRCDIR([src/gpgme.h.in])
+ AC_CONFIG_HEADERS([conf/config.h])
-AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
+
+dnl Initialize automake. automake < 1.12 didn't have serial-tests and
diff --git a/external/gpgmepp/gcc9.patch b/external/gpgmepp/gcc9.patch
deleted file mode 100644
index c2a9fd444df7..000000000000
--- a/external/gpgmepp/gcc9.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- lang/cpp/src/key.h
-+++ lang/cpp/src/key.h
-@@ -62,6 +62,7 @@
- /* implicit */ Key(const Null &);
- Key(const shared_gpgme_key_t &key);
- Key(gpgme_key_t key, bool acquireRef);
-+ Key(Key const &) = default;
-
- static const Null null;
-
diff --git a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1
deleted file mode 100644
index 8b12c1785ccf..000000000000
--- a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001
-From: Jiri Kucera <sanczes@gmail.com>
-Date: Sun, 25 Jul 2021 11:35:54 +0200
-Subject: [PATCH] core: Support closefrom also for glibc.
-
-* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom.
---
-
-Since 2.34, glibc introduces closefrom (the implementation
-follows *BSD standard).
-
-Signed-off-by: Werner Koch <wk@gnupg.org>
----
- src/posix-io.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/posix-io.c b/src/posix-io.c
-index e712ef28..2a3a81fc 100644
---- a/src/posix-io.c
-+++ b/src/posix-io.c
-@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
- if (fd_list[i].fd > fd)
- fd = fd_list[i].fd;
- fd++;
--#if defined(__sun) || defined(__FreeBSD__)
-+#if defined(__sun) || defined(__FreeBSD__) || defined(__GLIBC__)
- closefrom (fd);
- max_fds = fd;
- #else /*!__sun */
---
-2.11.0
-
diff --git a/external/gpgmepp/macos-macports-path.patch b/external/gpgmepp/macos-macports-path.patch
new file mode 100644
index 000000000000..de7e8f68e69f
--- /dev/null
+++ b/external/gpgmepp/macos-macports-path.patch
@@ -0,0 +1,11 @@
+--- src/posix-util.c 2023-04-20 07:35:50.000000000 -0400
++++ src/posix-util.c 2023-07-14 17:28:21.000000000 -0400
+@@ -145,7 +145,7 @@
+ the browser interface we should look into some additional
+ fallback paths. */
+ const char *additional_path
+- = "/usr/local/bin:/usr/local/MacGPG2/bin:/opt/homebrew/bin";
++ = "/usr/local/bin:/usr/local/MacGPG2/bin:/opt/homebrew/bin:/opt/local/bin";
+ if (!ret)
+ {
+ ret = walk_path_str (additional_path, pgm);
diff --git a/external/gpgmepp/macos-tdf152524.patch b/external/gpgmepp/macos-tdf152524.patch
new file mode 100644
index 000000000000..c1cdd047dba8
--- /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/rpath.patch b/external/gpgmepp/rpath.patch
index e83dcf2762ef..6e6c46105b94 100644
--- a/external/gpgmepp/rpath.patch
+++ b/external/gpgmepp/rpath.patch
@@ -1,6 +1,6 @@
--- configure.ac
+++ configure.ac
-@@ -176,6 +176,9 @@
+@@ -187,6 +187,9 @@
LT_INIT([win32-dll disable-static])
LT_LANG([Windows Resource])
diff --git a/external/gpgmepp/ubsan.patch b/external/gpgmepp/ubsan.patch
index 5a6e6dcdc9b2..c23ab80ad007 100644
--- a/external/gpgmepp/ubsan.patch
+++ b/external/gpgmepp/ubsan.patch
@@ -1,8 +1,8 @@
--- src/engine-gpg.c
+++ src/engine-gpg.c
-@@ -60,6 +60,15 @@
+@@ -62,6 +62,15 @@
building command line to this location. */
- char arg[1]; /* Used if data above is not used. */
+ char arg[FLEXIBLE_ARRAY_MEMBER]; /* Used if data above is not used. */
};
+struct arg_without_data_s
+{
@@ -16,16 +16,14 @@
struct fd_data_map_s
-@@ -299,23 +308,24 @@
- a = malloc (sizeof *a - 1);
+@@ -335,19 +344,20 @@
+ a = malloc (offsetof (struct arg_and_data_s, arg));
if (!a)
return gpg_error_from_syserror ();
-- a->next = NULL;
- a->data = data;
- a->inbound = inbound;
- a->arg_locp = NULL;
+ struct arg_without_data_s *a2 = (struct arg_without_data_s *)a;
-+ a2->next = NULL;
+ a2->data = data;
+ a2->inbound = inbound;
+ a2->arg_locp = NULL;
@@ -44,9 +42,5 @@
+ a2->print_fd = 0;
+ a2->dup_to = dup_to;
}
- *gpg->argtail = a;
-- gpg->argtail = &a->next;
-+ gpg->argtail = &a2->next;
- return 0;
- }
+ if (front)
diff --git a/external/gpgmepp/w32-build-fixes.patch.1 b/external/gpgmepp/w32-build-fixes.patch.1
index 01ea99d91e43..250b2022c540 100644
--- a/external/gpgmepp/w32-build-fixes.patch.1
+++ b/external/gpgmepp/w32-build-fixes.patch.1
@@ -1,19 +1,19 @@
-diff -ru gpgme.orig/m4/ax_cxx_compile_stdcxx.m4 gpgme/m4/ax_cxx_compile_stdcxx.m4
---- gpgme.orig/m4/ax_cxx_compile_stdcxx.m4 2016-05-27 22:04:36.000000000 +0200
-+++ gpgme/m4/ax_cxx_compile_stdcxx.m4 2017-09-29 17:34:49.795243600 +0200
-@@ -156,7 +156,7 @@
-
- #error "This is not a C++ compiler"
-
--#elif __cplusplus < 201103L
-+#elif __cplusplus < 201103L && !(defined _MSC_VER)
-
- #error "This is not a C++11 compiler"
-
+diff -ru gpgme.orig/src/debug.h gpgme/src/debug.h
+--- gpgme.orig/src/debug.h
++++ gpgme/src/debug.h
+@@ -180,7 +180,7 @@ static inline gpgme_ssize_t
+ _trace_sysres_ssize_t (gpgme_ssize_t res, int lvl, const char *func, int line)
+ {
+ if (res >= 0)
+- _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", (ssize_t)res);
++ _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", res);
+ else
+ _gpgme_debug (NULL, lvl, -1, NULL, NULL, NULL,
+ "%s:%d: error: %s (%d)\n",
diff -ru gpgme.orig/src/dirinfo.c gpgme/src/dirinfo.c
--- gpgme.orig/src/dirinfo.c 2017-03-21 11:09:41.000000000 +0100
+++ gpgme/src/dirinfo.c 2017-09-30 08:36:13.239279300 +0200
-@@ -33,6 +33,10 @@
+@@ -34,6 +34,10 @@
DEFINE_STATIC_LOCK (dirinfo_lock);
@@ -24,10 +24,23 @@ 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
-@@ -28,7 +28,9 @@
+@@ -29,7 +29,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -40,7 +53,7 @@ diff -ru gpgme.orig/src/mbox-util.c gpgme/src/mbox-util.c
diff -ru gpgme.orig/src/priv-io.h gpgme/src/priv-io.h
--- gpgme.orig/src/priv-io.h 2016-11-16 13:23:14.000000000 +0100
+++ gpgme/src/priv-io.h 2017-09-30 08:20:38.770562400 +0200
-@@ -36,6 +36,9 @@
+@@ -33,6 +33,9 @@
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@@ -53,20 +66,20 @@ 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
-@@ -39,6 +39,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
-@@ -721,7 +721,8 @@
+@@ -772,7 +772,8 @@
v /= 62;
XXXXXX[5] = letters[v % 62];
@@ -79,7 +92,7 @@ diff -ru gpgme.orig/src/w32-util.c gpgme/src/w32-util.c
diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am
--- gpgme.orig/src/Makefile.am 2017-09-30 11:50:07.456960000 +0200
+++ gpgme/src/Makefile.am 2017-09-30 11:51:29.609649400 +0200
-@@ -26,7 +26,7 @@
+@@ -35,7 +35,7 @@
m4data_DATA = gpgme.m4
nodist_include_HEADERS = gpgme.h
@@ -88,7 +101,7 @@ diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am
if BUILD_W32_GLIB
ltlib_gpgme_glib = libgpgme-glib.la
-@@ -99,11 +99,11 @@
+@@ -107,11 +107,11 @@
# versions, because then every object file is only compiled once.
AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@
@@ -104,7 +117,7 @@ diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am
if HAVE_W32_SYSTEM
-@@ -120,7 +120,7 @@
+@@ -126,7 +126,7 @@
SUFFIXES = .rc .lo
.rc.lo:
diff --git a/external/gpgmepp/w32-disable-docs.patch.1 b/external/gpgmepp/w32-disable-docs.patch.1
index 2c307f502b63..1803ffa03cb5 100644
--- a/external/gpgmepp/w32-disable-docs.patch.1
+++ b/external/gpgmepp/w32-disable-docs.patch.1
@@ -4,7 +4,7 @@ like libgpg-error's --disable-doc
diff -ur gpgmepp.org/Makefile.am gpgmepp/Makefile.am
--- gpgmepp.org/Makefile.am 2016-11-16 13:20:18.000000000 +0100
+++ gpgmepp/Makefile.am 2017-11-20 15:34:49.086731000 +0100
-@@ -33,7 +33,7 @@
+@@ -45,7 +45,7 @@
tests =
endif
diff --git a/external/gpgmepp/w32-fix-libtool.patch.1 b/external/gpgmepp/w32-fix-libtool.patch.1
index 9a7adf713694..40893908b7f6 100644
--- a/external/gpgmepp/w32-fix-libtool.patch.1
+++ b/external/gpgmepp/w32-fix-libtool.patch.1
@@ -9,7 +9,7 @@ linking, by accepting cygwin path names, and correctly expanding
diff -ur gpgmepp.org/m4/libtool.m4 gpgmepp/m4/libtool.m4
--- gpgmepp.org/m4/libtool.m4 2016-11-16 13:20:16.000000000 +0100
+++ gpgmepp/m4/libtool.m4 2017-11-21 22:00:05.006587800 +0100
-@@ -3209,24 +3209,11 @@
+@@ -3230,24 +3230,11 @@
;;
cygwin*)
diff --git a/external/gpgmepp/w32-fix-win32-macro.patch.1 b/external/gpgmepp/w32-fix-win32-macro.patch.1
index 66e9ac48099a..8ab7b0fab089 100644
--- a/external/gpgmepp/w32-fix-win32-macro.patch.1
+++ b/external/gpgmepp/w32-fix-win32-macro.patch.1
@@ -1,7 +1,7 @@
diff -ur gpgmepp.org/lang/cpp/src/callbacks.cpp gpgmepp/lang/cpp/src/callbacks.cpp
--- gpgmepp.org/lang/cpp/src/callbacks.cpp 2016-10-18 19:22:02.000000000 +0200
+++ gpgmepp/lang/cpp/src/callbacks.cpp 2017-11-20 18:03:04.290060900 +0100
-@@ -38,7 +38,9 @@
+@@ -40,7 +40,9 @@
#include <cassert>
#include <cerrno>
#include <cstring>
@@ -29,7 +29,7 @@ diff -ur gpgmepp.org/lang/cpp/src/data.h gpgmepp/lang/cpp/src/data.h
diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editinteractor.cpp
--- gpgmepp.org/lang/cpp/src/editinteractor.cpp 2017-03-09 09:01:10.000000000 +0100
+++ gpgmepp/lang/cpp/src/editinteractor.cpp 2017-11-20 18:09:33.022674700 +0100
-@@ -30,9 +30,11 @@
+@@ -33,9 +33,11 @@
#include <gpgme.h>
@@ -46,7 +46,7 @@ diff -ur gpgmepp.org/lang/cpp/src/editinteractor.cpp gpgmepp/lang/cpp/src/editin
diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_export.h
--- gpgmepp.org/lang/cpp/src/gpgmepp_export.h 2016-08-04 15:03:09.000000000 +0200
+++ gpgmepp/lang/cpp/src/gpgmepp_export.h 2017-11-20 16:57:47.805691100 +0100
-@@ -29,14 +29,14 @@
+@@ -30,14 +30,14 @@
# ifndef GPGMEPP_EXPORT
# ifdef BUILDING_GPGMEPP
/* We are building this library */
@@ -63,7 +63,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_
# define GPGMEPP_EXPORT __declspec(dllimport)
# else
# define GPGMEPP_EXPORT __attribute__((visibility("default")))
-@@ -45,7 +45,7 @@
+@@ -46,7 +46,7 @@
# endif
# ifndef GPGMEPP_NO_EXPORT
@@ -72,7 +72,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_
# define GPGMEPP_NO_EXPORT
# else
# define GPGMEPP_NO_EXPORT __attribute__((visibility("hidden")))
-@@ -54,7 +54,11 @@
+@@ -55,7 +55,11 @@
#endif
#ifndef GPGMEPP_DEPRECATED
@@ -88,7 +88,7 @@ diff -ur gpgmepp.org/lang/cpp/src/gpgmepp_export.h gpgmepp/lang/cpp/src/gpgmepp_
diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src/interfaces/dataprovider.h
--- gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h 2016-05-17 14:32:37.000000000 +0200
+++ gpgmepp/lang/cpp/src/interfaces/dataprovider.h 2017-11-20 18:03:11.332715700 +0100
-@@ -29,6 +29,11 @@
+@@ -31,6 +31,11 @@
#include <gpg-error.h>
@@ -103,7 +103,7 @@ diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src
diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp
--- gpgmepp.org/lang/cpp/src/key.cpp 2017-03-20 20:10:15.000000000 +0100
+++ gpgmepp/lang/cpp/src/key.cpp 2017-11-20 17:44:50.321858800 +0100
-@@ -33,11 +33,17 @@
+@@ -34,11 +34,17 @@
#include <gpgme.h>
#include <string.h>
@@ -135,7 +135,7 @@ diff -ur gpgmepp.org/lang/cpp/src/key.h gpgmepp/lang/cpp/src/key.h
diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_export.h
--- gpgmepp.org/lang/qt/src/qgpgme_export.h 2016-11-03 17:32:30.000000000 +0100
+++ gpgmepp/lang/qt/src/qgpgme_export.h 2017-11-20 16:58:27.395388000 +0100
-@@ -39,14 +39,14 @@
+@@ -40,14 +40,14 @@
# ifndef QGPGME_EXPORT
# ifdef BUILDING_QGPGME
/* We are building this library */
@@ -152,7 +152,7 @@ diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_expo
# define QGPGME_EXPORT __declspec(dllimport)
# else
# define QGPGME_EXPORT __attribute__((visibility("default")))
-@@ -55,7 +55,7 @@
+@@ -56,7 +56,7 @@
# endif
# ifndef QGPGME_NO_EXPORT
@@ -161,7 +161,7 @@ diff -ur gpgmepp.org/lang/qt/src/qgpgme_export.h gpgmepp/lang/qt/src/qgpgme_expo
# define QGPGME_NO_EXPORT
# else
# define QGPGME_NO_EXPORT __attribute__((visibility("hidden")))
-@@ -64,7 +64,11 @@
+@@ -65,7 +65,11 @@
#endif
#ifndef QGPGME_DEPRECATED
diff --git a/external/gpgmepp/w32-include.patch b/external/gpgmepp/w32-include.patch
new file mode 100644
index 000000000000..0fda72c2b072
--- /dev/null
+++ b/external/gpgmepp/w32-include.patch
@@ -0,0 +1,42 @@
+--- src/data-fd.c
++++ src/data-fd.c
+@@ -28,6 +28,9 @@
+ #ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
++#if defined HAVE_W32_SYSTEM
++#include <io.h>
++#endif
+
+ #include "debug.h"
+ #include "data.h"
+--- src/gpgme-w32spawn.c
++++ src/gpgme-w32spawn.c
+@@ -36,6 +36,7 @@
+ # include <sys/stat.h>
+ #endif
+ #include <stdint.h>
++#include <io.h>
+ #include <process.h>
+
+ #include "priv-io.h"
+--- lang/cpp/src/gpgaddexistingsubkeyeditinteractor.h
++++ lang/cpp/src/gpgaddexistingsubkeyeditinteractor.h
+@@ -27,6 +27,7 @@
+ #include "editinteractor.h"
+
+ #include <memory>
++#include <string>
+
+ namespace GpgME
+ {
+--- lang/cpp/src/gpgrevokekeyeditinteractor.h
++++ lang/cpp/src/gpgrevokekeyeditinteractor.h
+@@ -28,6 +28,7 @@
+ #include "global.h"
+
+ #include <memory>
++#include <string>
+ #include <vector>
+
+ namespace GpgME