forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gmp4.rb
74 lines (61 loc) · 2.27 KB
/
gmp4.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require 'formula'
class Gmp4 < Formula
homepage 'http://gmplib.org/'
# Track gcc infrastructure releases.
url 'ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.bz2'
mirror 'ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2'
mirror 'http://mirror.anl.gov/pub/gnu/gmp/gmp-4.3.2.tar.bz2'
sha1 'c011e8feaf1bb89158bd55eaabd7ef8fdd101a2c'
bottle do
sha1 'ac18cca84840aac6d004d829bc1cea398ec09487' => :tiger_g3
sha1 '33780b658a5f64d220fb64c07d4f6e859ddd94c5' => :tiger_altivec
sha1 '71bf67992e28a0b48606db40df70f22d3414c5fd' => :leopard_g3
sha1 '480b7c3848b069e0da3bb33331beacf9122baec3' => :leopard_altivec
end
keg_only "Conflicts with gmp in main repository."
option '32-bit'
option 'skip-check', 'Do not run `make check` to verify libraries'
fails_with :gcc_4_0 do
cause "Reports of problems using gcc 4.0 on Leopard: https://github.com/mxcl/homebrew/issues/issue/2302"
end
def install
args = ["--prefix=#{prefix}", "--enable-cxx"]
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
if MacOS.prefer_64_bit? and not build.build_32_bit?
ENV.m64
args << "--build=x86_64-apple-darwin"
else
ENV.m32
args << "--host=none-apple-darwin"
end
system "./configure", *args
system "make"
ENV.j1 # Doesn't install in parallel on 8-core Mac Pro
system "make install"
# 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 build.include? "skip-check"
end
# 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
end
__END__
diff -r c7ed424a63b2 -r 6cd3658f5621 gmp-h.in
--- a/gmp-h.in Tue Oct 08 14:01:35 2013 +0200
+++ b/gmp-h.in Tue Oct 08 14:45:27 2013 +0200
@@ -46,13 +46,11 @@
#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)