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

105 lines
2.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, gettext, makeWrapper, tcl, which, writeScript
2018-02-25 02:45:34 +01:00
, ncurses, perl , cyrus_sasl, gss, gpgme, kerberos, libidn, libxml2, notmuch, openssl
, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42, w3m, mailcap, runtimeShell, sqlite, zlib
, glibcLocales
, fetchpatch
}:
stdenv.mkDerivation rec {
version = "20201127";
pname = "neomutt";
src = fetchFromGitHub {
2017-05-07 04:39:08 +02:00
owner = "neomutt";
repo = "neomutt";
rev = version;
sha256 = "sha256-BkDGKZmpwahDw1vD67CyWfxD93H83kcpv5JBGVL5F/o=";
};
2017-06-02 15:41:03 +02:00
buildInputs = [
2017-06-29 04:43:09 +02:00
cyrus_sasl gss gpgme kerberos libidn ncurses
notmuch openssl perl lmdb
mailcap sqlite
2017-06-02 15:41:03 +02:00
];
nativeBuildInputs = [
docbook_xsl docbook_xml_dtd_42 gettext libxml2 libxslt.bin makeWrapper tcl which zlib w3m
];
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 send/sendlib.c \
--replace /etc/mime.types ${mailcap}/etc/mime.types
'';
preBuild = ''
export HOME=$(mktemp -d)
'';
configureFlags = [
"--enable-autocrypt"
"--gpgme"
"--gss"
"--lmdb"
"--notmuch"
"--ssl"
"--sasl"
"--with-homespool=mailbox"
"--with-mailpath="
# To make it not reference .dev outputs. See:
# https://github.com/neomutt/neomutt/pull/2367
"--disable-include-path-in-cflags"
# Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
"ac_cv_path_SENDMAIL=sendmail"
"--zlib"
];
2017-09-22 14:03:35 +02: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 = ''
wrapProgram "$out/bin/neomutt" --prefix PATH : "$out/libexec/neomutt"
'';
2017-06-02 15:41:03 +02:00
2018-02-25 02:45:34 +01:00
doCheck = true;
preCheck = ''
cp -r ${fetchFromGitHub {
owner = "neomutt";
repo = "neomutt-test-files";
rev = "8629adab700a75c54e8e28bf05ad092503a98f75";
sha256 = "1ci04nqkab9mh60zzm66sd6mhsr6lya8wp92njpbvafc86vvwdlr";
}} $(pwd)/test-files
chmod -R +w test-files
(cd test-files && ./setup.sh)
export NEOMUTT_TEST_DIR=$(pwd)/test-files
'';
2018-02-25 02:45:34 +01:00
checkTarget = "test";
postCheck = "unset NEOMUTT_TEST_DIR";
2018-02-25 02:45:34 +01:00
meta = with lib; {
description = "A small but very powerful text-based mail client";
homepage = "http://www.neomutt.org";
2017-09-14 08:42:25 +02:00
license = licenses.gpl2Plus;
maintainers = with maintainers; [ cstrahan erikryb jfrankenau vrthra ma27 ];
2017-09-09 03:30:41 +02:00
platforms = platforms.unix;
};
}