summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders/notmuch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/mailreaders/notmuch/default.nix')
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix78
1 files changed, 31 insertions, 47 deletions
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index 75ccb93ca95..4304520383e 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -1,60 +1,30 @@
-{ fetchurl, stdenv, bash, emacs, gdb, glib, gmime, gnupg,
-  pkgconfig, talloc, xapian
+{ fetchurl, stdenv, bash, emacs, fixDarwinDylibNames
+, gdb, glib, gmime, gnupg
+, pkgconfig, talloc, xapian
+, sphinx, python
 }:
 
 stdenv.mkDerivation rec {
-  name = "notmuch-0.18.1";
+  name = "notmuch-0.19";
+
+  passthru = {
+    pythonSourceRoot = "${name}/bindings/python";
+  };
 
   src = fetchurl {
     url = "http://notmuchmail.org/releases/${name}.tar.gz";
-    sha256 = "1pdp9l7yv71d3fjb30qyccva8h03hvg88q4a00yi50v2j70kvmgj";
+    sha256 = "1szf6c44g209pcjq5nvfhlp3nzcm3lrcwv4spsxmwy13hiaccvrr";
   };
 
-  buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ];
+  buildInputs = [ bash emacs glib gmime gnupg pkgconfig talloc xapian sphinx python ]
+    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames
+    ++ stdenv.lib.optional (!stdenv.isDarwin) gdb;
 
   patchPhase = ''
-    (cd test && for prg in \
-        aggregate-results.sh \
-        argument-parsing \
-        atomicity \
-        author-order \
-        basic \
-        crypto \
-        count \
-        dump-restore \
-        emacs \
-        emacs-large-search-buffer \
-        encoding \
-        from-guessing \
-        help-test \
-        hooks \
-        json \
-        long-id \
-        maildir-sync \
-        multipart \
-        new \
-        notmuch-test \
-        python \
-        raw \
-        reply \
-        search \
-        search-by-folder \
-        search-insufficient-from-quoting \
-        search-folder-coherence \
-        search-limiting \
-        search-output \
-        search-position-overlap-bug \
-        symbol-hiding \
-        tagging \
-        test-lib.sh \
-        test-verbose \
-        thread-naming \
-        thread-order \
-        uuencode \
-    ;do
-      substituteInPlace "$prg" \
-        --replace "#!/usr/bin/env bash" "#!${bash}/bin/bash"
-    done)
+    find test -type f -exec \
+      sed -i \
+        "1s_#!/usr/bin/env bash_#!${bash}/bin/bash_" \
+        "{}" ";"
 
     for src in \
       crypto.c \
@@ -65,6 +35,20 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  postInstall = ''
+    make install-man
+  '';
+
+  preFixup = if stdenv.isDarwin then
+    ''
+      prg="$out/bin/notmuch"
+      target="libnotmuch.3.dylib"
+      echo "$prg: fixing link to $target"
+      install_name_tool -change "$target" "$out/lib/$target" "$prg"
+    ''
+  else
+    "";
+
   # XXX: emacs tests broken
   doCheck = false;
   checkTarget = "test";