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"
|
|
|
|
version "4.02.2+6"
|
2015-10-05 12:40:09 +00:00
|
|
|
sha256 "820c35b69fdff3225bda6045fabffe5d7c54dda00fb157444ac8bda5e1778d45"
|
2015-09-01 19:13:23 +00:00
|
|
|
head "https://github.com/ocaml/camlp4.git", :branch => "trunk"
|
2015-07-31 17:57:56 +00:00
|
|
|
revision 1
|
2014-10-28 08:09:16 +00:00
|
|
|
|
2014-10-27 21:10:33 +00:00
|
|
|
bottle do
|
2015-09-14 07:07:58 +00:00
|
|
|
cellar :any_skip_relocation
|
2015-10-12 18:56:21 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "2fbb2011ee0a44abdc5ce6cbdea7b1f271a00b903bd14dab9ecf3f5318571204" => :el_capitan
|
|
|
|
sha256 "3a3bcb70dad5b897a8d1db8bf28fe15794de5f14249d00b88ce5a8411e5e4a9d" => :yosemite
|
|
|
|
sha256 "08ca2278024819f625b4a0ca52b2cb931279c9d7ec1d9a55c9e9748c5f55cb15" => :mavericks
|
2014-10-27 21:10:33 +00:00
|
|
|
end
|
|
|
|
|
2015-09-01 19:13:23 +00:00
|
|
|
depends_on "ocaml"
|
2014-10-27 18:43:53 +00:00
|
|
|
|
|
|
|
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
|