2018-11-05 19:47:10 +01:00
|
|
|
{ fetchurl, stdenv
|
2016-11-20 17:55:28 +01:00
|
|
|
, pkgconfig, gnupg
|
|
|
|
, xapian, gmime, talloc, zlib
|
2020-04-01 19:33:53 +02:00
|
|
|
, doxygen, perl, texinfo
|
2018-12-16 18:04:16 +01:00
|
|
|
, pythonPackages
|
2016-11-20 17:55:28 +01:00
|
|
|
, emacs
|
|
|
|
, ruby
|
2017-09-01 02:01:42 +02:00
|
|
|
, which, dtach, openssl, bash, gdb, man
|
2020-04-01 19:33:53 +02:00
|
|
|
, withEmacs ? true
|
2012-01-21 19:29:11 +01:00
|
|
|
}:
|
2011-02-13 02:34:49 +01:00
|
|
|
|
2017-09-01 02:01:42 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2011-02-13 02:34:49 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2020-02-06 20:01:04 +01:00
|
|
|
version = "0.29.3";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "notmuch";
|
2011-02-13 02:34:49 +01:00
|
|
|
|
2015-03-31 07:36:28 +02:00
|
|
|
passthru = {
|
2019-08-15 14:41:18 +02:00
|
|
|
pythonSourceRoot = "${pname}-${version}/bindings/python";
|
2016-08-02 08:59:41 +02:00
|
|
|
inherit version;
|
2015-03-31 07:36:28 +02:00
|
|
|
};
|
|
|
|
|
2011-09-21 22:04:43 +02:00
|
|
|
src = fetchurl {
|
2019-08-31 19:27:31 +02:00
|
|
|
url = "https://notmuchmail.org/releases/${pname}-${version}.tar.xz";
|
2020-02-06 20:01:04 +01:00
|
|
|
sha256 = "0dfwa38vgnxk9cvvpza66szjgp8lir6iz6yy0cry9593lywh9xym";
|
2011-02-13 02:34:49 +01:00
|
|
|
};
|
|
|
|
|
2020-04-01 19:33:53 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
doxygen # (optional) api docs
|
|
|
|
pythonPackages.sphinx # (optional) documentation -> doc/INSTALL
|
|
|
|
texinfo # (optional) documentation -> doc/INSTALL
|
|
|
|
] ++ optional withEmacs [ emacs ];
|
|
|
|
|
2016-11-20 17:55:28 +01:00
|
|
|
buildInputs = [
|
2020-04-01 19:33:53 +02:00
|
|
|
gnupg # undefined dependencies
|
2016-11-20 17:55:28 +01:00
|
|
|
xapian gmime talloc zlib # dependencies described in INSTALL
|
2020-04-01 19:33:53 +02:00
|
|
|
perl
|
|
|
|
pythonPackages.python
|
|
|
|
ruby
|
2018-11-05 19:47:10 +01:00
|
|
|
];
|
2016-11-20 17:55:28 +01:00
|
|
|
|
2017-09-01 02:01:42 +02:00
|
|
|
postPatch = ''
|
2018-03-19 19:35:46 +01:00
|
|
|
patchShebangs configure
|
2018-11-05 19:47:10 +01:00
|
|
|
patchShebangs test/
|
2013-04-20 17:02:00 +02:00
|
|
|
|
2018-11-05 19:47:10 +01:00
|
|
|
substituteInPlace lib/Makefile.local \
|
|
|
|
--replace '-install_name $(libdir)' "-install_name $out/lib"
|
2020-04-01 19:33:53 +02:00
|
|
|
'' + optionalString withEmacs ''
|
2019-08-31 20:20:48 +02:00
|
|
|
substituteInPlace emacs/notmuch-emacs-mua \
|
|
|
|
--replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \
|
|
|
|
--replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient'
|
2011-04-18 19:19:44 +02:00
|
|
|
'';
|
|
|
|
|
2020-04-01 19:33:53 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions"
|
2020-04-07 17:36:40 +02:00
|
|
|
"--bashcompletiondir=${placeholder "out"}/share/bash-completion/completions"
|
2020-05-02 11:20:00 +02:00
|
|
|
"--infodir=${placeholder "info"}/share/info"
|
2020-04-01 19:33:53 +02:00
|
|
|
] ++ optional (!withEmacs) "--without-emacs"
|
2020-04-07 21:31:23 +02:00
|
|
|
++ optional (withEmacs) "--emacslispdir=${placeholder "emacs"}/share/emacs/site-lisp"
|
2020-04-01 19:33:53 +02:00
|
|
|
++ optional (isNull ruby) "--without-ruby";
|
2018-10-13 07:17:22 +02:00
|
|
|
|
2018-02-24 05:23:58 +01:00
|
|
|
# Notmuch doesn't use autoconf and consequently doesn't tag --bindir and
|
|
|
|
# friends
|
|
|
|
setOutputFlags = false;
|
|
|
|
enableParallelBuilding = true;
|
2019-05-06 19:21:14 +02:00
|
|
|
makeFlags = [ "V=1" ];
|
2017-09-01 02:01:42 +02:00
|
|
|
|
2020-04-01 19:33:53 +02:00
|
|
|
|
2020-04-07 21:31:23 +02:00
|
|
|
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional withEmacs "emacs";
|
2020-04-01 19:33:53 +02:00
|
|
|
|
2018-10-04 18:06:12 +02:00
|
|
|
preCheck = let
|
|
|
|
test-database = fetchurl {
|
|
|
|
url = "https://notmuchmail.org/releases/test-databases/database-v1.tar.xz";
|
|
|
|
sha256 = "1lk91s00y4qy4pjh8638b5lfkgwyl282g1m27srsf7qfn58y16a2";
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
ln -s ${test-database} test/test-databases/database-v1.tar.xz
|
|
|
|
'';
|
2019-08-31 19:27:31 +02:00
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin && (versionAtLeast gmime.version "3.0.3");
|
2018-11-05 19:47:10 +01:00
|
|
|
checkTarget = "test";
|
|
|
|
checkInputs = [
|
|
|
|
which dtach openssl bash
|
2020-04-01 19:33:53 +02:00
|
|
|
gdb man emacs
|
2018-11-05 19:47:10 +01:00
|
|
|
];
|
|
|
|
|
2020-04-01 19:33:53 +02:00
|
|
|
installTargets = [ "install" "install-man" "install-info" ];
|
2017-09-01 02:01:42 +02:00
|
|
|
|
2020-04-07 21:31:23 +02:00
|
|
|
postInstall = stdenv.lib.optionalString withEmacs ''
|
|
|
|
moveToOutput bin/notmuch-emacs-mua $emacs
|
|
|
|
'';
|
|
|
|
|
2017-02-14 15:54:10 +01:00
|
|
|
dontGzipMan = true; # already compressed
|
2011-02-13 02:34:49 +01:00
|
|
|
|
2017-09-01 02:01:42 +02:00
|
|
|
meta = {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Mail indexer";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://notmuchmail.org/";
|
2017-04-10 16:00:25 +02:00
|
|
|
license = licenses.gpl3;
|
2020-05-09 11:25:07 +02:00
|
|
|
maintainers = with maintainers; [ flokli puckipedia ];
|
2017-04-10 16:00:25 +02:00
|
|
|
platforms = platforms.unix;
|
2011-02-13 02:34:49 +01:00
|
|
|
};
|
|
|
|
}
|