nixpkgs/pkgs/applications/networking/mailreaders/neomutt/default.nix

97 lines
3.0 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, gettext, makeWrapper, tcl, which, writeScript
2018-02-25 01:45:34 +00:00
, ncurses, perl , cyrus_sasl, gss, gpgme, kerberos, libidn, libxml2, notmuch, openssl
, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42, mime-types }:
let
muttWrapper = writeScript "mutt" ''
#!${stdenv.shell} -eu
echo 'The neomutt project has renamed the main binary from `mutt` to `neomutt`.'
echo ""
echo 'This wrapper is provided for compatibility purposes only. You should start calling `neomutt` instead.'
echo ""
read -p 'Press any key to launch NeoMutt...' -n1 -s
exec neomutt "$@"
'';
in stdenv.mkDerivation rec {
version = "20180716";
name = "neomutt-${version}";
src = fetchFromGitHub {
2017-05-07 03:39:08 +01:00
owner = "neomutt";
repo = "neomutt";
rev = "neomutt-${version}";
sha256 = "0im2kkahkr04q04irvcimfawxi531ld6wrsa92r2m7l10gmijkl8";
};
2017-06-02 14:41:03 +01:00
buildInputs = [
2017-06-29 03:43:09 +01:00
cyrus_sasl gss gpgme kerberos libidn ncurses
notmuch openssl perl lmdb
mime-types
2017-06-02 14:41:03 +01:00
];
nativeBuildInputs = [
2018-02-25 01:45:34 +00:00
docbook_xsl docbook_xml_dtd_42 gettext libxml2 libxslt.bin makeWrapper tcl which
];
enableParallelBuilding = true;
postPatch = ''
substituteInPlace contrib/smime_keys \
--replace /usr/bin/openssl ${openssl}/bin/openssl
for f in doc/*.{xml,xsl}* ; do
substituteInPlace $f \
--replace http://docbook.sourceforge.net/release/xsl/current ${docbook_xsl}/share/xml/docbook-xsl \
--replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
done
# allow neomutt to map attachments to their proper mime.types if specified wrongly
# and use a far more comprehensive list than the one shipped with neomutt
substituteInPlace sendlib.c \
--replace /etc/mime.types ${mime-types}/etc/mime.types
2018-02-25 01:45:34 +00:00
# The string conversion tests all fail with the first version of neomutt
# that has tests (20180223) as well as 20180716 so we disable them for now.
2018-02-25 01:45:34 +00:00
# I don't know if that is related to the tests or our build environment.
# Try again with a later release.
sed -i '/rfc2047/d' test/Makefile.autosetup test/main.c
'';
configureFlags = [
"--gpgme"
"--gss"
"--lmdb"
"--notmuch"
"--ssl"
"--sasl"
"--with-homespool=mailbox"
"--with-mailpath="
# Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
"ac_cv_path_SENDMAIL=sendmail"
];
2017-09-22 13:03:35 +01:00
# Fix missing libidn in mutt;
# this fix is ugly since it links all binaries in mutt against libidn
# like pgpring, pgpewrap, ...
NIX_LDFLAGS = "-lidn";
postInstall = ''
cp ${muttWrapper} $out/bin/mutt
wrapProgram "$out/bin/neomutt" --prefix PATH : "$out/libexec/neomutt"
'';
2017-06-02 14:41:03 +01:00
2018-02-25 01:45:34 +00:00
doCheck = true;
checkTarget = "test";
meta = with stdenv.lib; {
description = "A small but very powerful text-based mail client";
2017-09-09 02:30:41 +01:00
homepage = http://www.neomutt.org;
2017-09-14 07:42:25 +01:00
license = licenses.gpl2Plus;
2017-06-29 03:43:09 +01:00
maintainers = with maintainers; [ cstrahan erikryb jfrankenau vrthra ];
2017-09-09 02:30:41 +01:00
platforms = platforms.unix;
};
}