2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gmp < Formula
|
2011-05-21 22:59:05 +00:00
|
|
|
url 'ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.2.tar.bz2'
|
2009-09-26 19:11:08 +00:00
|
|
|
homepage 'http://gmplib.org/'
|
2011-05-21 22:59:05 +00:00
|
|
|
sha1 '2968220e1988eabb61f921d11e5d2db5431e0a35'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
def options
|
|
|
|
[
|
2010-10-17 16:48:35 +00:00
|
|
|
["--32-bit", "Force 32-bit."],
|
|
|
|
["--skip-check", "Do not run 'make check' to verify libraries."]
|
2009-12-03 06:40:08 +00:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2009-09-26 19:11:08 +00:00
|
|
|
def install
|
2010-10-17 23:31:01 +00:00
|
|
|
# Reports of problems using gcc 4.0 on Leopard
|
2010-11-10 18:16:28 +00:00
|
|
|
# https://github.com/mxcl/homebrew/issues/issue/2302
|
2011-03-06 11:13:58 +00:00
|
|
|
# Also force use of 4.2 on 10.6 in case a user has changed the default
|
|
|
|
ENV.gcc_4_2
|
2010-10-17 23:31:01 +00:00
|
|
|
|
2011-05-21 22:59:05 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--enable-cxx"]
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2011-03-26 17:03:08 +00:00
|
|
|
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
|
2011-08-30 02:20:56 +00:00
|
|
|
# see: http://gmplib.org/macos.html
|
2011-03-26 17:03:08 +00:00
|
|
|
if MacOS.prefer_64_bit? and not ARGV.include? "--32-bit"
|
|
|
|
ENV.m64
|
|
|
|
args << "--build=x86_64-apple-darwin"
|
|
|
|
else
|
2010-10-17 16:48:35 +00:00
|
|
|
ENV.m32
|
|
|
|
args << "--host=none-apple-darwin"
|
2009-12-03 06:40:08 +00:00
|
|
|
end
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
2011-05-21 22:59:05 +00:00
|
|
|
ENV.j1 # Doesn't install in parallel on 8-core Mac Pro
|
2009-09-26 19:11:08 +00:00
|
|
|
system "make install"
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
# Different compilers and options can cause tests to fail even
|
|
|
|
# if everything compiles, so yes, we want to do this step.
|
|
|
|
system "make check" unless ARGV.include? "--skip-check"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
|
|
|
end
|