diff --git a/antlr2.rb b/antlr2.rb new file mode 100644 index 0000000000..0b6b1c0411 --- /dev/null +++ b/antlr2.rb @@ -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