aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gd.rb28
1 files changed, 27 insertions, 1 deletions
diff --git a/Library/Formula/gd.rb b/Library/Formula/gd.rb
index 9b1d1d300..8010dacb9 100644
--- a/Library/Formula/gd.rb
+++ b/Library/Formula/gd.rb
@@ -19,10 +19,36 @@ class Gd < Formula
cause "Undefined symbols when linking"
end
+ def png_prefix
+ MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/libpng" : MacOS::X11.prefix
+ end
+
+ def freetype_prefix
+ MacOS.version >= :mountain_lion ? HOMEBREW_PREFIX/"opt/freetype" : MacOS::X11.prefix
+ end
+
def install
ENV.universal_binary if build.universal?
args = %W{--disable-dependency-tracking --prefix=#{prefix}}
- args << "--without-freetype" unless build.with? 'freetype'
+
+ if build.with? "libpng"
+ args << "--with-png=#{png_prefix}"
+ else
+ args << "--without-png"
+ end
+
+ if build.with? "freetype"
+ args << "--with-freetype=#{freetype_prefix}"
+ else
+ args << "--without-freetype"
+ end
+
+ if build.with? "jpeg"
+ args << "--with-jpeg=#{Formula.factory("jpeg").opt_prefix}"
+ else
+ args << "--without-jpeg"
+ end
+
system "./configure", *args
system "make install"
end