aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorWill Robertson2010-08-30 21:27:49 +0930
committerDavid Höppner2010-08-30 18:09:39 +0200
commit406a3c3511484f331f7b119bf2dceef0d713b287 (patch)
tree6715d7c69e2794e03e004ce3066b8419a4678103 /Library/Formula
parent087db590d3209efbdf1c9cc4834f162fd651a35a (diff)
downloadhomebrew-406a3c3511484f331f7b119bf2dceef0d713b287.tar.bz2
New formula: Asymptote
Asymptote is a 3D programmatic drawing environment that integrates with TeX/LaTeX. It requires a MacTeX installation (or equivalent). Building asy from source is not exactly straightforward (although not toooo difficult) on Mac OS X due to some dependences; hopefully this formula helps some people out. Signed-off-by: David Höppner <0xffea@gmail.com> * white spaces
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/asymptote.rb91
1 files changed, 91 insertions, 0 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb
new file mode 100644
index 000000000..384b3c31e
--- /dev/null
+++ b/Library/Formula/asymptote.rb
@@ -0,0 +1,91 @@
+require 'formula'
+
+class Asymptote <Formula
+ url 'http://downloads.sourceforge.net/asymptote/asymptote-2.04.src.tgz'
+ homepage 'http://asymptote.sourceforge.net/'
+ md5 '6adb5d7714b662152b6f6f16c24f5751'
+
+ 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!
+
+ asyhome = "#{texmfhome}/tex/latex/asymptote-brew"
+ asylocl = "#{texmflocl}/tex/latex/asymptote"
+ system "mkdir -p #{asyhome}"
+
+ 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
+ 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
+ end
+
+ end
+
+ def caveats
+ caveats = <<-EOS
+1) This formula links the latest version of asymptote.sty into your user
+ texmf directory:
+
+ ~/Library/texmf/tex/asymptote-brew/asymptote.sty
+
+ This file links back to where the Asymptote source installer puts it:
+
+ /usr/local/texlive/texmf-local/tex/latex/asymptote/asymptote.sty
+
+ Other users of your machine will not be able to use the source-installed
+ version of asymptote.sty unless they perform a similar linking operation;
+ e.g.,
+
+ mkdir -p ~/Library/texmf/tex/asymptote-brew/
+ ln -s /usr/local/texlive/texmf-local/tex/latex/asymptote/asymptote.sty ~/Library/texmf/tex/asymptote-brew/asymptote.sty
+
+ and similarly for asycolors.sty, ocg.sty, and latexmkrc.
+
+ If you are not using MacTeX / TeX Live or you have customised your TeX
+ distribution, the paths shown above may not match your particular system,
+ but you get the idea.
+
+
+2) If you wish to use xasy, run the following command to install the Python
+ Imaging Library (PIL):
+
+ easy_install http://effbot.org/downloads/Imaging-1.1.7.tar.gz
+
+ EOS
+ end
+
+end