Clean up TeX support installation, add caveat.
Closes Homebrew/homebrew#42110. Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
This commit is contained in:
parent
15a750769e
commit
a43c6b2619
1 changed files with 17 additions and 12 deletions
|
@ -5,38 +5,43 @@ class Noweb < Formula
|
||||||
homepage 'http://www.cs.tufts.edu/~nr/noweb/'
|
homepage 'http://www.cs.tufts.edu/~nr/noweb/'
|
||||||
url 'ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz'
|
url 'ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz'
|
||||||
version '2.11b'
|
version '2.11b'
|
||||||
sha1 '3b391c42f46dcb8a002b863fb2e483560a7da51d'
|
sha256 'c913f26c1edb37e331c747619835b4cade000b54e459bb08f4d38899ab690d82'
|
||||||
|
|
||||||
depends_on 'icon'
|
depends_on 'icon'
|
||||||
|
|
||||||
|
def texpath
|
||||||
|
prefix/'tex/generic/noweb'
|
||||||
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
cd "src" do
|
cd "src" do
|
||||||
system "bash", "awkname", "awk"
|
system "bash", "awkname", "awk"
|
||||||
system "make LIBSRC=icon ICONC=icont CFLAGS='-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1'"
|
system "make LIBSRC=icon ICONC=icont CFLAGS='-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1'"
|
||||||
|
|
||||||
if which 'kpsewhich'
|
|
||||||
ohai 'TeX installation found. Installing TeX support files there might fail if your user does not have permission'
|
|
||||||
texmf = Pathname.new(`kpsewhich -var-value=TEXMFLOCAL`.chomp)
|
|
||||||
else
|
|
||||||
ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
|
|
||||||
texmf = prefix
|
|
||||||
end
|
|
||||||
|
|
||||||
bin.mkpath
|
bin.mkpath
|
||||||
lib.mkpath
|
lib.mkpath
|
||||||
man.mkpath
|
man.mkpath
|
||||||
(texmf/'tex/generic/noweb').mkpath
|
texpath.mkpath
|
||||||
|
|
||||||
system "make", "install", "BIN=#{bin}",
|
system "make", "install", "BIN=#{bin}",
|
||||||
"LIB=#{lib}",
|
"LIB=#{lib}",
|
||||||
"MAN=#{man}",
|
"MAN=#{man}",
|
||||||
"TEXINPUTS=#{texmf}/tex/generic/noweb"
|
"TEXINPUTS=#{texpath}"
|
||||||
cd "icon" do
|
cd "icon" do
|
||||||
system "make", "install", "BIN=#{bin}",
|
system "make", "install", "BIN=#{bin}",
|
||||||
"LIB=#{lib}",
|
"LIB=#{lib}",
|
||||||
"MAN=#{man}",
|
"MAN=#{man}",
|
||||||
"TEXINPUTS=#{texmf}/tex/generic/noweb"
|
"TEXINPUTS=#{texpath}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def caveats; <<-EOS.undent
|
||||||
|
TeX support files are installed in the directory:
|
||||||
|
|
||||||
|
#{texpath}
|
||||||
|
|
||||||
|
You may need to add the directory to TEXINPUTS to run noweb properly.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue