diff options
| author | Jack Nagel | 2012-08-13 10:23:14 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-13 10:24:11 -0500 |
| commit | b6f9f46a82abaabe7fa2368db878a0a1e532f6db (patch) | |
| tree | 24f9daab546acea62ae4a096b6afa2d78a9d87ca /Library | |
| parent | 81f79977da4d27e89772e4b469cae350111ebe8a (diff) | |
| download | homebrew-b6f9f46a82abaabe7fa2368db878a0a1e532f6db.tar.bz2 | |
poppler: use options DSL
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/poppler.rb | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Library/Formula/poppler.rb b/Library/Formula/poppler.rb index 7edd011b5..a344f70a1 100644 --- a/Library/Formula/poppler.rb +++ b/Library/Formula/poppler.rb @@ -1,8 +1,5 @@ require 'formula' -def glib?; ARGV.include? '--with-glib'; end -def qt?; ARGV.include? '--with-qt4'; end - class PopplerData < Formula url 'http://poppler.freedesktop.org/poppler-data-0.4.5.tar.gz' sha256 '3190bc457bafe4b158f79a08e8a3f1824031ec12acefc359e68e0f04da0f70fd' @@ -14,20 +11,16 @@ class Poppler < Formula sha256 '2debc5034e0e85402957d84fb2674737658a3dbe8a3c631e1792e3f8c88ce369' depends_on 'pkg-config' => :build - depends_on 'qt' if qt? - depends_on 'glib' if glib? - depends_on 'cairo' if glib? # Needs a newer Cairo build than OS X 10.6.7 provides + depends_on 'qt' if build.include? 'with-qt4' + depends_on 'glib' if build.include? 'with-glib' + depends_on 'cairo' if build.include? 'with-glib' # Needs a newer Cairo build than OS X 10.6.7 provides depends_on :x11 # Fontconfig headers - def options - [ - ["--with-qt4", "Build Qt backend"], - ["--with-glib", "Build Glib backend"] - ] - end + option 'with-qt4', 'Build Qt backend' + option 'with-glib', 'Build Glib backend' def install - if qt? + if build.include? 'with-qt4' ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib" end @@ -35,8 +28,8 @@ class Poppler < Formula args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-xpdf-headers"] # Explicitly disable Qt if not requested because `POPPLER_QT4_CFLAGS` won't # be set and the build will fail. - args << ( qt? ? '--enable-poppler-qt4' : '--disable-poppler-qt4' ) - args << '--enable-poppler-glib' if glib? + args << ( build.include? 'with-qt4' ? '--enable-poppler-qt4' : '--disable-poppler-qt4' ) + args << '--enable-poppler-glib' if build.include? 'with-glib' system "./configure", *args system "make install" |
