changeset: 6410:20e46d7bc453
user:      Brendan Cully <[email protected]>
date:      Sat Jan 31 11:21:52 2015 -0800
link:      http://dev.mutt.org/hg/mutt/rev/20e46d7bc453

gpgme: guard mail-key on presence of gpgme_op_export_keys

This function is too new to be assumed present.

diffs (62 lines):

diff -r b804f2daca31 -r 20e46d7bc453 configure.ac
--- a/configure.ac      Fri Jan 30 14:17:27 2015 +0100
+++ b/configure.ac      Sat Jan 31 11:21:52 2015 -0800
@@ -138,6 +138,11 @@
       #needed to get GPGME_LIBS and al correctly
       AM_PATH_GPGME(1.0.0, AC_DEFINE(CRYPT_BACKEND_GPGME, 1,
                     [Define if you use GPGME to support OpenPGP]))
+      dnl AC_CHECK_FUNCS([gpgme_op_export_keys])
+      saved_LIBS="$LIBS"
+      LIBS="$LIBS $GPGME_LIBS"
+      AC_CHECK_FUNCS([gpgme_op_export_keys])
+      LIBS="$saved_LIBS"
       MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS crypt-gpgme.o crypt-mod-pgp-gpgme.o 
crypt-mod-smime-gpgme.o"
    fi
 else
diff -r b804f2daca31 -r 20e46d7bc453 crypt-gpgme.c
--- a/crypt-gpgme.c     Fri Jan 30 14:17:27 2015 +0100
+++ b/crypt-gpgme.c     Sat Jan 31 11:21:52 2015 -0800
@@ -4469,6 +4469,7 @@
   return find_keys (to, cc, bcc, APPLICATION_SMIME);
 }
 
+#ifdef HAVE_GPGME_OP_EXPORT_KEYS
 BODY *pgp_gpgme_make_key_attachment (char *tempf)
 {
   crypt_key_t *key = NULL;
@@ -4525,6 +4526,7 @@
 
   return att;
 }
+#endif
 
 /*
  * Implementation of `init'.
diff -r b804f2daca31 -r 20e46d7bc453 crypt-mod-pgp-gpgme.c
--- a/crypt-mod-pgp-gpgme.c     Fri Jan 30 14:17:27 2015 +0100
+++ b/crypt-mod-pgp-gpgme.c     Sat Jan 31 11:21:52 2015 -0800
@@ -95,10 +95,12 @@
   return pgp_gpgme_encrypt_message (a, keylist, sign);
 }
 
+#ifdef HAVE_GPGPME_OP_EXPORT_KEYS
 static BODY *crypt_mod_pgp_make_key_attachment (char *tempf)
 {
   return pgp_gpgme_make_key_attachment (tempf);
 }
+#endif
 
 static void crypt_mod_pgp_set_sender (const char *sender)
 {
@@ -123,7 +125,11 @@
 
       /* PGP specific.  */
       crypt_mod_pgp_encrypt_message,
+#ifdef HAVE_GPGME_OP_EXPORT_KEYS
       crypt_mod_pgp_make_key_attachment,
+#else
+      NULL,
+#endif
       crypt_mod_pgp_check_traditional,
       NULL,                    /* pgp_traditional_encryptsign  */
       NULL, /* pgp_invoke_getkeys  */

Reply via email to