2010-08-30 11:57:49 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Asymptote < Formula
|
2010-08-30 11:57:49 +00:00
|
|
|
homepage 'http://asymptote.sourceforge.net/'
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/asymptote/asymptote-2.23.src.tgz'
|
2013-02-12 06:20:34 +00:00
|
|
|
sha1 'c24de9766ae7195c1cda947f9d2ae07497a0af8f'
|
2010-08-30 11:57:49 +00:00
|
|
|
|
2012-12-29 01:00:10 +00:00
|
|
|
depends_on :tex
|
2013-02-12 06:20:34 +00:00
|
|
|
depends_on 'texinfo'
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on 'readline'
|
2010-08-30 11:57:49 +00:00
|
|
|
depends_on 'bdw-gc'
|
2013-02-12 06:20:34 +00:00
|
|
|
depends_on 'fftw' => :optional
|
|
|
|
depends_on 'gsl' => :optional
|
2010-08-30 11:57:49 +00:00
|
|
|
|
|
|
|
def install
|
2013-02-12 05:11:22 +00:00
|
|
|
texmfhome = share/'texmf'
|
2010-09-27 20:25:32 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}",
|
2011-08-27 19:46:35 +00:00
|
|
|
"--enable-gc=#{HOMEBREW_PREFIX}",
|
|
|
|
"--with-latex=#{texmfhome}/tex/latex",
|
|
|
|
"--with-context=#{texmfhome}/tex/context/third",
|
|
|
|
# So that `texdoc` can find manuals
|
|
|
|
"--with-docdir=#{texmfhome}/doc"
|
|
|
|
system "make"
|
|
|
|
ENV.deparallelize
|
2010-09-27 20:25:32 +00:00
|
|
|
system "make install"
|
2010-08-30 11:57:49 +00:00
|
|
|
end
|
|
|
|
|
2013-02-02 05:12:29 +00:00
|
|
|
test do
|
2011-08-27 20:48:38 +00:00
|
|
|
ENV['TEXMFHOME'] = "#{HOMEBREW_PREFIX}/share/texmf"
|
2013-02-02 05:12:29 +00:00
|
|
|
(testpath/'asy_test.tex').write <<-EOS.undent
|
2011-08-27 20:48:38 +00:00
|
|
|
\\nonstopmode
|
|
|
|
|
|
|
|
\\documentclass{minimal}
|
|
|
|
\\usepackage{asymptote}
|
|
|
|
|
|
|
|
\\begin{document}
|
|
|
|
Hello, Asymptote!
|
|
|
|
|
|
|
|
\\begin{asy}
|
|
|
|
size(3cm);
|
|
|
|
draw((0,0)--(1,0)--(1,1)--(0,1)--cycle);
|
|
|
|
\\end{asy}
|
|
|
|
|
|
|
|
\\end{document}
|
2013-02-02 05:12:29 +00:00
|
|
|
EOS
|
2011-08-27 20:48:38 +00:00
|
|
|
|
2013-02-02 05:12:29 +00:00
|
|
|
system "pdflatex asy_test"
|
|
|
|
system "asy asy_test-1.asy"
|
|
|
|
system "pdflatex asy_test"
|
2011-08-27 20:48:38 +00:00
|
|
|
end
|
|
|
|
|
2013-02-12 05:11:22 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2013-02-12 06:20:34 +00:00
|
|
|
This formula links the latest version of the Asymptote LaTeX and ConTeXt
|
|
|
|
packages into:
|
2010-10-18 12:23:48 +00:00
|
|
|
|
2013-02-12 06:20:34 +00:00
|
|
|
#{HOMEBREW_PREFIX}/share/texmf
|
2010-10-18 12:23:48 +00:00
|
|
|
|
2013-02-12 06:20:34 +00:00
|
|
|
In order for these packages to be visible to TeX compilers, the above
|
|
|
|
directory will need to be added to the TeX search path:
|
2010-10-18 12:23:48 +00:00
|
|
|
|
2013-02-12 06:20:34 +00:00
|
|
|
sudo tlmgr conf texmf TEXMFHOME "~/Library/texmf:#{HOMEBREW_PREFIX}/share/texmf"
|
2010-08-30 11:57:49 +00:00
|
|
|
|
2013-02-12 06:20:34 +00:00
|
|
|
If you wish to use xasy, you must first install the Python Imaging Library:
|
2010-08-30 11:57:49 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
brew install pil
|
|
|
|
|
2010-08-30 11:57:49 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|