2019-11-27 07:29:03 +00:00
|
|
|
class Dune < Formula
|
|
|
|
desc "Composable build system for OCaml"
|
|
|
|
homepage "https://dune.build/"
|
2020-01-07 00:46:50 +00:00
|
|
|
url "https://github.com/ocaml/dune/releases/download/2.1.0/dune-2.1.0.tbz"
|
|
|
|
sha256 "b26aaa767af0be0720062e4baa5f04b961c39f49e003b5e495618b2e1b60c8c1"
|
2019-11-27 07:29:03 +00:00
|
|
|
head "https://github.com/ocaml/dune.git"
|
|
|
|
|
2019-11-27 09:22:24 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2020-01-07 00:52:16 +00:00
|
|
|
sha256 "4011a6821b7dec0d069a3b7ba3592b0e255524587666af2da2dcc7181734e33c" => :catalina
|
|
|
|
sha256 "ea0e4732220f3c4aff8d3596df6ec50d017cd97fe26578a291c7e90264fe5ba6" => :mojave
|
|
|
|
sha256 "95a8f5f81decf3f31b690556c9d0606d738609b42aad99b712f92a36a211a3a3" => :high_sierra
|
2019-11-27 09:22:24 +00:00
|
|
|
end
|
|
|
|
|
2019-11-27 07:29:03 +00:00
|
|
|
depends_on "ocaml" => [:build, :test]
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "ocaml", "configure.ml"
|
|
|
|
system "ocaml", "bootstrap.ml"
|
|
|
|
system "./dune.exe", "build", "-p", "dune", "--profile", "dune-bootstrap"
|
|
|
|
bin.install "_build/default/bin/dune.exe"
|
|
|
|
mv bin/"dune.exe", bin/"dune"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
contents = "bar"
|
|
|
|
target_fname = "foo.txt"
|
|
|
|
(testpath/"dune").write("(rule (with-stdout-to #{target_fname} (echo #{contents})))")
|
|
|
|
system bin/"dune", "build", "foo.txt", "--root", "."
|
|
|
|
output = File.read(testpath/"_build/default/#{target_fname}")
|
|
|
|
assert_match contents, output
|
|
|
|
end
|
|
|
|
end
|