diff options
| author | Charlie Sharpsteen | 2012-05-23 14:30:02 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-05-23 14:31:51 -0700 |
| commit | 6e12e07ef6501ec267ea2566d54f81770a57a401 (patch) | |
| tree | a76f92fde56344b50823576c082a25b5df069087 /Library/Formula | |
| parent | 3358a5467401127d2f288acd3e7d66931b1c86b0 (diff) | |
| download | homebrew-6e12e07ef6501ec267ea2566d54f81770a57a401.tar.bz2 | |
pdf2svg: Depend on a Requirement for Poppler-Glib
Instead of doing `pkg-config` checks, now use a Requirement that references the
installation Tab for Poppler.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pdf2svg.rb | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Library/Formula/pdf2svg.rb b/Library/Formula/pdf2svg.rb index 338b302f4..f1cd119da 100644 --- a/Library/Formula/pdf2svg.rb +++ b/Library/Formula/pdf2svg.rb @@ -1,9 +1,21 @@ require 'formula' -def have_poppler_glib? - # Not using Homebrew's system wrapper because we actually want to see the - # exit code of the command. - Kernel.system "#{HOMEBREW_PREFIX}/bin/pkg-config", "poppler-glib", "--exists" +class PopplerGlib < Requirement + def satisfied? + poppler = Tab.for_formula 'poppler' + poppler.installed_with? '--with-glib' + end + + def fatal? + true + end + + def message; <<-EOS.undent + pdf2svg requires the Poppler-Glib bindings but Poppler was not installed + with support for glib. Please reinstall Poppler using the `--with-glib` + option. + EOS + end end class Pdf2svg < Formula @@ -14,6 +26,7 @@ class Pdf2svg < Formula depends_on "pkg-config" => :build depends_on "poppler" + depends_on PopplerGlib.new depends_on "gtk+" depends_on "cairo" # Poppler-glib needs a newer cairo than provided by OS X 10.6.x # and pdf2svg needs it to be on PKG_CONFIG_PATH during the build @@ -24,18 +37,8 @@ class Pdf2svg < Formula end def install - unless have_poppler_glib? - onoe <<-EOS.undent - pkg-config could not find poppler-glib! Please try re-installing - Poppler with support for the Glib backend: - - brew uninstall poppler - brew install --with-glib poppler - EOS - exit 1 - end - ENV.x11 + system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking" system "make install" end |
