homebrew-core/Formula/auctex.rb

71 lines
1.9 KiB
Ruby
Raw Normal View History

require 'formula'
class Auctex < Formula
homepage 'http://www.gnu.org/software/auctex/'
url 'http://ftpmirror.gnu.org/auctex/auctex-11.87.tar.gz'
mirror 'http://ftp.gnu.org/gnu/auctex/auctex-11.87.tar.gz'
sha1 '0be92c7d8f89d57346fe07f05a1a045ffd11cd71'
2013-09-21 23:33:41 +00:00
head do
url 'git://git.savannah.gnu.org/auctex.git'
depends_on :autoconf
end
depends_on :tex
2013-07-07 18:51:33 +00:00
option "with-emacs=", "Path to an emacs binary"
def which_emacs
2013-07-07 18:51:33 +00:00
emacs = ARGV.value('with-emacs') || which('emacs').to_s
2013-12-09 19:44:45 +00:00
raise "#{emacs} not found" unless File.exist? emacs
2013-07-07 18:51:33 +00:00
return emacs
end
def install
# configure fails if the texmf dir is not there yet
2012-03-01 04:42:09 +00:00
brew_texmf = share + 'texmf'
brew_texmf.mkpath
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"
system "make"
ENV.deparallelize # Needs a serialized install
system "make install"
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)
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)
EOS
end
<<-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
2012-03-01 04:42:09 +00:00
To activate, add the following to your .emacs:
#{dot_emacs}
EOS
end
end