From cb3343c48ae2ba8f84ad9b3a0dc161d4f9f2d61f Mon Sep 17 00:00:00 2001 From: Patrick Mahoney Date: Fri, 17 Oct 2014 11:24:27 -0500 Subject: [PATCH 1/2] notmuch: Use 'find' to patch test script shebangs. --- .../mailreaders/notmuch/default.nix | 46 ++----------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index 75ccb93ca95..72c7d2a249a 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -13,48 +13,10 @@ stdenv.mkDerivation rec { buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ]; 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 \ From bbce2e088967643a1d6d1fd0dbd3cb00e490b3e8 Mon Sep 17 00:00:00 2001 From: Patrick Mahoney Date: Fri, 17 Oct 2014 11:27:28 -0500 Subject: [PATCH 2/2] notmuch: Dynamic link to absolute path on darwin. --- .../networking/mailreaders/notmuch/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index 72c7d2a249a..097398eb174 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -1,4 +1,5 @@ -{ fetchurl, stdenv, bash, emacs, gdb, glib, gmime, gnupg, +{ fetchurl, stdenv, bash, emacs, fixDarwinDylibNames, + gdb, glib, gmime, gnupg, pkgconfig, talloc, xapian }: @@ -10,7 +11,8 @@ stdenv.mkDerivation rec { sha256 = "1pdp9l7yv71d3fjb30qyccva8h03hvg88q4a00yi50v2j70kvmgj"; }; - buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ]; + buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ] + ++ stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; patchPhase = '' find test -type f -exec \ @@ -27,6 +29,16 @@ stdenv.mkDerivation rec { done ''; + 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";