Skip to content

Commit

Permalink
New Formula: antlr2
Browse files Browse the repository at this point in the history
Also includes cpp runtime library.

Pulled over from Homebrew/legacy-homebrew#10701.

Signed-off-by: Charlie Sharpsteen <[email protected]>
  • Loading branch information
mjdecker authored and Sharpie committed Apr 25, 2012
1 parent 682de63 commit 5489ec4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions antlr2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require 'formula'

class Antlr2 < Formula

homepage 'http://www.antlr2.org'
url 'http://www.antlr2.org/download/antlr-2.7.7.tar.gz'
md5 '01cc9a2a454dd33dcd8c856ec89af090'

def install

# C Sharp is explicitly disabled because the antlr configure script will
# confuse the Chicken Scheme compiler, csc, for a C sharp compiler.
args = %W[
--prefix=#{prefix}
--disable-debug
--disable-csharp
]

system "./configure", *args
system "make"

libexec.install "antlr.jar"
include.install "lib/cpp/antlr"
lib.install "lib/cpp/src/libantlr.a"

(bin+"antlr2").write <<-EOS.undent
#!/bin/sh
java -classpath #{libexec}/antlr.jar antlr.Tool "$@"
EOS
end

end

0 comments on commit 5489ec4

Please sign in to comment.