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

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

  def install
    (share/'lemon').install 'lempar.c'

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

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