Add pkgconfig support for gpgme and libgpg-error

This commit is contained in:
Jonathan Boeing 2022-10-08 23:28:13 -07:00
parent b2b89f91d1
commit f5080c0fc5
5 changed files with 29 additions and 19 deletions

View File

@ -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

View File

@ -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 *********************************************************************

View File

@ -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 = \

View File

@ -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");

View File

@ -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 = \