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"
|
2016-05-02 15:34:24 +00:00
|
|
|
url "https://github.com/ocaml/camlp4/archive/4.03+1.tar.gz"
|
|
|
|
version "4.03+1"
|
|
|
|
sha256 "6eefeacced81cca59ddf90c2538505fd5cd6596a3fc1acf4971e9796c2e7f2ae"
|
2016-09-24 15:45:48 +00:00
|
|
|
head "https://github.com/ocaml/camlp4.git", :branch => "trunk"
|
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
|
2016-09-13 19:39:33 +00:00
|
|
|
sha256 "a25b9822e4cac3ab1e1434f801a21dce4a59b1be5fcf8633031195859a92a76e" => :sierra
|
2016-05-05 19:35:41 +00:00
|
|
|
sha256 "8393f45f735de47ccae58ea6974aacd34770449980664377b7533a6de8a08c25" => :el_capitan
|
|
|
|
sha256 "5fb90eba1c7b96d259b6dff9049b52d2aee380ff3312376514f96fbd6bd2b613" => :yosemite
|
|
|
|
sha256 "e7082ef589dbf2df951d3da8caaafacfada7def89ae24bde05fb1eb29b12d09d" => :mavericks
|
2014-10-27 21:10:33 +00:00
|
|
|
end
|
|
|
|
|
2015-09-01 19:13:23 +00:00
|
|
|
depends_on "ocaml"
|
2016-05-02 18:35:38 +00:00
|
|
|
# since Ocaml 4.03.0, ocamlbuild is no longer part of ocaml
|
|
|
|
depends_on "ocamlbuild"
|
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
|