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/'
|
2013-10-05 21:27:25 +00:00
|
|
|
url 'ftp://ftp.gmplib.org/pub/gmp/gmp-5.1.3.tar.bz2'
|
|
|
|
mirror 'http://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2'
|
|
|
|
sha1 'b35928e2927b272711fdfbf71b7cfd5f86a6b165'
|
2013-09-24 23:25:19 +00:00
|
|
|
|
2013-10-08 09:28:49 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
revision 1
|
|
|
|
sha1 '7a4392ecba5ef5077440358a6a1c86d9717e22f8' => :mountain_lion
|
|
|
|
sha1 '8e7b9953d6c337dc6ee1ca97da5eede6b1c3d9be' => :lion
|
|
|
|
sha1 '773bac38cc86dec84dc9b9abb246c56900cac7af' => :snow_leopard
|
|
|
|
end
|
|
|
|
|
2012-08-13 00:01:59 +00:00
|
|
|
option '32-bit'
|
2013-11-14 18:42:52 +00:00
|
|
|
option :cxx11
|
2009-12-03 06:40:08 +00:00
|
|
|
|
2013-10-08 15:09:31 +00:00
|
|
|
# Patches gmp.h to remove the __need_size_t define, which
|
|
|
|
# was preventing libc++ builds from getting the ptrdiff_t type
|
|
|
|
# Applied upstream in http://gmplib.org:8000/gmp/raw-rev/6cd3658f5621
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
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
|
2013-03-01 01:26:53 +00:00
|
|
|
ENV.append 'ABI', '32'
|
2013-06-23 18:15:45 +00:00
|
|
|
# https://github.com/mxcl/homebrew/issues/20693
|
|
|
|
args << "--disable-assembly"
|
2013-10-08 09:03:30 +00:00
|
|
|
elsif build.bottle?
|
|
|
|
args << "--disable-assembly"
|
2009-12-03 06:40:08 +00:00
|
|
|
end
|
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"
|
2012-10-01 23:24:36 +00:00
|
|
|
system "make check"
|
2013-03-01 01:26:53 +00:00
|
|
|
ENV.deparallelize
|
2012-05-08 02:23:51 +00:00
|
|
|
system "make install"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
|
|
|
end
|
2013-10-08 15:09:31 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/gmp-h.in b/gmp-h.in
|
|
|
|
index 7deb67a..240d663 100644
|
|
|
|
--- a/gmp-h.in
|
|
|
|
+++ b/gmp-h.in
|
|
|
|
@@ -46,13 +46,11 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
|
|
|
#ifndef __GNU_MP__
|
|
|
|
#define __GNU_MP__ 5
|
|
|
|
|
|
|
|
-#define __need_size_t /* tell gcc stddef.h we only want size_t */
|
|
|
|
#if defined (__cplusplus)
|
|
|
|
#include <cstddef> /* for size_t */
|
|
|
|
#else
|
|
|
|
#include <stddef.h> /* for size_t */
|
|
|
|
#endif
|
|
|
|
-#undef __need_size_t
|
|
|
|
|
|
|
|
/* Instantiated by configure. */
|
|
|
|
#if ! defined (__GMP_WITHIN_CONFIGURE)
|