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