aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2015-03-08 10:16:59 +0000
committerMike McQuaid2015-03-31 19:18:32 +0100
commitb9f1fbae5ad751db3e4499f681e90d5643e470bb (patch)
tree85aa40895ce1b368b60eaaf6d2965502469ffd22
parent2f102ca19f7e070f7e83175b448dce39213494e5 (diff)
downloadhomebrew-b9f1fbae5ad751db3e4499f681e90d5643e470bb.tar.bz2
ghc: make gmp a build-time dependency.
Link against the static libraries instead.
-rw-r--r--Library/Formula/ghc.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb
index a71e9668a..e07483b85 100644
--- a/Library/Formula/ghc.rb
+++ b/Library/Formula/ghc.rb
@@ -16,7 +16,7 @@ class Ghc < Formula
# http://hackage.haskell.org/trac/ghc/ticket/6009
depends_on :macos => :snow_leopard
- depends_on "gmp"
+ depends_on "gmp" => :build
depends_on "gcc" if MacOS.version == :mountain_lion
if build.build_32_bit? || !MacOS.prefer_64_bit?
@@ -54,6 +54,10 @@ class Ghc < Formula
end
def install
+ # Copy gmp static libraries to build path (to avoid dynamic linking)
+ (buildpath/"gmp-lib-static").mkpath
+ cp Dir.glob("#{Formula["gmp"].lib}/*.a"), buildpath/"gmp-lib-static/"
+
# Move the main tarball contents into a subdirectory
(buildpath+"Ghcsource").install Dir["*"]
@@ -100,7 +104,8 @@ class Ghc < Formula
# ensure configure does not use Xcode 5 "gcc" which is actually clang
system "./configure", "--prefix=#{prefix}",
"--build=#{arch}-apple-darwin",
- "--with-gcc=#{ENV.cc}"
+ "--with-gcc=#{ENV.cc}",
+ "--with-gmp-includes=#{buildpath}/gmp-lib-static"
system "make"
if build.with? "tests"