84 lines
2.7 KiB
Ruby
84 lines
2.7 KiB
Ruby
class Notmuch < Formula
|
|
desc "Thread-based email index, search, and tagging"
|
|
homepage "https://notmuchmail.org"
|
|
url "https://notmuchmail.org/releases/notmuch-0.23.tar.gz"
|
|
sha256 "c5e75b658ee2b58c5ac7a79e34d2449d37ddfa5c9e67a736454ec296c9a0a1b8"
|
|
revision 1
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "9d7eea0d1726bee4c1db877fe98fa7183568fe9f1262864509eaf355d87ae84c" => :sierra
|
|
sha256 "0a3d9be8af8ecfb1357b6e63055f61f7e4b2bba40c221be8ba0f5648f9b4e295" => :el_capitan
|
|
sha256 "36289b9c8994f4487132a397f248fa19acd46d7253f62815d5158da8f56c40f0" => :yosemite
|
|
end
|
|
|
|
option "without-python", "Build without python support"
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gmime"
|
|
depends_on "talloc"
|
|
depends_on "xapian"
|
|
depends_on :emacs => ["21.1", :optional]
|
|
depends_on :python3 => :optional
|
|
depends_on :ruby => ["1.9", :optional]
|
|
|
|
# Requires zlib >= 1.2.5.2
|
|
resource "zlib" do
|
|
url "http://zlib.net/zlib-1.2.8.tar.gz"
|
|
sha256 "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d"
|
|
end
|
|
|
|
# Fix SIP issue with python bindings
|
|
# A more comprehensive patch has been submitted upstream
|
|
# https://notmuchmail.org/pipermail/notmuch/2016/022631.html
|
|
patch :DATA
|
|
|
|
def install
|
|
resource("zlib").stage do
|
|
system "./configure", "--prefix=#{buildpath}/zlib", "--static"
|
|
system "make", "install"
|
|
ENV.append_path "PKG_CONFIG_PATH", "#{buildpath}/zlib/lib/pkgconfig"
|
|
end
|
|
|
|
args = %W[--prefix=#{prefix}]
|
|
|
|
if build.with? "emacs"
|
|
ENV.deparallelize # Emacs and parallel builds aren't friends
|
|
args << "--with-emacs" << "--emacslispdir=#{elisp}" << "--emacsetcdir=#{elisp}"
|
|
else
|
|
args << "--without-emacs"
|
|
end
|
|
|
|
args << "--without-ruby" if build.without? "ruby"
|
|
|
|
system "./configure", *args
|
|
system "make", "V=1", "install"
|
|
|
|
Language::Python.each_python(build) do |python, _version|
|
|
cd "bindings/python" do
|
|
system python, *Language::Python.setup_install_args(prefix)
|
|
end
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/".notmuch-config").write "[database]\npath=#{testpath}/Mail"
|
|
(testpath/"Mail").mkpath
|
|
assert_match "0 total", shell_output("#{bin}/notmuch new")
|
|
end
|
|
end
|
|
|
|
__END__
|
|
diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py
|
|
index b1eec2c..bce5190 100644
|
|
--- a/bindings/python/notmuch/globals.py
|
|
+++ b/bindings/python/notmuch/globals.py
|
|
@@ -25,7 +25,7 @@ from notmuch.version import SOVERSION
|
|
try:
|
|
from os import uname
|
|
if uname()[0] == 'Darwin':
|
|
- nmlib = CDLL("libnotmuch.{0:s}.dylib".format(SOVERSION))
|
|
+ nmlib = CDLL("HOMEBREW_PREFIX/lib/libnotmuch.{0:s}.dylib".format(SOVERSION))
|
|
else:
|
|
nmlib = CDLL("libnotmuch.so.{0:s}".format(SOVERSION))
|
|
except:
|