git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #84008 from mredaelli/notmuch

notmuch: extract optional dependencies

commited3ec0be54e2950959450d734c6a4f5d74c64abf authorFlorian Klink <flokli@flokli.de> dateFri 3 Apr 2020, 17:57 (7 years ago) parent470b916b6f6fd8
1 file changed+25−12
pkgs/applications/networking/mailreaders/notmuch/default.nix+25−12
pkgs/applications/networking/mailreaders/notmuch/default.nix+25−12
@@ -1,12 +1,13 @@
11{ fetchurl, stdenv
22, pkgconfig, gnupg
33, xapian, gmime, talloc, zlib
4−, doxygen, perl
4+, doxygen, perl, texinfo
55, pythonPackages
66, bash-completion
77, emacs
88, ruby
99, which, dtach, openssl, bash, gdb, man
10+, withEmacs ? true
1011}:
1112
1213with stdenv.lib;
@@ -25,15 +26,20 @@ stdenv.mkDerivation rec {
2526 sha256 = "0dfwa38vgnxk9cvvpza66szjgp8lir6iz6yy0cry9593lywh9xym";
2627 };
2728
28− nativeBuildInputs = [ pkgconfig ];
29+ nativeBuildInputs = [
30+ pkgconfig
31+ doxygen # (optional) api docs
32+ pythonPackages.sphinx # (optional) documentation -> doc/INSTALL
33+ texinfo # (optional) documentation -> doc/INSTALL
34+ bash-completion # (optional) dependency to install bash completion
35+ ] ++ optional withEmacs [ emacs ];
36+
2937 buildInputs = [
30− gnupg # undefined dependencies
38+ gnupg # undefined dependencies
3139 xapian gmime talloc zlib # dependencies described in INSTALL
32− doxygen perl # (optional) api docs
33− pythonPackages.sphinx pythonPackages.python # (optional) documentation -> doc/INSTALL
34− bash-completion # (optional) dependency to install bash completion
35− emacs # (optional) to byte compile emacs code, also needed for tests
36− ruby # (optional) ruby bindings
40+ perl
41+ pythonPackages.python
42+ ruby
3743 ];
3844
3945 postPatch = ''
@@ -42,13 +48,17 @@ stdenv.mkDerivation rec {
4248
4349 substituteInPlace lib/Makefile.local \
4450 --replace '-install_name $(libdir)' "-install_name $out/lib"
45−
51+ '' + optionalString withEmacs ''
4652 substituteInPlace emacs/notmuch-emacs-mua \
4753 --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \
4854 --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient'
4955 '';
5056
51− configureFlags = [ "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" ];
57+ configureFlags = [
58+ "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions"
59+ "--infodir=${placeholder "info"}"
60+ ] ++ optional (!withEmacs) "--without-emacs"
61+ ++ optional (isNull ruby) "--without-ruby";
5262
5363 # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and
5464 # friends
@@ -56,6 +66,9 @@ stdenv.mkDerivation rec {
5666 enableParallelBuilding = true;
5767 makeFlags = [ "V=1" ];
5868
69+
70+ outputs = [ "out" "man" "info" ];
71+
5972 preCheck = let
6073 test-database = fetchurl {
6174 url = "https://notmuchmail.org/releases/test-databases/database-v1.tar.xz";
@@ -68,10 +81,10 @@ stdenv.mkDerivation rec {
6881 checkTarget = "test";
6982 checkInputs = [
7083 which dtach openssl bash
71− gdb man
84+ gdb man emacs
7285 ];
7386
74− installTargets = [ "install" "install-man" ];
87+ installTargets = [ "install" "install-man" "install-info" ];
7588
7689 dontGzipMan = true; # already compressed
7790