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
|
2009-09-26 19:11:08 +00:00
|
|
|
homepage 'http://gmplib.org/'
|
2012-05-08 02:23:51 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/gmp/gmp-5.0.5.tar.bz2'
|
|
|
|
mirror 'http://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2'
|
|
|
|
sha256 '1f588aaccc41bb9aed946f9fe38521c26d8b290d003c5df807f65690f2aadec9'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
def options
|
|
|
|
[
|
2012-01-01 21:48:30 +00:00
|
|
|
["--32-bit", "Build 32-bit only."],
|
2010-10-17 16:48:35 +00:00
|
|
|
["--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
|
2011-10-18 09:56:23 +00:00
|
|
|
# Do not force if xcode > 4.2 since it does not have /usr/bin/gcc-4.2 as default
|
2012-05-08 02:23:51 +00:00
|
|
|
# FIXME convert this to appropriate fails_with annotations
|
2012-07-11 01:25:16 +00:00
|
|
|
ENV.gcc unless MacOS::Xcode.version >= '4.2'
|
2010-10-17 23:31:01 +00:00
|
|
|
|
2012-05-08 02:23:51 +00:00
|
|
|
args = %W[--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
|
2012-01-01 21:48:30 +00:00
|
|
|
if MacOS.prefer_64_bit? and not ARGV.build_32_bit?
|
2011-03-26 17:03:08 +00:00
|
|
|
ENV.m64
|
|
|
|
args << "--build=x86_64-apple-darwin"
|
|
|
|
else
|
2010-10-17 16:48:35 +00:00
|
|
|
ENV.m32
|
2011-10-03 19:40:14 +00:00
|
|
|
args << "--build=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
|
2012-05-08 02:23:51 +00:00
|
|
|
# Upstream implores users to always run the test suite
|
2009-12-03 06:40:08 +00:00
|
|
|
system "make check" unless ARGV.include? "--skip-check"
|
2012-05-08 02:23:51 +00:00
|
|
|
system "make install"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
|
|
|
end
|