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
|
|
|
|
2012-08-13 00:01:59 +00:00
|
|
|
option '32-bit'
|
2009-12-03 06:40:08 +00:00
|
|
|
|
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 02:01:16 +00:00
|
|
|
ENV.gcc if MacOS::Xcode.provides_gcc?
|
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-08-13 00:01:59 +00:00
|
|
|
if MacOS.prefer_64_bit? and not build.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
|
2012-10-01 23:24:36 +00:00
|
|
|
system "make check"
|
2012-05-08 02:23:51 +00:00
|
|
|
system "make install"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
|
|
|
end
|