aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorRui Pereira2011-08-12 12:10:04 +0200
committerCharlie Sharpsteen2011-08-27 11:54:12 -0700
commit82cb3221e086de35379147672a10980a32a86de4 (patch)
treed420088d0bb29a2fffef1a4e6c817b0b17ed848e /Library
parent19ddb2954ee188b8cfe7c0f901ce6f74f6809179 (diff)
downloadhomebrew-82cb3221e086de35379147672a10980a32a86de4.tar.bz2
Re-add auctex 11.86
An extensible package for writing and formatting TEX files in GNU Emacs and XEmacs. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/auctex.rb76
1 files changed, 76 insertions, 0 deletions
diff --git a/Library/Formula/auctex.rb b/Library/Formula/auctex.rb
new file mode 100644
index 000000000..a5009687f
--- /dev/null
+++ b/Library/Formula/auctex.rb
@@ -0,0 +1,76 @@
+require 'formula'
+
+class Auctex < Formula
+ url 'http://ftp.gnu.org/pub/gnu/auctex/auctex-11.86.tar.gz'
+ homepage 'http://ftp.gnu.org/pub/gnu/auctex'
+ md5 '6bc33a67b6ac59db1aa238f3693b36d2'
+
+ def options
+ [
+ ['--with-emacs=/full/path/to/emacs>', "Force a different emacs"]
+ ]
+ end
+
+ def which_emacs
+ emacs = `which emacs`.chomp
+ # check arguments for a different emacs
+ ARGV.each do |a|
+ if a.index('--with-emacs')
+ emacs = a.sub('--with-emacs=', '')
+ end
+ end
+ return emacs
+ end
+
+ def install
+ # based on the asymtote formula LaTeX check
+ if `which latex`.chomp == ''
+ onoe <<-EOS.undent
+ AUCTeX requires a TeX/LaTeX installation; aborting now.
+ You can obtain the TeX distribution for Mac OS X from
+ http://www.tug.org/mactex/
+ EOS
+ Process.exit
+ end
+
+ brew_lispdir = share + 'emacs' + 'site-lisp'
+ brew_texmf = share + 'texmf'
+ # configure fails if the texmf dir is not there yet
+ brew_texmf.mkpath
+
+ system "./configure", "--prefix=#{prefix}", "--with-texmf-dir=#{brew_texmf}",
+ "--with-emacs=#{which_emacs}", "--with-lispdir=#{brew_lispdir}"
+
+ system "make"
+ 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
+ (require 'tex-site)
+ EOS
+ else
+ dot_emacs = <<-EOS
+ (add-to-list 'load-path "#{HOMEBREW_PREFIX}/share/emacs/site-lisp")
+ (require 'tex-site)
+ EOS
+ end
+
+ puts <<-EOS.undent
+ * 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
+ to activate add the following to your .emacs:
+#{dot_emacs}
+ EOS
+ end
+
+end