Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fstar: unpin ocamlfind version to fix the build #6635

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions Formula/fstar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ class Fstar < Formula
url "https://github.com/FStarLang/FStar.git",
:tag => "v0.9.2.0",
:revision => "2a8ce0b3dfbfb9703079aace0d73f2479f0d0ce2"
revision 1

revision 2
head "https://github.com/FStarLang/FStar.git"

bottle do
Expand All @@ -20,45 +19,24 @@ class Fstar < Formula
depends_on "ocaml" => :recommended
depends_on "z3" => :recommended

resource "ocamlfind" do
url "http://download.camlcity.org/download/findlib-1.5.5.tar.gz"
sha256 "aafaba4f7453c38347ff5269c6fd4f4c243ae2bceeeb5e10b9dab89329905946"
end

resource "batteries" do
url "https://github.com/ocaml-batteries-team/batteries-included/archive/v2.5.2.tar.gz"
sha256 "649038b47cdc2b7d4d4331fdb54b1e726212ce904c3472687a86aaa8d6006451"
end

resource "zarith" do
url "https://forge.ocamlcore.org/frs/download.php/1471/zarith-1.3.tgz"
sha256 "946687d6f032b96ab9db9661d876e39437bff783e0ad473ac463c06259b7a3d7"
end

resource "yojson" do
url "http://mjambon.com/releases/yojson/yojson-1.1.6.tar.gz"
sha256 "d97497f4d0694f515a9c12708eda2654dddb289b2ed567a377706e62e54c480d"
end

def install
ENV.deparallelize # Not related to F* : OCaml parallelization

opamroot = buildpath/"opamroot"
ENV["OPAMROOT"] = opamroot
ENV["OPAMROOT"] = buildpath/"opamroot"
ENV["OPAMYES"] = "1"

# avoid having to depend on coreutils
inreplace "src/ocaml-output/Makefile", "$(DATE_EXEC) -Iseconds",
"$(DATE_EXEC) '+%Y-%m-%dT%H:%M:%S%z'"

system "opam", "init", "--no-setup"
archives = opamroot/"repo/default/archives"
modules = []
resources.each do |r|
r.verify_download_integrity(r.fetch)
original_name = File.basename(r.url)
cp r.cached_download, archives/original_name
modules << "#{r.name}=#{r.version}"

if build.stable?
system "opam", "install", "batteries=2.5.2", "zarith=1.3", "yojson=1.1.6"
else
system "opam", "install", "batteries", "zarith", "yojson"
end

system "opam", "install", *modules
system "opam", "config", "exec", "--",
"make", "-C", "src/ocaml-output/"
system "opam", "config", "exec", "--", "make", "-C", "src", "boot-ocaml"

bin.install "src/ocaml-output/fstar.exe"

Expand Down