diff options
| author | Adam Vandenberg | 2010-09-27 13:25:32 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-09-27 13:25:32 -0700 |
| commit | 00942b4ef1614651217dd99565b86b4bf3d2f653 (patch) | |
| tree | 678311a81ff6eda6469b0ea94bc0b6e0e109194d /Library/Formula/asymptote.rb | |
| parent | d2f8e3eafb705f6af63d67909eeb1488313556b6 (diff) | |
| download | homebrew-00942b4ef1614651217dd99565b86b4bf3d2f653.tar.bz2 | |
asymptote - formula style tweaks
Diffstat (limited to 'Library/Formula/asymptote.rb')
| -rw-r--r-- | Library/Formula/asymptote.rb | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb index 384b3c31e..6af373e13 100644 --- a/Library/Formula/asymptote.rb +++ b/Library/Formula/asymptote.rb @@ -1,5 +1,7 @@ require 'formula' +def TeX_installed?; return `which latex` != ''; end + class Asymptote <Formula url 'http://downloads.sourceforge.net/asymptote/asymptote-2.04.src.tgz' homepage 'http://asymptote.sourceforge.net/' @@ -8,21 +10,9 @@ class Asymptote <Formula depends_on 'readline' depends_on 'bdw-gc' - def TeX_installed? - texbin = `which latex` - if texbin=='' - return false - else - return true - end - end - def link_asy_texmfhome - - texmfhome = `kpsewhich -var-value=TEXMFHOME` - texmflocl = `kpsewhich -var-value=TEXMFLOCAL` - texmfhome.chop! - texmflocl.chop! + texmfhome = `kpsewhich -var-value=TEXMFHOME`.chop + texmflocl = `kpsewhich -var-value=TEXMFLOCAL`.chop asyhome = "#{texmfhome}/tex/latex/asymptote-brew" asylocl = "#{texmflocl}/tex/latex/asymptote" @@ -31,28 +21,23 @@ class Asymptote <Formula for asyfile in ['asycolors.sty','asymptote.sty','ocg.sty','latexmkrc'] system "ln -s -f #{asylocl}/#{asyfile} #{asyhome}/#{asyfile}" end - end def install - if TeX_installed? - system "./configure", - "--prefix=#{prefix}", - "--enable-gc=#{HOMEBREW_PREFIX}", - "--disable-fftw", "--disable-gsl" # follow TeX Live - - system "make install" - - link_asy_texmfhome - - else + unless TeX_installed? onoe <<-EOS.undent Asymptote requires a TeX/LaTeX installation; aborting now. You can obtain the TeX distribution for Mac OS X from http://www.tug.org/mactex/ EOS + exit 1 end + system "./configure", "--prefix=#{prefix}", + "--enable-gc=#{HOMEBREW_PREFIX}", + "--disable-fftw", "--disable-gsl" # follow TeX Live + system "make install" + link_asy_texmfhome end def caveats @@ -87,5 +72,4 @@ class Asymptote <Formula EOS end - end |
