2010-11-22 00:05:43 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2013-02-07 04:43:54 +00:00
|
|
|
class NewEnoughEmacs < Requirement
|
|
|
|
fatal true
|
|
|
|
|
|
|
|
def satisfied?
|
|
|
|
`emacs --version`.split("\n")[0] =~ /GNU Emacs (\d+)\./
|
|
|
|
major_version = ($1 || 0).to_i
|
|
|
|
major_version >= 23
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"Emacs support requires at least Emacs 23."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-11-22 00:05:43 +00:00
|
|
|
class Notmuch < Formula
|
|
|
|
homepage 'http://notmuchmail.org'
|
2013-02-07 04:39:06 +00:00
|
|
|
url 'http://notmuchmail.org/releases/notmuch-0.14.tar.gz'
|
|
|
|
sha1 'ad1ef9c2d29cfb0faab7837968d11325dee404bd'
|
2010-11-22 00:05:43 +00:00
|
|
|
|
2013-02-07 04:43:54 +00:00
|
|
|
option "emacs", "Install emacs support."
|
|
|
|
|
|
|
|
depends_on NewEnoughEmacs if build.include? "emacs"
|
2013-02-14 19:13:50 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-11-22 00:05:43 +00:00
|
|
|
depends_on 'xapian'
|
|
|
|
depends_on 'talloc'
|
|
|
|
depends_on 'gmime'
|
|
|
|
|
2013-01-30 18:56:37 +00:00
|
|
|
fails_with :clang do
|
|
|
|
cause "./lib/notmuch-private.h:478:8: error: visibility does not match previous declaration"
|
|
|
|
end
|
|
|
|
|
2010-11-22 00:05:43 +00:00
|
|
|
def install
|
2013-02-07 04:43:54 +00:00
|
|
|
args = ["--prefix=#{prefix}"]
|
|
|
|
if build.include? "emacs"
|
|
|
|
args << "--with-emacs"
|
|
|
|
else
|
|
|
|
args << "--without-emacs"
|
|
|
|
end
|
|
|
|
system "./configure", *args
|
2013-04-19 18:21:29 +00:00
|
|
|
|
|
|
|
if ARGV.verbose?
|
|
|
|
system "make install V=1"
|
|
|
|
else
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-11-22 00:05:43 +00:00
|
|
|
end
|
|
|
|
end
|