anchor.diff:      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/
  
positive.code:     "--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";
  
    # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and
    # friends
  
negative.code: 
    postInstall = lib.optionalString withEmacs ''
      moveToOutput bin/notmuch-emacs-mua $emacs
    '' + lib.optionalString withRuby ''
      make -C bindings/ruby install \
        vendordir=$out/lib/ruby \
        SHELL=$SHELL \
        $makeFlags "''${makeFlagsArray[@]}" \
        $installFlags "''${installFlagsArray[@]}"
    '';
  
    passthru = {
  