aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-08-05 11:34:17 -0500
committerJack Nagel2013-08-05 11:39:23 -0500
commit1ef2e3e752104df53d09aad0530880bb2577824f (patch)
tree79de9f760b9fcea26491d732f9f49885e90fc540 /Library/Formula
parent7aa6f36ba3c4a91138bb9ced961081022b7ed707 (diff)
downloadhomebrew-1ef2e3e752104df53d09aad0530880bb2577824f.tar.bz2
gd: make deps explicit
Diffstat (limited to 'Library/Formula')
-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