about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMassimo Redaelli <massimo@typish.io>2020-04-01 19:33:53 +0200
committerMassimo Redaelli <massimo@typish.io>2020-04-03 16:41:27 +0200
commitb6f6fd8d00cbd737c331ef76d297927ae347d5c3 (patch)
tree80c1cd972d7948700b14fabfc1445219f21a57b6 /pkgs
parent8ce84989d9038117101fa91f41a17ed6bbb16b09 (diff)
downloadnixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar.gz
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar.bz2
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar.lz
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar.xz
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.tar.zst
nixlib-b6f6fd8d00cbd737c331ef76d297927ae347d5c3.zip
notmuch: extract optional dependencies
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix37
1 files changed, 25 insertions, 12 deletions
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index ac59dc91646e..4e31f2b99968 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