diff options
| author | Peter Eisentraut | 2013-06-06 16:07:10 -0400 |
|---|---|---|
| committer | Adam Vandenberg | 2013-06-08 18:00:11 -0700 |
| commit | e93c776803d6b8c2c96b971307899ad61f09a43c (patch) | |
| tree | f0f0efe8788dffff583f1e948fcb4dc60997cd8c /Library/Formula/gettext.rb | |
| parent | 51733d8dd3592f9c1f986bbeb900f1e92de7e06a (diff) | |
| download | homebrew-e93c776803d6b8c2c96b971307899ad61f09a43c.tar.bz2 | |
gettext: Add Emacs support option
Closes #20313.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/gettext.rb')
| -rw-r--r-- | Library/Formula/gettext.rb | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/Library/Formula/gettext.rb b/Library/Formula/gettext.rb index dc0a8ed71..cb8f41070 100644 --- a/Library/Formula/gettext.rb +++ b/Library/Formula/gettext.rb @@ -1,5 +1,14 @@ require 'formula' +class Emacs < Requirement + fatal true + satisfy { which('emacs') } + + def message + "Emacs support requires Emacs to be installed." + end +end + class Gettext < Formula homepage 'http://www.gnu.org/software/gettext/' url 'http://ftpmirror.gnu.org/gettext/gettext-0.18.2.tar.gz' @@ -15,8 +24,11 @@ class Gettext < Formula end option :universal + option 'with-emacs', 'Build with emacs support' option 'with-examples', 'Keep example files' + depends_on Emacs if build.include? "with-emacs" + def patches unless build.include? 'with-examples' # Use a MacPorts patch to disable building examples at all, @@ -29,17 +41,22 @@ class Gettext < Formula ENV.libxml2 ENV.universal_binary if build.universal? - system "./configure", "--disable-dependency-tracking", - "--disable-debug", - "--prefix=#{prefix}", - "--with-included-gettext", - "--with-included-glib", - "--with-included-libcroco", - "--with-included-libunistring", - "--without-emacs", - # Don't use VCS systems to create these archives - "--without-git", - "--without-cvs" + args = ["--disable-dependency-tracking", + "--disable-debug", + "--prefix=#{prefix}", + "--with-included-gettext", + "--with-included-glib", + "--with-included-libcroco", + "--with-included-libunistring", + # Don't use VCS systems to create these archives + "--without-git", + "--without-cvs"] + if build.include? "with-emacs" + args << "--with-emacs" + else + args << "--without-emacs" + end + system "./configure", *args system "make" ENV.deparallelize # install doesn't support multiple make jobs system "make install" |
