homebrew-core/Formula/camlp4.rb

39 lines
1.5 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"
2016-11-30 16:14:51 +00:00
url "https://github.com/ocaml/camlp4/archive/4.04+1.tar.gz"
version "4.04+1"
sha256 "6044f24a44053684d1260f19387e59359f59b0605cdbf7295e1de42783e48ff1"
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-11-30 20:27:16 +00:00
sha256 "49096259b8b6ca8de2e13430ca64667e7240ea4c57ceec970ec09c6018e92afa" => :sierra
sha256 "2653f7e820938274b150429ae79c8b7384a93e655707f1c028577ad46eb720f7" => :el_capitan
sha256 "368d94cdd7367926ad0c77e0c818a3f4cbc09fc2cdbd9ad35dd391f90b2eef9a" => :yosemite
2014-10-27 21:10:33 +00:00
end
depends_on "ocaml"
# 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
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