2011-03-10 05:11:03 +00:00
|
|
|
class Emacs < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "GNU Emacs text editor"
|
2014-10-21 05:26:15 +00:00
|
|
|
homepage "https://www.gnu.org/software/emacs/"
|
2015-04-10 19:51:29 +00:00
|
|
|
url "http://ftpmirror.gnu.org/emacs/emacs-24.5.tar.xz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/emacs/emacs-24.5.tar.xz"
|
|
|
|
sha256 "dd47d71dd2a526cf6b47cb49af793ec2e26af69a0951cc40e43ae290eacfc34e"
|
2010-07-01 19:03:04 +00:00
|
|
|
|
2014-10-21 05:26:15 +00:00
|
|
|
bottle do
|
2015-04-12 00:15:25 +00:00
|
|
|
sha256 "01d4fcc1d234b191849cd10524cd4a987786ee533af5e8b94cbfb1f25387973e" => :yosemite
|
|
|
|
sha256 "db50780fe2e249d68f353d3c1b80aef80d265cb4a726d2e224bfaad1e8632cb7" => :mavericks
|
|
|
|
sha256 "fc28dc93d42840b5483804a68de12a0840c7f78495be79f3912e4e41ae1d1455" => :mountain_lion
|
2014-10-21 05:26:15 +00:00
|
|
|
end
|
|
|
|
|
2014-12-27 00:47:06 +00:00
|
|
|
devel do
|
|
|
|
url "http://git.sv.gnu.org/r/emacs.git", :branch => "emacs-24"
|
2015-04-10 19:51:29 +00:00
|
|
|
version "24.5-dev"
|
2014-12-27 00:47:06 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
end
|
|
|
|
|
2014-02-18 22:49:03 +00:00
|
|
|
head do
|
2014-11-13 20:18:48 +00:00
|
|
|
url "http://git.sv.gnu.org/r/emacs.git"
|
2014-10-14 06:08:54 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
2014-10-14 06:08:54 +00:00
|
|
|
end
|
|
|
|
|
2015-03-19 14:07:51 +00:00
|
|
|
option "with-cocoa", "Build a Cocoa version of emacs"
|
|
|
|
option "with-ctags", "Don't remove the ctags executable that emacs provides"
|
2014-12-31 04:16:32 +00:00
|
|
|
|
2015-03-19 14:07:51 +00:00
|
|
|
deprecated_option "cocoa" => "with-cocoa"
|
|
|
|
deprecated_option "keep-ctags" => "with-ctags"
|
2014-12-31 04:16:32 +00:00
|
|
|
deprecated_option "with-x" => "with-x11"
|
|
|
|
|
2014-10-18 14:57:17 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2014-11-13 18:08:06 +00:00
|
|
|
depends_on :x11 => :optional
|
2014-06-29 10:56:13 +00:00
|
|
|
depends_on "d-bus" => :optional
|
2014-10-18 14:57:17 +00:00
|
|
|
depends_on "gnutls" => :optional
|
2014-06-29 10:56:13 +00:00
|
|
|
depends_on "librsvg" => :optional
|
|
|
|
depends_on "imagemagick" => :optional
|
2014-07-29 17:51:14 +00:00
|
|
|
depends_on "mailutils" => :optional
|
2014-10-21 05:26:15 +00:00
|
|
|
depends_on "glib" => :optional
|
2012-06-07 01:35:12 +00:00
|
|
|
|
2015-03-19 14:07:51 +00:00
|
|
|
# https://github.com/Homebrew/homebrew/issues/37803
|
|
|
|
if build.with? "x11"
|
|
|
|
depends_on "freetype" => :recommended
|
|
|
|
depends_on "fontconfig" => :recommended
|
|
|
|
end
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2334
|
|
|
|
cause "Duplicate symbol errors while linking."
|
2011-11-29 18:02:45 +00:00
|
|
|
end
|
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
def install
|
2010-10-01 02:44:40 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp",
|
|
|
|
"--infodir=#{info}/emacs"]
|
2015-03-19 14:07:51 +00:00
|
|
|
|
2014-06-29 10:56:13 +00:00
|
|
|
args << "--with-file-notification=gfile" if build.with? "glib"
|
2015-03-19 14:07:51 +00:00
|
|
|
|
2014-06-29 10:56:13 +00:00
|
|
|
if build.with? "d-bus"
|
|
|
|
args << "--with-dbus"
|
|
|
|
else
|
|
|
|
args << "--without-dbus"
|
|
|
|
end
|
2015-03-19 14:07:51 +00:00
|
|
|
|
2014-10-18 14:57:17 +00:00
|
|
|
if build.with? "gnutls"
|
|
|
|
args << "--with-gnutls"
|
2013-05-26 12:21:45 +00:00
|
|
|
else
|
2014-10-18 14:57:17 +00:00
|
|
|
args << "--without-gnutls"
|
2013-05-26 12:21:45 +00:00
|
|
|
end
|
2015-03-19 14:07:51 +00:00
|
|
|
|
2014-06-29 10:56:13 +00:00
|
|
|
args << "--with-rsvg" if build.with? "librsvg"
|
|
|
|
args << "--with-imagemagick" if build.with? "imagemagick"
|
2014-07-29 17:51:14 +00:00
|
|
|
args << "--without-popmail" if build.with? "mailutils"
|
2010-02-14 16:54:36 +00:00
|
|
|
|
2015-03-19 14:07:51 +00:00
|
|
|
system "./autogen.sh" if build.head? || build.devel?
|
2011-04-11 16:40:22 +00:00
|
|
|
|
2015-03-19 14:07:51 +00:00
|
|
|
if build.with? "cocoa"
|
2010-09-07 12:33:23 +00:00
|
|
|
args << "--with-ns" << "--disable-ns-self-contained"
|
|
|
|
system "./configure", *args
|
2013-04-27 18:51:03 +00:00
|
|
|
system "make"
|
2014-10-18 14:57:17 +00:00
|
|
|
system "make", "install"
|
2010-02-14 16:54:36 +00:00
|
|
|
prefix.install "nextstep/Emacs.app"
|
2012-06-11 09:27:43 +00:00
|
|
|
|
|
|
|
# Replace the symlink with one that avoids starting Cocoa.
|
|
|
|
(bin/"emacs").unlink # Kill the existing symlink
|
|
|
|
(bin/"emacs").write <<-EOS.undent
|
|
|
|
#!/bin/bash
|
2014-09-14 14:20:37 +00:00
|
|
|
exec #{prefix}/Emacs.app/Contents/MacOS/Emacs -nw "$@"
|
2012-06-11 09:27:43 +00:00
|
|
|
EOS
|
2009-10-13 07:03:50 +00:00
|
|
|
else
|
2014-11-13 18:08:06 +00:00
|
|
|
if build.with? "x11"
|
2012-03-10 18:49:41 +00:00
|
|
|
# These libs are not specified in xft's .pc. See:
|
|
|
|
# https://trac.macports.org/browser/trunk/dports/editors/emacs/Portfile#L74
|
2013-12-14 18:13:11 +00:00
|
|
|
# https://github.com/Homebrew/homebrew/issues/8156
|
2014-10-18 14:57:17 +00:00
|
|
|
ENV.append "LDFLAGS", "-lfreetype -lfontconfig"
|
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
|
2015-07-13 18:38:10 +00:00
|
|
|
args << "--without-ns"
|
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"
|
2014-10-18 14:57:17 +00:00
|
|
|
system "make", "install"
|
2014-10-21 05:26:15 +00:00
|
|
|
end
|
2013-01-02 15:50:52 +00:00
|
|
|
|
2014-10-21 05:26:15 +00:00
|
|
|
# Follow MacPorts and don't install ctags from Emacs. This allows Vim
|
|
|
|
# and Emacs and ctags to play together without violence.
|
2015-03-19 14:07:51 +00:00
|
|
|
if build.without? "ctags"
|
2014-10-21 05:26:15 +00:00
|
|
|
(bin/"ctags").unlink
|
|
|
|
(man1/"ctags.1.gz").unlink
|
2010-02-14 16:54:36 +00:00
|
|
|
end
|
2009-10-02 10:46:42 +00:00
|
|
|
end
|
2011-06-13 20:37:31 +00:00
|
|
|
|
|
|
|
def caveats
|
2015-03-19 14:07:51 +00:00
|
|
|
if build.with? "cocoa" then <<-EOS.undent
|
2014-10-21 05:43:02 +00:00
|
|
|
A command line wrapper for the cocoa app was installed to:
|
|
|
|
#{bin}/emacs
|
2011-06-13 20:37:31 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2014-03-20 04:45:20 +00:00
|
|
|
|
2014-10-21 22:07:20 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{opt_bin}/emacs</string>
|
|
|
|
<string>--daemon</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2014-03-20 04:45:20 +00:00
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "4", shell_output("#{bin}/emacs --batch --eval=\"(print (+ 2 2))\"").strip
|
2014-03-20 04:45:20 +00:00
|
|
|
end
|
2009-10-02 10:46:42 +00:00
|
|
|
end
|