Skip to content

Commit

Permalink
stanc3 2.29.2 (new formula)
Browse files Browse the repository at this point in the history
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
ankane authored and BrewTestBot committed May 5, 2022
1 parent 05f6739 commit e9bd993
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Formula/stanc3.rb
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

0 comments on commit e9bd993

Please sign in to comment.