1################################################################################
2#
3# mutt
4#
5################################################################################
6
7MUTT_VERSION = 2.2.13
8MUTT_SITE = https://bitbucket.org/mutt/mutt/downloads
9MUTT_LICENSE = GPL-2.0+
10MUTT_LICENSE_FILES = GPL
11MUTT_CPE_ID_VENDOR = mutt
12MUTT_DEPENDENCIES = ncurses
13MUTT_CONF_OPTS = --disable-doc --disable-smtp
14
15ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
16MUTT_CONF_ENV += LIBS=-latomic
17endif
18
19ifeq ($(BR2_PACKAGE_LIBICONV),y)
20MUTT_DEPENDENCIES += libiconv
21MUTT_CONF_OPTS += --enable-iconv
22endif
23
24# Both options can't be selected at the same time so prefer libidn2
25ifeq ($(BR2_PACKAGE_LIBIDN2),y)
26MUTT_DEPENDENCIES += libidn2
27MUTT_CONF_OPTS += --with-idn2 --without-idn
28else ifeq ($(BR2_PACKAGE_LIBIDN),y)
29MUTT_DEPENDENCIES += libidn
30MUTT_CONF_OPTS += --with-idn --without-idn2
31else
32MUTT_CONF_OPTS += --without-idn --without-idn2
33endif
34
35ifeq ($(BR2_PACKAGE_LIBGPGME),y)
36MUTT_DEPENDENCIES += libgpgme
37MUTT_CONF_OPTS += \
38	--enable-gpgme \
39	--with-gpgme-prefix=$(STAGING_DIR)/usr
40
41# Force the path to "gpgrt-config" (from the libgpg-error package) to
42# avoid using the one on host, if present.
43MUTT_GPGRT_CONFIG = $(STAGING_DIR)/usr/bin/gpgrt-config
44ifeq ($(BR2_STATIC_LIBS),y)
45MUTT_GPGRT_CONFIG += --static
46endif
47MUTT_CONF_ENV += GPGRT_CONFIG="$(MUTT_GPGRT_CONFIG)"
48else
49MUTT_CONF_OPTS += --disable-gpgme
50endif
51
52ifeq ($(BR2_PACKAGE_MUTT_IMAP),y)
53MUTT_CONF_OPTS += --enable-imap
54else
55MUTT_CONF_OPTS += --disable-imap
56endif
57
58ifeq ($(BR2_PACKAGE_MUTT_POP3),y)
59MUTT_CONF_OPTS += --enable-pop
60else
61MUTT_CONF_OPTS += --disable-pop
62endif
63
64# SASL and SSL support are only used by imap or pop3 module
65ifneq ($(BR2_PACKAGE_MUTT_IMAP)$(BR2_PACKAGE_MUTT_POP3),)
66ifeq ($(BR2_PACKAGE_LIBGSASL),y)
67MUTT_DEPENDENCIES += libgsasl
68MUTT_CONF_OPTS += --with-gsasl
69else
70MUTT_CONF_OPTS += --without-gsasl
71endif
72
73ifeq ($(BR2_PACKAGE_OPENSSL),y)
74MUTT_DEPENDENCIES += openssl
75MUTT_CONF_OPTS += \
76	--without-gnutls \
77	--with-ssl=$(STAGING_DIR)/usr
78else ifeq ($(BR2_PACKAGE_GNUTLS),y)
79MUTT_DEPENDENCIES += gnutls
80MUTT_CONF_OPTS += \
81	--with-gnutls=$(STAGING_DIR)/usr \
82	--without-ssl
83else
84MUTT_CONF_OPTS += \
85	--without-gnutls \
86	--without-ssl
87endif
88else
89MUTT_CONF_OPTS += \
90	--without-gsasl \
91	--without-gnutls \
92	--without-ssl
93endif
94
95ifeq ($(BR2_PACKAGE_SQLITE),y)
96MUTT_DEPENDENCIES += sqlite
97MUTT_CONF_OPTS += --with-sqlite3
98else
99MUTT_CONF_OPTS += --without-sqlite3
100endif
101
102ifeq ($(BR2_PACKAGE_ZLIB),y)
103MUTT_DEPENDENCIES += zlib
104MUTT_CONF_OPTS += --with-zlib=$(STAGING_DIR)/usr
105else
106MUTT_CONF_OPTS += --without-zlib
107endif
108
109# Avoid running tests to check for:
110#  - target system is *BSD
111#  - C99 conformance (snprintf, vsnprintf)
112#  - behaviour of the regex library
113#  - if mail spool directory is world/group writable
114#  - we have a working libiconv
115MUTT_CONF_ENV += \
116	mutt_cv_bsdish=no \
117	mutt_cv_c99_snprintf=yes \
118	mutt_cv_c99_vsnprintf=yes \
119	mutt_cv_regex_broken=no \
120	mutt_cv_worldwrite=yes \
121	mutt_cv_groupwrite=yes \
122	mutt_cv_iconv_good=yes \
123	mutt_cv_iconv_nontrans=no
124
125MUTT_CONF_OPTS += --with-mailpath=/var/mail
126
127define MUTT_VAR_MAIL
128	mkdir -p $(TARGET_DIR)/var
129	ln -sf /tmp $(TARGET_DIR)/var/mail
130endef
131MUTT_POST_INSTALL_TARGET_HOOKS += MUTT_VAR_MAIL
132
133$(eval $(autotools-package))
134