2014-10-27 18:43:53 +00:00
|
|
|
class Camlp4 < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Tool to write extensible parsers in OCaml"
|
2014-10-28 08:09:16 +00:00
|
|
|
homepage "https://github.com/ocaml/camlp4"
|
2015-07-07 19:57:45 +00:00
|
|
|
url "https://github.com/ocaml/camlp4/archive/4.02+6.tar.gz"
|
|
|
|
sha1 "6dd7e591dfde94c44576dba9b847279ffb92c889"
|
|
|
|
version "4.02.2+6"
|
2014-10-28 08:09:16 +00:00
|
|
|
head "https://github.com/ocaml/camlp4.git"
|
|
|
|
|
2014-10-27 21:10:33 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-01-27 00:02:03 +00:00
|
|
|
sha1 "f8f1ff8b4c3cb9ca0a691e56c32615b8b1c43912" => :yosemite
|
|
|
|
sha1 "5def247ba43daed533e1b1a88bf2a3dcc3bf4391" => :mavericks
|
|
|
|
sha1 "68c208492b208b060b66418e77dedc059796c2b2" => :mountain_lion
|
2014-10-27 21:10:33 +00:00
|
|
|
end
|
|
|
|
|
2014-10-27 18:43:53 +00:00
|
|
|
depends_on "objective-caml"
|
|
|
|
|
|
|
|
def install
|
|
|
|
# this build fails if jobs are parallelized
|
|
|
|
ENV.deparallelize
|
|
|
|
system "./configure", "--bindir=#{bin}",
|
|
|
|
"--libdir=#{HOMEBREW_PREFIX}/lib/ocaml",
|
|
|
|
"--pkgdir=#{HOMEBREW_PREFIX}/lib/ocaml/camlp4"
|
|
|
|
system "make", "all"
|
2014-10-28 08:09:16 +00:00
|
|
|
system "make", "install", "LIBDIR=#{lib}/ocaml",
|
|
|
|
"PKGDIR=#{lib}/lib/ocaml/camlp4"
|
2014-10-27 18:43:53 +00:00
|
|
|
end
|
2014-10-27 19:02:08 +00:00
|
|
|
|
|
|
|
test do
|
2014-10-28 08:09:16 +00:00
|
|
|
(testpath/"foo.ml").write "type t = Homebrew | Rocks"
|
|
|
|
system "#{bin}/camlp4", "-parser", "OCaml", "-printer", "OCamlr",
|
|
|
|
"foo.ml", "-o", testpath/"foo.ml.out"
|
|
|
|
assert_equal "type t = [ Homebrew | Rocks ];",
|
|
|
|
(testpath/"foo.ml.out").read.strip
|
2014-10-27 19:02:08 +00:00
|
|
|
end
|
2014-10-27 18:43:53 +00:00
|
|
|
end
|