2014-11-15 16:58:40 +00:00
|
|
|
{ fetchurl, stdenv, bash, emacs, fixDarwinDylibNames
|
|
|
|
, gdb, glib, gmime, gnupg
|
|
|
|
, pkgconfig, talloc, xapian
|
|
|
|
, sphinx, python
|
2012-01-21 18:29:11 +00:00
|
|
|
}:
|
2011-02-13 01:34:49 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-05-04 19:49:08 +00:00
|
|
|
name = "notmuch-0.22";
|
2011-02-13 01:34:49 +00:00
|
|
|
|
2015-03-31 05:36:28 +00:00
|
|
|
passthru = {
|
|
|
|
pythonSourceRoot = "${name}/bindings/python";
|
|
|
|
};
|
|
|
|
|
2011-09-21 20:04:43 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://notmuchmail.org/releases/${name}.tar.gz";
|
2016-05-04 19:49:08 +00:00
|
|
|
sha256 = "16mrrw6xpsgip4dy8rfx0zncij5h41fsg2aah6x6z83bjbpihhfn";
|
2011-02-13 01:34:49 +00:00
|
|
|
};
|
|
|
|
|
2015-01-02 20:39:09 +00:00
|
|
|
buildInputs = [ bash emacs glib gmime gnupg pkgconfig talloc xapian sphinx python ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames
|
|
|
|
++ stdenv.lib.optional (!stdenv.isDarwin) gdb;
|
2011-04-18 17:19:44 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
2014-10-17 16:24:27 +00:00
|
|
|
find test -type f -exec \
|
|
|
|
sed -i \
|
|
|
|
"1s_#!/usr/bin/env bash_#!${bash}/bin/bash_" \
|
|
|
|
"{}" ";"
|
2013-04-20 15:02:00 +00:00
|
|
|
|
|
|
|
for src in \
|
|
|
|
crypto.c \
|
2015-07-30 19:59:17 +00:00
|
|
|
notmuch-config.c \
|
2013-04-20 15:02:00 +00:00
|
|
|
emacs/notmuch-crypto.el
|
|
|
|
do
|
|
|
|
substituteInPlace "$src" \
|
|
|
|
--replace \"gpg\" \"${gnupg}/bin/gpg2\"
|
|
|
|
done
|
2011-04-18 17:19:44 +00:00
|
|
|
'';
|
|
|
|
|
2014-11-15 16:58:40 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install-man
|
|
|
|
'';
|
|
|
|
|
2014-10-17 16:27:28 +00:00
|
|
|
preFixup = if stdenv.isDarwin then
|
|
|
|
''
|
2015-12-02 18:56:47 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
die() {
|
|
|
|
>&2 echo "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2014-10-17 16:27:28 +00:00
|
|
|
prg="$out/bin/notmuch"
|
2015-12-02 18:56:47 +00:00
|
|
|
lib="$(find "$out/lib" -name 'libnotmuch.?.dylib')"
|
|
|
|
|
|
|
|
[[ -s "$prg" ]] || die "couldn't find notmuch binary"
|
|
|
|
[[ -s "$lib" ]] || die "couldn't find libnotmuch"
|
|
|
|
|
|
|
|
badname="$(otool -L "$prg" | awk '$1 ~ /libtalloc/ { print $1 }')"
|
|
|
|
goodname="$(find "${talloc}/lib" -name 'libtalloc.?.?.?.dylib')"
|
|
|
|
|
|
|
|
[[ -n "$badname" ]] || die "couldn't find libtalloc reference in binary"
|
|
|
|
[[ -n "$goodname" ]] || die "couldn't find libtalloc in nix store"
|
|
|
|
|
|
|
|
echo "fixing libtalloc link in $lib"
|
|
|
|
install_name_tool -change "$badname" "$goodname" "$lib"
|
|
|
|
|
|
|
|
echo "fixing libtalloc link in $prg"
|
|
|
|
install_name_tool -change "$badname" "$goodname" "$prg"
|
2014-10-17 16:27:28 +00:00
|
|
|
''
|
|
|
|
else
|
|
|
|
"";
|
|
|
|
|
2012-01-21 18:29:11 +00:00
|
|
|
# XXX: emacs tests broken
|
2012-02-07 17:39:59 +00:00
|
|
|
doCheck = false;
|
|
|
|
checkTarget = "test";
|
2011-02-13 01:34:49 +00:00
|
|
|
|
|
|
|
meta = {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Mail indexer";
|
2011-11-20 21:49:06 +00:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2013-02-19 03:46:47 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ chaoflow garbas ];
|
2015-12-02 18:56:47 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2011-02-13 01:34:49 +00:00
|
|
|
};
|
|
|
|
}
|