3
0
Fork 0
forked from mirrors/nixpkgs

Fix notmuch for darwin, fixes #11410

platforms can be unix; this works on darwin at *least*, after we fix the
libtalloc references.
This commit is contained in:
Burke Libbey 2015-12-02 13:56:47 -05:00 committed by Rok Garbas
parent 3edcc3c669
commit eeb2935ac5

View file

@ -42,10 +42,30 @@ stdenv.mkDerivation rec {
preFixup = if stdenv.isDarwin then
''
set -e
die() {
>&2 echo "$@"
exit 1
}
prg="$out/bin/notmuch"
target="libnotmuch.3.dylib"
echo "$prg: fixing link to $target"
install_name_tool -change "$target" "$out/lib/$target" "$prg"
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"
''
else
"";
@ -58,6 +78,6 @@ stdenv.mkDerivation rec {
description = "Mail indexer";
license = stdenv.lib.licenses.gpl3;
maintainers = with stdenv.lib.maintainers; [ chaoflow garbas ];
platforms = stdenv.lib.platforms.gnu;
platforms = stdenv.lib.platforms.unix;
};
}