aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/lemon.rb
blob: 27ca9ce482967f5b7730afc5f639f1a58bda0641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'formula'

class Lemon < Formula
  url 'http://tx97.net/pub/distfiles/lemon-1.69.tar.bz2'
  homepage 'http://www.hwaci.com/sw/lemon/'
  md5 '35aebc84c4f0e186aba1303bbef11a37'

  def install
    lemon_share = share+'lemon'

    lemon_share.install 'lempar.c'

    # patch the parser generator to look for the 'lempar.c' template file where we've installed it
    lempar_path = lemon_share+'lempar.c'
    inreplace 'lemon.c', / = pathsearch\([^)]*\);/, " = \"#{lempar_path}\";"

    system ENV.cc, '-o', 'lemon', 'lemon.c'
    bin.install 'lemon'
  end
end