homebrew-core/Formula/z3.rb
2018-12-21 15:42:50 +08:00

51 lines
1.7 KiB
Ruby

class Z3 < Formula
desc "High-performance theorem prover"
homepage "https://github.com/Z3Prover/z3"
url "https://github.com/Z3Prover/z3/archive/z3-4.8.4.tar.gz"
sha256 "5a18fe616c2a30b56e5b2f5b9f03f405cdf2435711517ff70b076a01396ef601"
head "https://github.com/Z3Prover/z3.git"
bottle do
cellar :any
sha256 "eec4ebf19be6c9ce4ddbd84d0838b925b24cffa286eed603c8c28330c6202761" => :mojave
sha256 "d3ba64584f9b5fd3e164486e72fe6c773475424bd980e87080ac30be02fb368f" => :high_sierra
sha256 "42a9c9e14a526d78a366b924c2e75de7d5f41bb724807f91552c66d1e354497d" => :sierra
end
option "without-python@2", "Build without python 2 support"
deprecated_option "with-python3" => "with-python"
deprecated_option "without-python" => "without-python@2"
depends_on "python@2" => :recommended
depends_on "python" => :optional
def install
if build.without?("python") && build.without?("python@2")
odie "z3: --with-python must be specified when using --without-python@2"
end
Language::Python.each_python(build) do |python, version|
system python, "scripts/mk_make.py", "--prefix=#{prefix}", "--python", "--pypkgdir=#{lib}/python#{version}/site-packages", "--staticlib"
cd "build" do
system "make"
system "make", "install"
end
end
# qprofdiff is not yet part of the source release (it will be as soon as a
# version is released after 4.5.0), so we only include it in HEAD builds
if build.head?
system "make", "-C", "contrib/qprofdiff"
bin.install "contrib/qprofdiff/qprofdiff"
end
pkgshare.install "examples"
end
test do
system ENV.cc, "-I#{include}", "-L#{lib}", "-lz3",
pkgshare/"examples/c/test_capi.c", "-o", testpath/"test"
system "./test"
end
end