forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz3.rb
37 lines (32 loc) · 1.17 KB
/
z3.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'formula'
class Z3 < Formula
homepage 'http://z3.codeplex.com/'
version '4.3.1'
url 'http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx?ProjectName=z3&changeSetId=89c1785b73225a1b363c0e485f854613121b70a7'
sha1 '91726a94a6bc0c1035d978b225f3f034387fdfe0'
head 'https://git01.codeplex.com/z3', :using => :git
depends_on :autoconf
depends_on :automake
depends_on :python
def install
package_dir = lib/"python2.7/site-packages"
mkdir_p package_dir
inreplace "scripts/mk_util.py", /^PYTHON_PACKAGE_DIR=.*/, "PYTHON_PACKAGE_DIR=\"#{package_dir}\""
# Fixes compilation with Clang.
inreplace "src/util/hwf.cpp", "#include<float.h>", "#include <emmintrin.h>\n#include <float.h>"
system 'autoconf'
system './configure', "--prefix=#{prefix}"
system 'python', 'scripts/mk_make.py'
cd 'build' do
system 'make'
system 'make', 'install'
(share/'z3').install 'test-z3'
end
end
def test
# There doesn't seem to be a convenient way to run all unit tests...
`#{share}/z3/test-z3 -h`.split[33..-1].each do |testcase|
system "#{share}/z3/test-z3", testcase
end
end
end