2011-03-10 05:11:03 +00:00
|
|
|
class Gmp < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "GNU multiple precision arithmetic library"
|
2015-05-13 19:33:21 +00:00
|
|
|
homepage "https://gmplib.org/"
|
2014-12-28 14:28:59 +00:00
|
|
|
url "http://ftpmirror.gnu.org/gmp/gmp-6.0.0a.tar.bz2"
|
2015-05-13 19:33:21 +00:00
|
|
|
mirror "https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2"
|
2015-01-13 08:56:28 +00:00
|
|
|
mirror "https://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.bz2"
|
2015-04-01 10:20:03 +00:00
|
|
|
sha256 "7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf"
|
2013-09-24 23:25:19 +00:00
|
|
|
|
2013-10-08 09:28:49 +00:00
|
|
|
bottle do
|
2013-12-05 04:57:46 +00:00
|
|
|
cellar :any
|
2014-10-06 10:51:11 +00:00
|
|
|
sha1 "93ad3c1a012806518e9a128d6eb5b565b4a1771d" => :yosemite
|
2014-04-18 17:28:24 +00:00
|
|
|
sha1 "bfaab8c533af804d4317730f62164b9c80f84f24" => :mavericks
|
|
|
|
sha1 "99dc6539860a9a8d3eb1ac68d5b9434acfb2d846" => :mountain_lion
|
|
|
|
sha1 "466b7549553bf0e8f14ab018bd89c48cbd29a379" => :lion
|
2013-10-08 09:28:49 +00:00
|
|
|
end
|
|
|
|
|
2014-12-28 14:28:59 +00:00
|
|
|
option "32-bit"
|
2013-11-14 18:42:52 +00:00
|
|
|
option :cxx11
|
2009-12-03 06:40:08 +00:00
|
|
|
|
2009-09-26 19:11:08 +00:00
|
|
|
def install
|
2013-11-14 18:42:52 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
2013-06-23 18:15:45 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--enable-cxx"]
|
|
|
|
|
2013-03-01 01:26:53 +00:00
|
|
|
if build.build_32_bit?
|
2010-10-17 16:48:35 +00:00
|
|
|
ENV.m32
|
2014-05-22 14:18:34 +00:00
|
|
|
args << "ABI=32"
|
2015-03-08 10:14:45 +00:00
|
|
|
end
|
|
|
|
|
2015-04-01 10:20:03 +00:00
|
|
|
# https://github.com/Homebrew/homebrew/issues/20693
|
|
|
|
args << "--disable-assembly" if build.build_32_bit? || build.bottle?
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2013-06-23 18:15:45 +00:00
|
|
|
system "./configure", *args
|
2009-12-03 06:40:08 +00:00
|
|
|
system "make"
|
2014-12-28 14:28:59 +00:00
|
|
|
system "make", "check"
|
2013-03-01 01:26:53 +00:00
|
|
|
ENV.deparallelize
|
2014-12-28 14:28:59 +00:00
|
|
|
system "make", "install"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
2014-12-28 14:33:50 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <gmp.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
mpz_t integ;
|
|
|
|
mpz_init (integ);
|
|
|
|
mpz_clear (integ);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2015-01-13 07:21:18 +00:00
|
|
|
system ENV.cc, "test.c", "-L#{lib}", "-lgmp", "-o", "test"
|
2014-12-28 14:33:50 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|