summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-02-13 14:46:12 +0100
committerGitHub <noreply@github.com>2022-02-13 14:46:12 +0100
commit0be937f08bd4d91137a173ddce56cb0b96199915 (patch)
treeef02be12fd9af96e5abb2448915a067561eaa5c7 /pkgs/applications/networking/mailreaders
parent3b19cdd13eb34f68c6173c9430ea1bf25f1bea31 (diff)
parented4ac9fc55a3875cd223a69518e03290d5038497 (diff)
downloadnixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar.gz
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar.bz2
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar.lz
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar.xz
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.tar.zst
nixpkgs-0be937f08bd4d91137a173ddce56cb0b96199915.zip
Merge pull request #155056 from arcnmx/notmuch-ruby
notmuch: install ruby bindings
Diffstat (limited to 'pkgs/applications/networking/mailreaders')
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index 2a95453f7ae..aa46529bdba 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -7,6 +7,7 @@
 , ruby
 , which, dtach, openssl, bash, gdb, man
 , withEmacs ? true
+, withRuby ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -29,15 +30,15 @@ stdenv.mkDerivation rec {
     pythonPackages.sphinx     # (optional) documentation -> doc/INSTALL
     texinfo                   # (optional) documentation -> doc/INSTALL
     pythonPackages.cffi
-  ] ++ lib.optional withEmacs emacs;
+  ] ++ lib.optional withEmacs emacs
+    ++ lib.optional withRuby ruby;
 
   buildInputs = [
     gnupg                     # undefined dependencies
     xapian gmime talloc zlib  # dependencies described in INSTALL
     perl
     pythonPackages.python
-    ruby
-  ];
+  ] ++ lib.optional withRuby ruby;
 
   postPatch = ''
     patchShebangs configure test/
@@ -56,7 +57,7 @@ stdenv.mkDerivation rec {
     "--infodir=${placeholder "info"}/share/info"
   ] ++ lib.optional (!withEmacs) "--without-emacs"
     ++ lib.optional withEmacs "--emacslispdir=${placeholder "emacs"}/share/emacs/site-lisp"
-    ++ lib.optional (isNull ruby) "--without-ruby";
+    ++ lib.optional (!withRuby) "--without-ruby";
 
   # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and
   # friends
@@ -64,7 +65,9 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   makeFlags = [ "V=1" ];
 
-  outputs = [ "out" "man" "info" ] ++ lib.optional withEmacs "emacs";
+  outputs = [ "out" "man" "info" ]
+    ++ lib.optional withEmacs "emacs"
+    ++ lib.optional withRuby "ruby";
 
   preCheck = let
     test-database = fetchurl {
@@ -87,6 +90,12 @@ stdenv.mkDerivation rec {
 
   postInstall = lib.optionalString withEmacs ''
     moveToOutput bin/notmuch-emacs-mua $emacs
+  '' + lib.optionalString withRuby ''
+    make -C bindings/ruby install \
+      vendordir=$ruby/lib/ruby \
+      SHELL=$SHELL \
+      $makeFlags "''${makeFlagsArray[@]}" \
+      $installFlags "''${installFlagsArray[@]}"
   '';
 
   passthru = {