aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-08-27 12:46:35 -0700
committerCharlie Sharpsteen2011-08-27 12:46:35 -0700
commit5aaa2fe1e376fd79536e2aa281e47ef93b404104 (patch)
tree9353bcbf62831f471261f5f357fde87f06a9c31e /Library
parente994783c4a9f8ab2209894461379e186c52db53d (diff)
downloadhomebrew-5aaa2fe1e376fd79536e2aa281e47ef93b404104.tar.bz2
Asymptote: Fix installation
Asymptote needs a serialized `make install` or else things fail due to race conditions. Also, altered installation so that TeX packages are no long installed to texmf trees outside of the Asymptote keg---notably: /usr/local/texlive/<dist_year>/texmf-local ~/Library/texmf All packages are now installed to HOMEBREW_PREFIX/share/texmf and instructions for adding this directory to the TeX search path are given in the caveats.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/asymptote.rb50
1 files changed, 16 insertions, 34 deletions
diff --git a/Library/Formula/asymptote.rb b/Library/Formula/asymptote.rb
index b4983317e..eacbbbe3a 100644
--- a/Library/Formula/asymptote.rb
+++ b/Library/Formula/asymptote.rb
@@ -1,6 +1,6 @@
require 'formula'
-def TeX_installed?; return `which latex` != ''; end
+def TeX_installed?; return `which latex`.chomp != ''; end
class Asymptote < Formula
url 'http://downloads.sourceforge.net/asymptote/asymptote-2.13.src.tgz'
@@ -10,19 +10,6 @@ class Asymptote < Formula
depends_on 'readline'
depends_on 'bdw-gc'
- def link_asy_texmfhome
- texmfhome = `kpsewhich -var-value=TEXMFHOME`.chop
- texmflocl = `kpsewhich -var-value=TEXMFLOCAL`.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
unless TeX_installed?
onoe <<-EOS.undent
@@ -33,35 +20,30 @@ class Asymptote < Formula
exit 1
end
+ texmfhome = share + 'texmf'
+
system "./configure", "--prefix=#{prefix}",
- "--enable-gc=#{HOMEBREW_PREFIX}"
+ "--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
system "make install"
- link_asy_texmfhome
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.,
+1) This formula links the latest version of the Asymptote LaTeX and ConTeXt
+ packages into:
- 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
+ #{HOMEBREW_PREFIX}/share/texmf
- and similarly for asycolors.sty, ocg.sty, and latexmkrc.
+ In order for these packages to be visible to TeX compilers, the above
+ directory will need to be added to the TeX search path:
- 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.
+ sudo tlmgr conf texmf TEXMFHOME "~/Library/texmf:#{HOMEBREW_PREFIX}/share/texmf"
2) If you want to have Asymptote compiled with support for fftw or gsl