2009-12-01 19:32:23 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class PopplerData < Formula
|
2011-09-25 22:46:06 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-data-0.4.5.tar.gz'
|
2012-07-14 09:00:01 +00:00
|
|
|
sha256 '3190bc457bafe4b158f79a08e8a3f1824031ec12acefc359e68e0f04da0f70fd'
|
2010-05-09 18:36:26 +00:00
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Poppler < Formula
|
2011-09-30 01:57:51 +00:00
|
|
|
homepage 'http://poppler.freedesktop.org'
|
2012-07-14 09:00:01 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-0.20.2.tar.gz'
|
|
|
|
sha256 '2debc5034e0e85402957d84fb2674737658a3dbe8a3c631e1792e3f8c88ce369'
|
2010-03-18 19:07:33 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2012-08-13 15:23:14 +00:00
|
|
|
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
|
2012-08-22 21:01:21 +00:00
|
|
|
depends_on :fontconfig
|
2009-12-01 19:32:23 +00:00
|
|
|
|
2012-08-13 15:23:14 +00:00
|
|
|
option 'with-qt4', 'Build Qt backend'
|
|
|
|
option 'with-glib', 'Build Glib backend'
|
2010-08-10 20:05:20 +00:00
|
|
|
|
2009-12-01 19:32:23 +00:00
|
|
|
def install
|
2012-08-13 15:23:14 +00:00
|
|
|
if build.include? 'with-qt4'
|
2011-09-17 05:06:22 +00:00
|
|
|
ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp
|
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
|
|
|
|
|
2011-09-27 07:52:51 +00:00
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-xpdf-headers"]
|
2011-09-17 05:06:22 +00:00
|
|
|
# Explicitly disable Qt if not requested because `POPPLER_QT4_CFLAGS` won't
|
|
|
|
# be set and the build will fail.
|
2012-08-13 15:23:14 +00:00
|
|
|
args << ( build.include? 'with-qt4' ? '--enable-poppler-qt4' : '--disable-poppler-qt4' )
|
|
|
|
args << '--enable-poppler-glib' if build.include? 'with-glib'
|
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
|
2012-05-15 18:31:21 +00:00
|
|
|
system "make", "install", "prefix=#{prefix}"
|
2010-05-09 18:36:26 +00:00
|
|
|
end
|
2009-12-01 19:32:23 +00:00
|
|
|
end
|
|
|
|
end
|