infer 0.9.4

Add `-no-graphics` to OPAM's configure options for OCaml to avoid build
failure when XQuartz is installed.

Closes #7057.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Jules Villard 2016-11-18 19:36:24 +00:00 committed by ilovezfs
parent b8ae4683c3
commit 6007b4ee6c

View file

@ -1,8 +1,8 @@
class Infer < Formula class Infer < Formula
desc "Static analyzer for Java, C and Objective-C" desc "Static analyzer for Java, C and Objective-C"
homepage "http://fbinfer.com/" homepage "http://fbinfer.com/"
url "https://github.com/facebook/infer/releases/download/v0.9.2/infer-osx-v0.9.2.tar.xz" url "https://github.com/facebook/infer/releases/download/v0.9.4/infer-osx-v0.9.4.tar.xz"
sha256 "3935f8be25982a023aba306b66804d73a7316ab833296277c1ec6c3694bfc7c7" sha256 "529d147bccf3285ddb7500c22e0c50d6e0cbdb2c7f9b11a84e8005873994b3e2"
bottle do bottle do
cellar :any cellar :any
@ -17,6 +17,7 @@ class Infer < Formula
depends_on "autoconf" => :build depends_on "autoconf" => :build
depends_on "automake" => :build depends_on "automake" => :build
depends_on "libtool" => :build depends_on "libtool" => :build
depends_on "ocaml" => :build
depends_on "opam" => :build depends_on "opam" => :build
def install def install
@ -24,7 +25,7 @@ class Infer < Formula
odie "infer: --without-clang and --without-java are mutually exclusive" odie "infer: --without-clang and --without-java are mutually exclusive"
end end
opamroot = buildpath/"build" opamroot = buildpath/"opamroot"
opamroot.mkpath opamroot.mkpath
ENV["OPAMROOT"] = opamroot ENV["OPAMROOT"] = opamroot
ENV["OPAMYES"] = "1" ENV["OPAMYES"] = "1"
@ -44,8 +45,12 @@ class Infer < Formula
"all" "all"
end end
system "opam", "init", "--no-setup"
ocaml_version = File.read("build-infer.sh").match(/OCAML_VERSION=\"([0-9\.]+)\"/)[1]
inreplace "#{opamroot}/compilers/#{ocaml_version}/#{ocaml_version}/#{ocaml_version}.comp",
'["./configure"', '["./configure" "-no-graph"'
system "./build-infer.sh", target_platform, "--yes" system "./build-infer.sh", target_platform, "--yes"
system "opam", "config", "exec", "--switch=infer-4.02.3", "--", "make", "install" system "opam", "config", "exec", "--switch=infer-#{ocaml_version}", "--", "make", "install"
end end
test do test do