-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #99930. Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
- Loading branch information
1 parent
05f6739
commit e9bd993
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class Stanc3 < Formula | ||
desc "Stan transpiler" | ||
homepage "https://github.com/stan-dev/stanc3" | ||
# git is needed for dune subst | ||
url "https://github.com/stan-dev/stanc3.git", | ||
tag: "v2.29.2", | ||
revision: "2c254b3b11a4dbb82395f016886b557201dad130" | ||
license "BSD-3-Clause" | ||
|
||
depends_on "ocaml" => :build | ||
depends_on "opam" => :build | ||
|
||
uses_from_macos "unzip" => :build | ||
|
||
def install | ||
Dir.mktmpdir("opamroot") do |opamroot| | ||
ENV["OPAMROOT"] = opamroot | ||
ENV["OPAMYES"] = "1" | ||
ENV["OPAMVERBOSE"] = "1" | ||
|
||
system "opam", "init", "--no-setup", "--disable-sandboxing" | ||
system "bash", "-x", "scripts/install_build_deps.sh" | ||
system "opam", "exec", "dune", "subst" | ||
system "opam", "exec", "dune", "build", "@install" | ||
|
||
bin.install "_build/default/src/stanc/stanc.exe" => "stanc" | ||
pkgshare.install "test" | ||
end | ||
end | ||
|
||
test do | ||
assert_match "stanc3 v#{version}", shell_output("#{bin}/stanc --version") | ||
|
||
cp pkgshare/"test/integration/good/algebra_solver_good.stan", testpath | ||
system bin/"stanc", "algebra_solver_good.stan" | ||
assert_predicate testpath/"algebra_solver_good.hpp", :exist? | ||
end | ||
end |