diff options
| author | Adam Vandenberg | 2013-02-06 20:43:54 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2013-02-06 20:44:11 -0800 |
| commit | 6951a533d0b75ae39771a488e7ea6008b2dccbc7 (patch) | |
| tree | a5d06e68a69cdcbca1db8d54d95bb0b46d36516c /Library | |
| parent | b39c5a228c9a204670fe287117a1afb1f1993654 (diff) | |
| download | homebrew-6951a533d0b75ae39771a488e7ea6008b2dccbc7.tar.bz2 | |
notmuch: add --emacs option
Closes #15895.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/notmuch.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Library/Formula/notmuch.rb b/Library/Formula/notmuch.rb index 899fcbc23..f357b747d 100644 --- a/Library/Formula/notmuch.rb +++ b/Library/Formula/notmuch.rb @@ -1,10 +1,27 @@ require 'formula' +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 + class Notmuch < Formula homepage 'http://notmuchmail.org' url 'http://notmuchmail.org/releases/notmuch-0.14.tar.gz' sha1 'ad1ef9c2d29cfb0faab7837968d11325dee404bd' + option "emacs", "Install emacs support." + + depends_on NewEnoughEmacs if build.include? "emacs" depends_on 'xapian' depends_on 'talloc' depends_on 'gmime' @@ -15,8 +32,13 @@ class Notmuch < Formula end def install - # requires a newer emacs than OS X provides, so disable the bindings - system "./configure", "--prefix=#{prefix}", "--without-emacs" + args = ["--prefix=#{prefix}"] + if build.include? "emacs" + args << "--with-emacs" + else + args << "--without-emacs" + end + system "./configure", *args system "make install" end end |
