talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit f5080c0fc50ee031c547153268b61d9ff433ab41
parent b2b89f91d14df834f57369122c5d5978d8622a07
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date:   Sat,  8 Oct 2022 23:28:13 -0700

Add pkgconfig support for gpgme and libgpg-error

Diffstat:
Mclaws-features.h.in | 1-
Mconfigure.ac | 16+++++++++++++---
Msrc/plugins/pgpcore/Makefile.am | 1+
Msrc/plugins/pgpcore/sgpgme.c | 29++++++++++++++---------------
Msrc/plugins/smime/Makefile.am | 1+
5 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/claws-features.h.in b/claws-features.h.in @@ -1,6 +1,5 @@ #undef HAVE_DBUS_GLIB #undef HAVE_DIRENT_D_TYPE -#undef HAVE_GPGME_PKA_TRUST #undef HAVE_LIBCOMPFACE #undef HAVE_LIBETPAN #undef HAVE_LIBSM diff --git a/configure.ac b/configure.ac @@ -1355,10 +1355,20 @@ if test x"$HAVE_PERL" = xyes; then fi dnl Gpgme ********************************************************************** -AM_PATH_GPGME(1.0.0, HAVE_GPGME=yes, HAVE_GPGME=no) -if test x"$HAVE_GPGME" = xyes; then +dnl First try to find gpgme with gpgme-config. Use pkgconfig if not found +AM_PATH_GPGME(1.1.1, HAVE_GPGME_CONFIG=yes, HAVE_GPGME_CONFIG=no) +if test x"$HAVE_GPGME_CONFIG" = xno; then + PKG_CHECK_MODULES(GPGME, [gpgme >= 1.1.1], HAVE_GPGME_PKGCONFIG=yes, HAVE_GPGME_PKGCONFIG=no) + if test x"$HAVE_GPGME_PKGCONFIG" = xyes; then + PKG_CHECK_MODULES(LIBGPG_ERROR, [gpg-error]) + fi +fi + +if test x"$HAVE_GPGME_CONFIG" = xyes -o x"$HAVE_GPGME_PKGCONFIG" = xyes; then AC_DEFINE(USE_GPGME, 1, Define if you use GPGME to support OpenPGP.) - AM_PATH_GPGME(1.1.1, AC_DEFINE(HAVE_GPGME_PKA_TRUST, 1, [Define if GPGME supports PKA.])) + HAVE_GPGME=yes +else + HAVE_GPGME=no fi dnl Python ********************************************************************* diff --git a/src/plugins/pgpcore/Makefile.am b/src/plugins/pgpcore/Makefile.am @@ -27,6 +27,7 @@ EXTRA_pgpcore_la_DEPENDENCIES = $(plugin_extra_deps) pgpcore_la_LIBADD = $(plugin_libadd) \ $(GTK_LIBS) \ $(GPGME_LIBS) \ + $(LIBGPG_ERROR_LIBS) \ $(ENCHANT_LIBS) pgpcore_la_CPPFLAGS = \ diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c @@ -613,21 +613,20 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status) g_string_append_c(siginfo, (gchar)*primary_fpr); } g_string_append_c(siginfo, '\n'); -#ifdef HAVE_GPGME_PKA_TRUST - if (sig->pka_trust == 1 && sig->pka_address) { - g_string_append_printf(siginfo, - _("WARNING: Signer's address \"%s\" " - "does not match DNS entry\n"), - sig->pka_address); - } - else if (sig->pka_trust == 2 && sig->pka_address) { - g_string_append_printf(siginfo, - _("Verified signer's address is \"%s\"\n"), - sig->pka_address); - /* FIXME: Compare the address to the - * From: address. */ - } -#endif /*HAVE_GPGME_PKA_TRUST*/ + + if (sig->pka_trust == 1 && sig->pka_address) { + g_string_append_printf(siginfo, + _("WARNING: Signer's address \"%s\" " + "does not match DNS entry\n"), + sig->pka_address); + } + else if (sig->pka_trust == 2 && sig->pka_address) { + g_string_append_printf(siginfo, + _("Verified signer's address is \"%s\"\n"), + sig->pka_address); + /* FIXME: Compare the address to the + * From: address. */ + } } g_string_append(siginfo, "\n"); diff --git a/src/plugins/smime/Makefile.am b/src/plugins/smime/Makefile.am @@ -32,6 +32,7 @@ EXTRA_smime_la_DEPENDENCIES = $(plugin_extra_deps) smime_la_LIBADD = $(plugin_libadd) \ $(GTK_LIBS) \ $(GPGME_LIBS) \ + $(LIBGPG_ERROR_LIBS) \ $(ENCHANT_LIBS) smime_la_CPPFLAGS = \