3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/mailreaders/mutt/default.nix

97 lines
2.9 KiB
Nix
Raw Normal View History

2021-01-15 05:42:41 +00:00
{ lib, stdenv, fetchurl, fetchpatch, ncurses, which, perl
, gdbm ? null
, openssl ? null
, cyrus_sasl ? null
, gnupg ? null
, gpgme ? null
2021-03-14 16:11:48 +00:00
, libkrb5 ? null
2016-07-09 04:13:52 +01:00
, headerCache ? true
, sslSupport ? true
, saslSupport ? true
, smimeSupport ? false
, gpgSupport ? false
2016-07-09 04:13:52 +01:00
, gpgmeSupport ? true
, imapSupport ? true
2016-09-19 02:53:03 +01:00
, withSidebar ? true
2017-09-04 21:00:30 +01:00
, gssSupport ? true
}:
2016-07-09 04:13:52 +01:00
assert headerCache -> gdbm != null;
assert sslSupport -> openssl != null;
assert saslSupport -> cyrus_sasl != null;
assert smimeSupport -> openssl != null;
assert gpgSupport -> gnupg != null;
assert gpgmeSupport -> gpgme != null && openssl != null;
2016-07-09 04:13:52 +01:00
2021-01-15 05:42:41 +00:00
with lib;
stdenv.mkDerivation rec {
pname = "mutt";
2021-06-17 20:47:57 +01:00
version = "2.1.0";
src = fetchurl {
url = "http://ftp.mutt.org/pub/mutt/${pname}-${version}.tar.gz";
2021-06-17 20:47:57 +01:00
sha256 = "0dqd6gg1wwhxjgdfl8j0kf93mw43kvd6wrwrzkscq2wjrsy5p0w0";
};
patches = optional smimeSupport (fetchpatch {
url = "https://salsa.debian.org/mutt-team/mutt/raw/debian/1.10.1-2/debian/patches/misc/smime.rc.patch";
sha256 = "0b4i00chvx6zj9pcb06x2jysmrcb2znn831lcy32cgfds6gr3nsi";
});
2016-07-09 04:13:52 +01:00
buildInputs =
[ ncurses which perl ]
2016-07-09 04:13:52 +01:00
++ optional headerCache gdbm
++ optional sslSupport openssl
2021-03-14 16:11:48 +00:00
++ optional gssSupport libkrb5
2016-07-09 04:13:52 +01:00
++ optional saslSupport cyrus_sasl
2016-09-19 02:53:03 +01:00
++ optional gpgmeSupport gpgme;
configureFlags = [
2016-07-09 04:13:52 +01:00
(enableFeature headerCache "hcache")
(enableFeature gpgmeSupport "gpgme")
(enableFeature imapSupport "imap")
(enableFeature withSidebar "sidebar")
"--enable-smtp"
"--enable-pop"
"--with-mailpath="
# Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
"ac_cv_path_SENDMAIL=sendmail"
# This allows calls with "-d N", that output debug info into ~/.muttdebug*
"--enable-debug"
# The next allows building mutt without having anything setgid
# set by the installer, and removing the need for the group 'mail'
# I set the value 'mailbox' because it is a default in the configure script
"--with-homespool=mailbox"
2016-07-09 04:13:52 +01:00
] ++ optional sslSupport "--with-ssl"
2017-09-04 21:00:30 +01:00
++ optional gssSupport "--with-gss"
2016-07-09 04:13:52 +01:00
++ optional saslSupport "--with-sasl";
postPatch = optionalString (smimeSupport || gpgmeSupport) ''
sed -i 's#/usr/bin/openssl#${openssl}/bin/openssl#' smime_keys.pl
'';
postInstall = optionalString smimeSupport ''
# S/MIME setup
cp contrib/smime.rc $out/etc/smime.rc
sed -i 's#openssl#${openssl}/bin/openssl#' $out/etc/smime.rc
echo "source $out/etc/smime.rc" >> $out/etc/Muttrc
'' + optionalString gpgSupport ''
# GnuPG setup
cp contrib/gpg.rc $out/etc/gpg.rc
sed -i 's#\(command="\)gpg #\1${gnupg}/bin/gpg #' $out/etc/gpg.rc
echo "source $out/etc/gpg.rc" >> $out/etc/Muttrc
'';
2016-07-09 04:13:52 +01:00
meta = {
description = "A small but very powerful text-based mail client";
homepage = "http://www.mutt.org";
2016-07-09 04:13:52 +01:00
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ rnhmjoj ];
};
}