aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/noweb.rb
blob: 6fb42820eb78f5c125022569a3dbfe2bbc2ed803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'formula'

class Noweb < Formula
  url 'ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz'
  version '2.11b'
  homepage 'http://www.cs.tufts.edu/~nr/noweb/'
  md5 '1df580723497b2f2efde07646abf764c'

  depends_on 'icon'

  def install
    Dir.chdir "src" do
      system "make LIBSRC=icon ICONC=icont"

      kpse = `which kpsewhich`
      if kpse == ''
        ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
        texmf = "#{prefix}"
      else
        texmf = "`kpsewhich -var-value=TEXMFLOCAL`"
      end

      bin.mkpath
      lib.mkpath
      man.mkpath

      system "mkdir -p #{texmf}/tex/generic/noweb"
      system "make", "install", "BIN=#{bin}",
                                "LIB=#{lib}",
                                "MAN=#{man}",
                                "TEXINPUTS=#{texmf}/tex/generic/noweb"
    end
  end
end