aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Sharpsteen2011-05-19 15:18:31 -0700
committerAdam Vandenberg2011-06-20 15:05:46 -0700
commitd732c0c6727f10c054229b71f05d594ae512a9b8 (patch)
tree90ed048c86e2188bf22102c60446b58e4647174c
parent0a7de83e4909c6a054a8e58d4c5b8e0e4227cb3f (diff)
downloadhomebrew-d732c0c6727f10c054229b71f05d594ae512a9b8.tar.bz2
pdf2svg: Fix Poppler dependency and download URL
Three changes: - Download URL corrected. - Now depends on pkg-config. Also depends on Cairo as poppler-glib requires Cairo > 1.10, OS X 10.6.7 provides 1.8.6, and pkg-config needs the keg-only formula to be on the PKG_CONFIG_PATH. - Tests to see if Poppler was built with Glib support and offers a helpful error message if this backend is missing. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Formula/pdf2svg.rb27
1 files changed, 24 insertions, 3 deletions
diff --git a/Library/Formula/pdf2svg.rb b/Library/Formula/pdf2svg.rb
index 519c5f280..8cb0b53df 100644
--- a/Library/Formula/pdf2svg.rb
+++ b/Library/Formula/pdf2svg.rb
@@ -1,14 +1,35 @@
require 'formula'
+def have_poppler_glib?
+ # Not using Homebrew's system wrapper because we actually want to see the
+ # exit code of the command.
+ return Kernel.system "#{HOMEBREW_PREFIX}/bin/pkg-config", "poppler-glib", "--exists"
+end
+
class Pdf2svg < Formula
- url 'http://www.cityinthesky.co.uk/files/pdf2svg-0.2.1.tar.gz'
- homepage 'http://www.cityinthesky.co.uk/pdf2svg.html'
+ url 'http://www.cityinthesky.co.uk/_media/opensource/pdf2svg-0.2.1.tar.gz'
+ homepage 'http://www.cityinthesky.co.uk/opensource/pdf2svg'
md5 '59b3b9768166f73b77215e95d91f0a9d'
+ depends_on "pkg-config" => :build
+
depends_on "poppler"
- depends_on "gtk+" # Includes atk and cairo, through pango, if needed
+ 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
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"