aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2012-09-02 00:58:21 -0700
committerMike McQuaid2012-09-04 19:44:41 -0700
commit4c4cc78d01c6d2856af18e00acb7e07bdeba0163 (patch)
tree9d5c5fa0b0771a5e6257b549a925c4c1f816ba5d /Library/Formula
parentc6474bedfa1b398341c527348f013545afab6519 (diff)
downloadhomebrew-4c4cc78d01c6d2856af18e00acb7e07bdeba0163.tar.bz2
gd: fix SHA1, test and X11 dependency.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/gd.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/Library/Formula/gd.rb b/Library/Formula/gd.rb
index f69c919af..e24962d2a 100644
--- a/Library/Formula/gd.rb
+++ b/Library/Formula/gd.rb
@@ -8,8 +8,13 @@ class Gd < Formula
head 'http://bitbucket.org/pierrejoye/gd-libgd', :using => :hg
- depends_on :x11
- depends_on 'jpeg' => :recommended
+ option 'without-libpng', 'Build without PNG support'
+ option 'without-jpeg', 'Build without JPEG support'
+ option 'with-freetype', 'Build with FreeType support'
+
+ depends_on :libpng unless build.include? "without-libpng"
+ depends_on 'jpeg' => :recommended unless build.include? "without-jpeg"
+ depends_on :freetype => :optional if build.include? "with-freetype"
fails_with :llvm do
build 2326
@@ -17,7 +22,9 @@ class Gd < Formula
end
def install
- system "./configure", "--prefix=#{prefix}", "--with-freetype=#{MacOS::X11.prefix}"
+ args = ["--prefix=#{prefix}"]
+ args << "--with-freetype" if build.include? 'with-freetype'
+ system "./configure", *args
system "make install"
(lib+'pkgconfig/gdlib.pc').write pkg_file
end
@@ -39,4 +46,13 @@ Libs.private: -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -lpng12 -lz -lm
Cflags: -I${includedir}
EOF
end
+
+ def test
+ mktemp do
+ system "#{bin}/pngtogd", \
+ "/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png", \
+ "gd_test.gd"
+ system "#{bin}/gdtopng", "gd_test.gd", "gd_test.png"
+ end
+ end
end