2009-12-01 19:32:23 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-05-19 22:02:38 +00:00
|
|
|
def glib?; ARGV.include? "--with-glib"; end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class PopplerData < Formula
|
2011-02-12 10:40:43 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-data-0.4.4.tar.gz'
|
|
|
|
md5 'f3a1afa9218386b50ffd262c00b35b31'
|
2010-05-09 18:36:26 +00:00
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Poppler < Formula
|
2011-06-29 22:02:38 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-0.16.7.tar.gz'
|
2009-12-01 19:32:23 +00:00
|
|
|
homepage 'http://poppler.freedesktop.org/'
|
2011-06-29 22:02:38 +00:00
|
|
|
md5 '3afa28e3c8c4f06b0fbca3c91e06394e'
|
2010-03-18 19:07:33 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2011-06-20 23:29:11 +00:00
|
|
|
depends_on 'qt' if ARGV.include? "--with-qt4"
|
|
|
|
depends_on 'glib' if glib?
|
2011-05-19 22:02:38 +00:00
|
|
|
depends_on 'cairo' if glib? # Needs a newer Cairo build than OS X 10.6.7 provides
|
2009-12-01 19:32:23 +00:00
|
|
|
|
2010-08-10 20:05:20 +00:00
|
|
|
def options
|
2011-02-12 10:40:43 +00:00
|
|
|
[
|
2011-05-19 22:02:38 +00:00
|
|
|
["--with-qt4", "Build Qt backend"],
|
|
|
|
["--with-glib", "Build Glib backend"],
|
|
|
|
["--enable-xpdf-headers", "Also install XPDF headers"]
|
2011-02-12 10:40:43 +00:00
|
|
|
]
|
2010-08-10 20:05:20 +00:00
|
|
|
end
|
|
|
|
|
2009-12-01 19:32:23 +00:00
|
|
|
def install
|
2011-05-28 17:42:13 +00:00
|
|
|
ENV.x11 # For Fontconfig headers
|
|
|
|
|
2010-05-09 18:36:26 +00:00
|
|
|
if ARGV.include? "--with-qt4"
|
2011-05-19 22:02:38 +00:00
|
|
|
ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp.strip
|
2011-05-18 16:38:12 +00:00
|
|
|
ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib"
|
2010-05-09 18:36:26 +00:00
|
|
|
end
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
2011-06-20 23:29:11 +00:00
|
|
|
args << "--enable-poppler-qt4" if ARGV.include? "--with-qt4"
|
|
|
|
args << "--enable-poppler-glib" if glib?
|
2011-02-12 10:40:43 +00:00
|
|
|
args << "--enable-xpdf-headers" if ARGV.include? "--enable-xpdf-headers"
|
2010-05-09 18:36:26 +00:00
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
system "./configure", *args
|
2009-12-01 19:32:23 +00:00
|
|
|
system "make install"
|
2010-05-09 18:36:26 +00:00
|
|
|
|
|
|
|
# Install poppler font data.
|
|
|
|
PopplerData.new.brew do
|
|
|
|
system "make install prefix=#{prefix}"
|
|
|
|
end
|
2009-12-01 19:32:23 +00:00
|
|
|
end
|
|
|
|
end
|