From b6f6fd8d00cbd737c331ef76d297927ae347d5c3 Mon Sep 17 00:00:00 2001 From: Massimo Redaelli Date: Wed, 1 Apr 2020 19:33:53 +0200 Subject: [PATCH] notmuch: extract optional dependencies --- .../mailreaders/notmuch/default.nix | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index ac59dc91646..4e31f2b9996 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -1,12 +1,13 @@ { fetchurl, stdenv , pkgconfig, gnupg , xapian, gmime, talloc, zlib -, doxygen, perl +, doxygen, perl, texinfo , pythonPackages , bash-completion , emacs , ruby , which, dtach, openssl, bash, gdb, man +, withEmacs ? true }: with stdenv.lib; @@ -25,15 +26,20 @@ stdenv.mkDerivation rec { sha256 = "0dfwa38vgnxk9cvvpza66szjgp8lir6iz6yy0cry9593lywh9xym"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ + pkgconfig + doxygen # (optional) api docs + pythonPackages.sphinx # (optional) documentation -> doc/INSTALL + texinfo # (optional) documentation -> doc/INSTALL + bash-completion # (optional) dependency to install bash completion + ] ++ optional withEmacs [ emacs ]; + buildInputs = [ - gnupg # undefined dependencies + gnupg # undefined dependencies xapian gmime talloc zlib # dependencies described in INSTALL - doxygen perl # (optional) api docs - pythonPackages.sphinx pythonPackages.python # (optional) documentation -> doc/INSTALL - bash-completion # (optional) dependency to install bash completion - emacs # (optional) to byte compile emacs code, also needed for tests - ruby # (optional) ruby bindings + perl + pythonPackages.python + ruby ]; postPatch = '' @@ -42,13 +48,17 @@ stdenv.mkDerivation rec { substituteInPlace lib/Makefile.local \ --replace '-install_name $(libdir)' "-install_name $out/lib" - + '' + optionalString withEmacs '' substituteInPlace emacs/notmuch-emacs-mua \ --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \ --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient' ''; - configureFlags = [ "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" ]; + configureFlags = [ + "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" + "--infodir=${placeholder "info"}" + ] ++ optional (!withEmacs) "--without-emacs" + ++ optional (isNull ruby) "--without-ruby"; # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and # friends @@ -56,6 +66,9 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; makeFlags = [ "V=1" ]; + + outputs = [ "out" "man" "info" ]; + preCheck = let test-database = fetchurl { url = "https://notmuchmail.org/releases/test-databases/database-v1.tar.xz"; @@ -68,10 +81,10 @@ stdenv.mkDerivation rec { checkTarget = "test"; checkInputs = [ which dtach openssl bash - gdb man + gdb man emacs ]; - installTargets = [ "install" "install-man" ]; + installTargets = [ "install" "install-man" "install-info" ]; dontGzipMan = true; # already compressed