aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/emacs.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-08-27 21:40:12 -0700
committerAdam Vandenberg2012-08-27 21:40:12 -0700
commit9a2ea229dd4558971f14f254e539d36b837f097f (patch)
tree6c832d2a6dc4cd5b0518ab17e9d5d35c0d5a0d06 /Library/Formula/emacs.rb
parentbfcf5dd50a66a3b1c26b69b89a009016ad5618eb (diff)
downloadhomebrew-9a2ea229dd4558971f14f254e539d36b837f097f.tar.bz2
emacs: use new dsl
Diffstat (limited to 'Library/Formula/emacs.rb')
-rw-r--r--Library/Formula/emacs.rb34
1 files changed, 15 insertions, 19 deletions
diff --git a/Library/Formula/emacs.rb b/Library/Formula/emacs.rb
index 66119fa70..c51515e68 100644
--- a/Library/Formula/emacs.rb
+++ b/Library/Formula/emacs.rb
@@ -6,13 +6,18 @@ class Emacs < Formula
mirror 'http://ftp.gnu.org/pub/gnu/emacs/emacs-24.1.tar.bz2'
sha1 'ab22d5bf2072d04faa4aebf819fef3dfe44aacca'
- if ARGV.include? "--use-git-head"
+ option "cocoa", "Build a Cocoa version of emacs"
+ option "srgb", "Enable sRGB colors in the Cocoa version of emacs"
+ option "with-x", "Include X11 support"
+ option "use-git-head", "Use Savannah git mirror for HEAD builds"
+
+ if build.include? "use-git-head"
head 'http://git.sv.gnu.org/r/emacs.git'
else
head 'bzr://http://bzr.savannah.gnu.org/r/emacs/trunk'
end
- depends_on :x11 if ARGV.include? "--with-x"
+ depends_on :x11 if build.include? "with-x"
# Stripping on Xcode 4 causes malformed object errors.
# Just skip everything.
@@ -23,18 +28,9 @@ class Emacs < Formula
cause "Duplicate symbol errors while linking."
end
- def options
- [
- ["--cocoa", "Build a Cocoa version of emacs"],
- ["--srgb", "Enable sRGB colors in the Cocoa version of emacs"],
- ["--with-x", "Include X11 support"],
- ["--use-git-head", "Use Savannah git mirror for HEAD builds"],
- ]
- end
-
def patches
- if ARGV.include? "--cocoa"
- # Fullscreen patch, works against 23.3 and HEAD.
+ if build.include? "cocoa"
+ # Fullscreen patch, works against 24.1 and HEAD.
"https://raw.github.com/gist/1746342/702dfe9e2dd79fddd536aa90d561efdeec2ba716"
end
end
@@ -42,23 +38,23 @@ class Emacs < Formula
def install
# HEAD builds are currently blowing up when built in parallel
# as of April 20 2012
- ENV.j1 if ARGV.build_head?
+ ENV.j1 if build.head?
args = ["--prefix=#{prefix}",
"--without-dbus",
"--enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp",
"--infodir=#{info}/emacs"]
- if ARGV.build_head? and File.exists? "./autogen/copy_autogen"
+ if build.head? and File.exists? "./autogen/copy_autogen"
opoo "Using copy_autogen"
puts "See https://github.com/mxcl/homebrew/issues/4852"
system "autogen/copy_autogen"
end
- if ARGV.include? "--cocoa"
+ if build.include? "cocoa"
# Patch for color issues described here:
# http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8402
- if ARGV.include? "--srgb"
+ if build.include? "srgb"
inreplace "src/nsterm.m",
"*col = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: 1.0];",
"*col = [NSColor colorWithDeviceRed: r green: g blue: b alpha: 1.0];"
@@ -70,7 +66,7 @@ class Emacs < Formula
system "make install"
prefix.install "nextstep/Emacs.app"
else
- if ARGV.include? "--with-x"
+ if build.include? "with-x"
# These libs are not specified in xft's .pc. See:
# https://trac.macports.org/browser/trunk/dports/editors/emacs/Portfile#L74
# https://github.com/mxcl/homebrew/issues/8156
@@ -89,7 +85,7 @@ class Emacs < Formula
def caveats
s = ""
- if ARGV.include? "--cocoa"
+ if build.include? "cocoa"
s += <<-EOS.undent
Emacs.app was installed to:
#{prefix}