homebrew-core/Formula/emacs.rb
Drew Hess f9e9b70a94 Emacs - Install info files to separate folder
By default, Emacs installs its info files in /usr/local/share/info.
This works fine until you try to install an updated version of an
elisp package that is bundled with Emacs (e.g., org-mode), at which
point the updated package will overwrite the info file that came
bundled with Emacs.  This is not ideal, but it works, since Emacs will
see the updated info file -- that is, until you decide to uninstall
the elisp package (removing the info file for the package altogether),
or you rebuild Emacs (overwriting the new package's info file with the
stale one that comes bundled with Emacs).

This patch makes the Emacs formula install Emacs's info files
in #{prefix}/share/info/emacs, so that updated elisp packages' info
files will not conflict with Emacs's. Then it's just a simple matter
of setting Info-directory-list in your .emacs file so that Emacs will
find the updated info file.

This method mimics the Debian behavior for Emacs info directories.

Note that Emacs will look for info files in the configured --infodir
by default, so there's no need for a caveat re: the INFOPATH
environment variable.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2010-11-07 08:32:46 -08:00

88 lines
2.5 KiB
Ruby

require 'formula'
class Emacs <Formula
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.2.tar.bz2'
md5 '057a0379f2f6b85fb114d8c723c79ce2'
homepage 'http://www.gnu.org/software/emacs/'
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
def options
[
["--cocoa", "Build a Cocoa version of emacs"],
["--with-x", "Include X11 support"],
["--use-git-head", "Use repo.or.cz git mirror for HEAD builds"],
]
end
def patches
"http://github.com/downloads/typester/emacs/feature-fullscreen.patch" if ARGV.include? "--cocoa"
end
def caveats
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
return s
end
def install
fails_with_llvm "Duplicate symbol errors while linking."
args = ["--prefix=#{prefix}",
"--without-dbus",
"--enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp",
"--infodir=#{info}/emacs"]
if ARGV.include? "--cocoa"
args << "--with-ns" << "--disable-ns-self-contained"
system "./configure", *args
system "make bootstrap"
system "make install"
prefix.install "nextstep/Emacs.app"
bin.mkpath
ln_s prefix+'Emacs.app/Contents/MacOS/Emacs', bin+'emacs'
ln_s prefix+'Emacs.app/Contents/MacOS/bin/emacsclient', bin
else
if ARGV.include? "--with-x"
args << "--with-x"
args << "--with-gif=no" << "--with-tiff=no" << "--with-jpeg=no"
else
args << "--without-x"
end
system "./configure", *args
system "make"
system "make install"
end
end
end