2011-08-12 10:10:04 +00:00
|
|
|
class Auctex < Formula
|
2015-01-28 07:43:22 +00:00
|
|
|
homepage "https://www.gnu.org/software/auctex/"
|
|
|
|
url "http://ftpmirror.gnu.org/auctex/auctex-11.88.tar.gz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/auctex/auctex-11.88.tar.gz"
|
|
|
|
sha1 "098a9751c4e00812e61d62a0184a07d9753904df"
|
2011-08-12 10:10:04 +00:00
|
|
|
|
2013-09-21 23:33:41 +00:00
|
|
|
head do
|
2015-01-28 07:43:22 +00:00
|
|
|
url "git://git.savannah.gnu.org/auctex.git"
|
2014-12-04 22:37:59 +00:00
|
|
|
depends_on "autoconf" => :build
|
2013-09-21 23:33:41 +00:00
|
|
|
end
|
2013-07-14 10:46:08 +00:00
|
|
|
|
2012-12-29 00:48:31 +00:00
|
|
|
depends_on :tex
|
2013-07-14 10:46:08 +00:00
|
|
|
|
2013-07-07 18:51:33 +00:00
|
|
|
option "with-emacs=", "Path to an emacs binary"
|
2011-08-12 10:10:04 +00:00
|
|
|
|
|
|
|
def which_emacs
|
2015-01-28 07:43:22 +00:00
|
|
|
emacs = ARGV.value("with-emacs") || which("emacs").to_s
|
|
|
|
fail "#{emacs} not found" unless File.exist? emacs
|
|
|
|
emacs
|
2011-08-12 10:10:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
# configure fails if the texmf dir is not there yet
|
2015-01-28 07:43:22 +00:00
|
|
|
brew_texmf = share/"texmf"
|
2011-08-12 10:10:04 +00:00
|
|
|
brew_texmf.mkpath
|
|
|
|
|
2013-07-14 10:46:08 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
|
|
|
|
2012-03-01 04:42:09 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--with-texmf-dir=#{brew_texmf}",
|
|
|
|
"--with-emacs=#{which_emacs}",
|
|
|
|
"--with-lispdir=#{share}/emacs/site-lisp"
|
2011-08-12 10:10:04 +00:00
|
|
|
|
|
|
|
system "make"
|
2011-08-27 18:55:51 +00:00
|
|
|
ENV.deparallelize # Needs a serialized install
|
2015-01-28 07:43:22 +00:00
|
|
|
system "make", "install"
|
2011-08-12 10:10:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
# check if the used emacs is in HOMEBREW_PREFIX/bin
|
|
|
|
# for which case HOMEBREW_PREFIX/share/emacs/site-lisp should already
|
|
|
|
# be by default in the load-path
|
|
|
|
if which_emacs.index("#{HOMEBREW_PREFIX}/bin")
|
|
|
|
dot_emacs = <<-EOS
|
2012-03-01 04:42:09 +00:00
|
|
|
(require 'tex-site)
|
2011-08-12 10:10:04 +00:00
|
|
|
EOS
|
|
|
|
else
|
|
|
|
dot_emacs = <<-EOS
|
2012-03-01 04:42:09 +00:00
|
|
|
(add-to-list 'load-path "#{HOMEBREW_PREFIX}/share/emacs/site-lisp")
|
|
|
|
(require 'tex-site)
|
2011-08-12 10:10:04 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2011-08-30 16:55:37 +00:00
|
|
|
<<-EOS.undent
|
2012-03-01 04:42:09 +00:00
|
|
|
texmf files installed into:
|
|
|
|
#{HOMEBREW_PREFIX}/share/texmf/
|
|
|
|
|
|
|
|
You can add it to your TEXMFHOME using:
|
|
|
|
sudo tlmgr conf texmf TEXMFHOME "~/Library/texmf:#{HOMEBREW_PREFIX}/share/texmf"
|
|
|
|
|
|
|
|
Emacs package installed into:
|
|
|
|
#{HOMEBREW_PREFIX}/share/emacs/site-lisp
|
2011-08-12 10:10:04 +00:00
|
|
|
|
2012-03-01 04:42:09 +00:00
|
|
|
To activate, add the following to your .emacs:
|
2011-08-12 10:10:04 +00:00
|
|
|
#{dot_emacs}
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|