class Notmuch < Formula desc "Thread-based email index, search, and tagging" homepage "https://notmuchmail.org" url "https://notmuchmail.org/releases/notmuch-0.24.2.tar.gz" sha256 "aa76a96684d5c5918d940182b6fe40f7d6745f144476fdda57388479d586cc51" head "git://git.notmuchmail.org/git/notmuch" bottle do cellar :any sha256 "06a9306db0c26b38989d7857901fb405c8afd526fd6440af69e52158f0bb6d3b" => :sierra sha256 "3d29b0dfb986dd17a1aec423a7cce1b335155a5e31cdc21f09285c8165303c18" => :el_capitan sha256 "5784e44063cdd04a095db78811c16f002f997670705f217b462657c9779869a3" => :yosemite end option "without-python", "Build without python support" depends_on "pkg-config" => :build depends_on "libgpg-error" => :build depends_on "glib" depends_on "talloc" depends_on "xapian" depends_on "zlib" depends_on :emacs => ["24.1", :optional] depends_on :python3 => :optional depends_on :ruby => ["1.9", :optional] # Currently requires gmime 2.6.x resource "gmime" do url "https://download.gnome.org/sources/gmime/2.6/gmime-2.6.23.tar.xz" sha256 "7149686a71ca42a1390869b6074815106b061aaeaaa8f2ef8c12c191d9a79f6a" 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("gmime").stage do system "./configure", "--prefix=#{prefix}/gmime", "--disable-introspection" system "make", "install" ENV.append_path "PKG_CONFIG_PATH", "#{prefix}/gmime/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: