2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-02 10:46:42 +00:00
|
|
|
|
|
|
|
class Emacs <Formula
|
2010-05-09 04:04:29 +00:00
|
|
|
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.2.tar.bz2'
|
|
|
|
md5 '057a0379f2f6b85fb114d8c723c79ce2'
|
2010-07-01 19:03:04 +00:00
|
|
|
homepage 'http://www.gnu.org/software/emacs/'
|
|
|
|
|
2010-02-28 00:44:05 +00:00
|
|
|
if ARGV.include? "--use-git-head"
|
|
|
|
head 'git://repo.or.cz/emacs.git'
|
|
|
|
else
|
|
|
|
head 'bzr://http://bzr.savannah.gnu.org/r/emacs/trunk'
|
|
|
|
end
|
2009-10-13 07:03:50 +00:00
|
|
|
|
2010-02-14 16:54:36 +00:00
|
|
|
def options
|
|
|
|
[
|
2010-05-09 04:04:29 +00:00
|
|
|
["--cocoa", "Build a Cocoa version of emacs"],
|
2010-07-13 14:44:01 +00:00
|
|
|
["--with-x", "Include X11 support"],
|
2010-02-28 00:44:05 +00:00
|
|
|
["--use-git-head", "Use repo.or.cz git mirror for HEAD builds"],
|
2010-02-14 16:54:36 +00:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2010-07-01 19:03:04 +00:00
|
|
|
def patches
|
2010-11-10 18:16:28 +00:00
|
|
|
"https://github.com/downloads/typester/emacs/feature-fullscreen.patch" if ARGV.include? "--cocoa"
|
2010-07-01 19:03:04 +00:00
|
|
|
end
|
|
|
|
|
2009-10-13 07:03:50 +00:00
|
|
|
def caveats
|
2010-05-11 04:18:41 +00:00
|
|
|
s = ""
|
|
|
|
if ARGV.include? "--cocoa"
|
|
|
|
s += <<-EOS.undent
|
|
|
|
Emacs.app was installed to:
|
|
|
|
#{prefix}
|
|
|
|
|
|
|
|
EOS
|
|
|
|
else
|
|
|
|
s += <<-EOS.undent
|
|
|
|
Use --cocoa to build a Cocoa-specific Emacs.app.
|
|
|
|
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
s += <<-EOS.undent
|
|
|
|
The initial checkout of the bazaar Emacs repository might take a long
|
|
|
|
time. You might find that using the repo.or.cz git mirror is faster,
|
|
|
|
even after the initial checkout. To use the repo.or.cz git mirror for
|
|
|
|
HEAD builds, use the --use-git-head option in addition to --HEAD. Note
|
|
|
|
that there is inevitably some lag between checkins made to the
|
|
|
|
official Emacs bazaar repository and their appearance on the
|
|
|
|
repo.or.cz mirror. See http://repo.or.cz/w/emacs.git for the mirror's
|
|
|
|
status. The Emacs devs do not provide support for the git mirror, and
|
|
|
|
they might reject bug reports filed with git version information. Use
|
|
|
|
it at your own risk.
|
|
|
|
EOS
|
2010-02-28 00:44:05 +00:00
|
|
|
|
2010-05-11 04:18:41 +00:00
|
|
|
return s
|
2009-10-13 07:03:50 +00:00
|
|
|
end
|
2010-07-13 14:45:03 +00:00
|
|
|
|
2009-10-02 10:46:42 +00:00
|
|
|
def install
|
2010-08-18 21:20:22 +00:00
|
|
|
fails_with_llvm "Duplicate symbol errors while linking."
|
|
|
|
|
2010-10-01 02:44:40 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--without-dbus",
|
|
|
|
"--enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp",
|
|
|
|
"--infodir=#{info}/emacs"]
|
2010-02-14 16:54:36 +00:00
|
|
|
|
2009-10-13 07:03:50 +00:00
|
|
|
if ARGV.include? "--cocoa"
|
2010-09-07 12:33:23 +00:00
|
|
|
args << "--with-ns" << "--disable-ns-self-contained"
|
|
|
|
system "./configure", *args
|
2010-02-14 16:54:36 +00:00
|
|
|
system "make bootstrap"
|
|
|
|
system "make install"
|
|
|
|
prefix.install "nextstep/Emacs.app"
|
2010-09-08 15:11:17 +00:00
|
|
|
|
|
|
|
bin.mkpath
|
|
|
|
ln_s prefix+'Emacs.app/Contents/MacOS/Emacs', bin+'emacs'
|
|
|
|
ln_s prefix+'Emacs.app/Contents/MacOS/bin/emacsclient', bin
|
2009-10-13 07:03:50 +00:00
|
|
|
else
|
2010-07-13 14:44:01 +00:00
|
|
|
if ARGV.include? "--with-x"
|
2010-09-07 12:33:23 +00:00
|
|
|
args << "--with-x"
|
|
|
|
args << "--with-gif=no" << "--with-tiff=no" << "--with-jpeg=no"
|
2010-07-13 14:44:01 +00:00
|
|
|
else
|
2010-09-07 12:33:23 +00:00
|
|
|
args << "--without-x"
|
2010-07-13 14:44:01 +00:00
|
|
|
end
|
2010-09-08 15:11:17 +00:00
|
|
|
|
2010-09-07 12:33:23 +00:00
|
|
|
system "./configure", *args
|
2010-02-14 16:54:36 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2009-10-02 10:46:42 +00:00
|
|
|
end
|
|
|
|
end
|