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