homebrew-core/Formula/camlp4.rb

37 lines
1.4 KiB
Ruby
Raw Normal View History

2014-10-27 18:43:53 +00:00
class Camlp4 < Formula
desc "Tool to write extensible parsers in OCaml"
2014-10-28 08:09:16 +00:00
homepage "https://github.com/ocaml/camlp4"
url "https://github.com/ocaml/camlp4/archive/4.02+6.tar.gz"
version "4.02.3+6"
sha256 "820c35b69fdff3225bda6045fabffe5d7c54dda00fb157444ac8bda5e1778d45"
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
2015-11-28 01:55:27 +00:00
sha256 "bbfa590ccdfdfee06dbd5a751201bb8e74b469ef2e2b86755225ffb2eb4720da" => :el_capitan
sha256 "6194932d62c0002c8286e7c7bf3d04272301669d2a036b7f9d717af3b1370ea4" => :yosemite
sha256 "a791cec5c4ff4cec0bdff1f25ac2b1a6e906b3e9c485bac285d1b527c9caeeaa" => :mavericks
2014-10-27 21:10:33 +00:00
end
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
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
end
2014-10-27 18:43:53 +00:00
end