* cleanup: drop gmime-2.4 support

This commit is contained in:
djcb 2013-07-21 14:44:44 +03:00
parent 8656f6721e
commit b7324d5af6
11 changed files with 13 additions and 96 deletions

View File

@ -106,39 +106,17 @@ AS_IF([test "x$PKG_CONFIG" = "xno"],[
# glib2?
# we need 2.14 at least, because we use GRegex
PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.24 gobject-2.0)
PKG_CHECK_MODULES(GLIB,glib-2.0 >= 2.24 gobject-2.0 gio-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
glib_version="`$PKG_CONFIG --modversion glib-2.0`"
PKG_CHECK_MODULES(GIO,gio-2.0,[have_gio=yes],[have_gio=no])
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
gio_version="`$PKG_CONFIG --modversion gio-2.0`"
# gmime 2.4 or 2.6?
PKG_CHECK_MODULES(GMIME,gmime-2.6,[have_gmime_26=yes],[have_gmime_26=no])
AS_IF([test "x$have_gmime_26" = "xno"],[
PKG_CHECK_MODULES(GMIME,gmime-2.4,[have_gmime_24=yes],[have_gmime_24=no])
AS_IF([test "x$have_gmime_24" = "xno"],[
AC_MSG_ERROR([
*** neither gmime-2.4 nor gmime-2.6 could be found; please install it
*** e.g., in debian/ubuntu the package would be 'libgmime-2.4-dev'
*** If you compiled it yourself, you should ensure that the pkgconfig
*** installation dir (e.g., /usr/local/lib/pkgconfig) is in your
*** PKG_CONFIG_PATH.
])],[
gmime_version="`$PKG_CONFIG --modversion gmime-2.4`"
])],[
gmime_version="`$PKG_CONFIG --modversion gmime-2.6`"
])
# gmime
PKG_CHECK_MODULES(GMIME,gmime-2.6)
AC_SUBST(GMIME_CFLAGS)
AC_SUBST(GMIME_LIBS)
gmime_version="`$PKG_CONFIG --modversion gmime-2.6`"
# we need gmime 2.6 for the crypto stuff
AM_CONDITIONAL(BUILD_CRYPTO,[test "x$have_gmime_26" = "xyes"])
AS_IF([test "x$have_gmime_26" = "xyes"],
AC_DEFINE_UNQUOTED([BUILD_CRYPTO],1,[Whether to build crypto; reqs gmime 2.6]))
# xapian checking - we need 1.2.x at least
AC_CHECK_PROG(XAPIAN_CONFIG,xapian-config,xapian-config,no)
@ -313,7 +291,7 @@ fi
echo
echo "Have wordexp : $ac_cv_header_wordexp_h"
echo "Build mu4e emacs frontend : $build_mu4e"
echo "Build crypto support (gmime >= 2.6) : $have_gmime_26"
AM_COND_IF([BUILD_GUI],[
echo "Build 'mug' toy-ui (gtk+/webkit) : yes"],[
echo "Build 'mug' toy-ui (gtk+/webkit) : no"

View File

@ -20,18 +20,13 @@ include $(top_srcdir)/gtest.mk
# before decending into tests/
SUBDIRS= . tests
if BUILD_CRYPTO
crypto=mu-msg-crypto.c
else
crypto=
endif
AM_CPPFLAGS=$(XAPIAN_CXXFLAGS) $(GMIME_CFLAGS) $(GLIB_CFLAGS) $(GUILE_CFLAGS)
# don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not
# really need all the params they get
AM_CFLAGS=-Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -pedantic -Wno-variadic-macros
AM_CFLAGS=-Wall -Wextra -Wno-unused-parameter \
-Wdeclaration-after-statement -pedantic -Wno-variadic-macros
AM_CXXFLAGS=-Wall -Wextra -Wno-unused-parameter
noinst_LTLIBRARIES= \
@ -54,7 +49,7 @@ libmu_la_SOURCES= \
mu-log.h \
mu-maildir.c \
mu-maildir.h \
${crypto} \
mu-msg-crypto.c \
mu-msg-doc.cc \
mu-msg-doc.h \
mu-msg-fields.c \

View File

@ -777,7 +777,6 @@ foreach_cb (GMimeObject *parent, GMimeObject *part, ForeachData *fdata)
/* invoke the callback function */
fdata->user_func (parent, part, fdata->user_data);
#ifdef BUILD_CRYPTO
/* maybe iterate over decrypted parts */
if (fdata->decrypt &&
GMIME_IS_MULTIPART_ENCRYPTED (part)) {
@ -798,8 +797,6 @@ foreach_cb (GMimeObject *parent, GMimeObject *part, ForeachData *fdata)
g_object_unref (dec);
}
#endif /*BUILD_CRYPTO*/
}

View File

@ -311,16 +311,6 @@ static gboolean handle_mime_object (MuMsg *msg,
unsigned index, MuMsgPartForeachFunc func,
gpointer user_data);
/* if mu is build without crypto support (i.e, gmime < 2.6), the crypto funcs
* are no-ops
*/
#ifndef BUILD_CRYPTO
#define check_signature(A,B,C) (TRUE)
#define handle_encrypted_part(A,B,C,D,E,F,G) (TRUE)
#else /* BUILD_CRYPTO */
#define SIG_STATUS_REPORT "sig-status-report"
/* call 'func' with information about this MIME-part */
@ -412,7 +402,7 @@ handle_encrypted_part (MuMsg *msg,
return TRUE;
}
#endif /*BUILD_CRYPTO */
/* call 'func' with information about this MIME-part */
@ -442,14 +432,12 @@ handle_part (MuMsg *msg, GMimePart *part, GMimeObject *parent,
msgpart.part_type |= MU_MSG_PART_TYPE_TEXT_HTML;
}
#ifdef BUILD_CRYPTO
/* put the verification info in the pgp-signature part */
msgpart.sig_status_report = NULL;
if (g_ascii_strcasecmp (msgpart.subtype, "pgp-signature") == 0)
msgpart.sig_status_report =
(MuMsgPartSigStatusReport*)
g_object_get_data (G_OBJECT(parent), SIG_STATUS_REPORT);
#endif /*BUILD_CRYPTO*/
msgpart.data = (gpointer)part;
msgpart.index = index;

View File

@ -92,7 +92,6 @@ void mu_mime_message_foreach (GMimeMessage *msg, gboolean decrypt,
GMimeObjectForeachFunc func,
gpointer user_data);
#ifdef BUILD_CRYPTO
/**
* callback function to retrieve a password from the user
*
@ -136,7 +135,6 @@ GMimeObject* mu_msg_crypto_decrypt_part (GMimeMultipartEncrypted *enc, MuMsgOpti
MuMsgPartPasswordFunc func, gpointer user_data,
GError **err)
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
#endif /*BUILD_CRYPTO*/
G_END_DECLS

View File

@ -24,7 +24,6 @@
#include <mu-flags.h>
#include <mu-msg-fields.h>
#include <mu-msg-prio.h>
/* #include <mu-msg-part.h> */
#include <mu-util.h> /* for MuError and XapianDocument */
G_BEGIN_DECLS

View File

@ -148,9 +148,6 @@ mu_util_error_quark (void)
}
const char*
mu_util_cache_dir (void)
{
@ -328,12 +325,6 @@ mu_util_supports (MuFeature feature)
return FALSE;
#endif /*BUILD_GUILE*/
/* check for crypto support */
#ifndef BUILD_CRYPTO
if (feature & MU_FEATURE_CRYPTO)
return FALSE;
#endif /*BUILD_CRYPTO*/
/* check for Gnuplot */
if (feature & MU_FEATURE_GNUPLOT)
if (!mu_util_program_in_path ("gnuplot"))

View File

@ -201,7 +201,7 @@ test_mu_util_get_dtype_with_lstat (void)
static void
test_mu_util_supports (void)
{
gboolean has_guile, has_crypto;
gboolean has_guile;
gchar *path;
has_guile = FALSE;
@ -209,14 +209,8 @@ test_mu_util_supports (void)
has_guile = TRUE;
#endif /*BUILD_GUILE*/
g_assert_cmpuint (mu_util_supports (MU_FEATURE_GUILE),==,has_guile);
has_crypto = FALSE;
#ifdef BUILD_CRYPTO
has_crypto = TRUE;
#endif /*BUILD_CRYPTO*/
g_assert_cmpuint (mu_util_supports (MU_FEATURE_CRYPTO),==,has_crypto);
g_assert_cmpuint (mu_util_supports (MU_FEATURE_GUILE), == ,has_guile);
g_assert_cmpuint (mu_util_supports (MU_FEATURE_CRYPTO), == ,TRUE);
path = g_find_program_in_path ("gnuplot");
g_free (path);
@ -226,7 +220,7 @@ test_mu_util_supports (void)
g_assert_cmpuint (
mu_util_supports (MU_FEATURE_GNUPLOT|MU_FEATURE_GUILE|MU_FEATURE_CRYPTO),
==,
has_guile && has_crypto && path ? TRUE : FALSE);
has_guile && path ? TRUE : FALSE);
}

View File

@ -398,8 +398,6 @@ mu_cmd_remove (MuStore *store, MuConfig *opts, GError **err)
#ifdef BUILD_CRYPTO
struct _VData {
MuMsgPartSigStatus combined_status;
char *report;
@ -512,16 +510,6 @@ mu_cmd_verify (MuConfig *opts, GError **err)
return vdata.combined_status == MU_MSG_PART_SIG_STATUS_GOOD ?
MU_OK : MU_ERROR;
}
#else
MuError
mu_cmd_verify (MuConfig *opts, GError **err)
{
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
"this mu does not support the "
"'verify' command");
return MU_ERROR_IN_PARAMETERS;
}
#endif /*!BUILD_CRYPTO*/
static void

View File

@ -506,15 +506,6 @@ parse_cmd (int *argcp, char ***argvp, GError **err)
}
#endif /*!BUILD_GUILE*/
#ifndef BUILD_CRYPTO
if (MU_CONFIG.cmd == MU_CONFIG_CMD_VERIFY) {
mu_util_g_set_error (err, MU_ERROR_IN_PARAMETERS,
"command 'verify' not supported");
return FALSE;
}
#endif /*!BUILD_CRYPTO */
return TRUE;
}

View File

@ -888,10 +888,8 @@ main (int argc, char *argv[])
g_test_add_func ("/mu-cmd/test-mu-view-attach", test_mu_view_attach);
g_test_add_func ("/mu-cmd/test-mu-mkdir-01", test_mu_mkdir_01);
#ifdef BUILD_CRYPTO
g_test_add_func ("/mu-cmd/test-mu-verify-good", test_mu_verify_good);
g_test_add_func ("/mu-cmd/test-mu-verify-bad", test_mu_verify_bad);
#endif /*BUILD_CRYPTO*/
g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_LEVEL_WARNING|