2015-10-18 11:22:56 +00:00
|
|
|
class Fstar < Formula
|
|
|
|
desc "Language with a type system for program verification"
|
|
|
|
homepage "https://www.fstar-lang.org/"
|
|
|
|
url "https://github.com/FStarLang/FStar.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:tag => "v0.9.2.0",
|
|
|
|
:revision => "2a8ce0b3dfbfb9703079aace0d73f2479f0d0ce2"
|
2016-11-30 16:15:16 +00:00
|
|
|
revision 3
|
2016-08-23 00:42:10 +00:00
|
|
|
head "https://github.com/FStarLang/FStar.git"
|
|
|
|
|
2015-10-18 12:45:24 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-11-30 20:27:16 +00:00
|
|
|
sha256 "fed93a145c1455025bb3e799f14ca456e5326147059e60655daf2b90d5d31765" => :sierra
|
|
|
|
sha256 "af3a84d4b8fa2f76fe5863dd001aadb38200fe7409bac1ba1e5460b91ca2c72d" => :el_capitan
|
|
|
|
sha256 "158cb0755c2b09565fc3d605e1bbf6e894c7176e69f707f9ee01a4d844d879b6" => :yosemite
|
2015-10-18 12:45:24 +00:00
|
|
|
end
|
|
|
|
|
2015-10-18 11:22:56 +00:00
|
|
|
depends_on "opam" => :build
|
2016-06-17 17:01:25 +00:00
|
|
|
depends_on "gmp" => :build
|
2015-10-18 11:22:56 +00:00
|
|
|
depends_on "ocaml" => :recommended
|
|
|
|
depends_on "z3" => :recommended
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.deparallelize # Not related to F* : OCaml parallelization
|
2016-11-05 17:31:28 +00:00
|
|
|
ENV["OPAMROOT"] = buildpath/"opamroot"
|
2015-10-18 11:22:56 +00:00
|
|
|
ENV["OPAMYES"] = "1"
|
2016-11-05 17:31:28 +00:00
|
|
|
|
|
|
|
# avoid having to depend on coreutils
|
|
|
|
inreplace "src/ocaml-output/Makefile", "$(DATE_EXEC) -Iseconds",
|
|
|
|
"$(DATE_EXEC) '+%Y-%m-%dT%H:%M:%S%z'"
|
|
|
|
|
2015-10-18 11:22:56 +00:00
|
|
|
system "opam", "init", "--no-setup"
|
2016-11-05 17:31:28 +00:00
|
|
|
|
|
|
|
if build.stable?
|
2016-11-30 16:15:16 +00:00
|
|
|
system "opam", "install", "batteries=2.5.3", "zarith=1.3", "yojson=1.1.6"
|
2016-11-05 17:31:28 +00:00
|
|
|
else
|
|
|
|
system "opam", "install", "batteries", "zarith", "yojson"
|
2015-10-18 11:22:56 +00:00
|
|
|
end
|
|
|
|
|
2016-11-05 17:31:28 +00:00
|
|
|
system "opam", "config", "exec", "--", "make", "-C", "src", "boot-ocaml"
|
2015-10-18 11:22:56 +00:00
|
|
|
|
|
|
|
bin.install "src/ocaml-output/fstar.exe"
|
|
|
|
|
|
|
|
(libexec/"stdlib").install Dir["lib/*"]
|
|
|
|
(libexec/"contrib").install Dir["contrib/*"]
|
|
|
|
(libexec/"examples").install Dir["examples/*"]
|
|
|
|
(libexec/"tutorial").install Dir["doc/tutorial/*"]
|
|
|
|
(libexec/"src").install Dir["src/*"]
|
|
|
|
(libexec/"licenses").install "LICENSE-fsharp.txt", Dir["3rdparty/licenses/*"]
|
|
|
|
|
|
|
|
prefix.install_symlink libexec/"stdlib"
|
|
|
|
prefix.install_symlink libexec/"contrib"
|
|
|
|
prefix.install_symlink libexec/"examples"
|
|
|
|
prefix.install_symlink libexec/"tutorial"
|
|
|
|
prefix.install_symlink libexec/"src"
|
|
|
|
prefix.install_symlink libexec/"licenses"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
F* code can be extracted to OCaml code.
|
|
|
|
To compile the generated OCaml code, you must install the
|
|
|
|
package 'batteries' from the Opam package manager:
|
|
|
|
- brew install opam
|
|
|
|
- opam install batteries
|
|
|
|
|
|
|
|
F* code can be extracted to F# code.
|
|
|
|
To compile the generated F# (.NET) code, you must install
|
2016-02-02 18:29:09 +00:00
|
|
|
the 'mono' package that includes the fsharp compiler:
|
2015-10-18 11:22:56 +00:00
|
|
|
- brew install mono
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/fstar.exe",
|
|
|
|
"--include", "#{prefix}/examples/unit-tests",
|
|
|
|
"--admit_fsi", "FStar.Set",
|
2016-02-01 23:21:11 +00:00
|
|
|
"FStar.Set.fsi", "FStar.Heap.fst",
|
|
|
|
"FStar.ST.fst", "FStar.All.fst",
|
|
|
|
"FStar.List.fst", "FStar.String.fst",
|
|
|
|
"FStar.Int32.fst", "unit1.fst",
|
2015-10-18 11:22:56 +00:00
|
|
|
"unit2.fst", "testset.fst"
|
|
|
|
end
|
|
|
|
end
|