2009-12-01 19:32:23 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Poppler < Formula
|
2011-09-30 01:57:51 +00:00
|
|
|
homepage 'http://poppler.freedesktop.org'
|
2014-01-14 21:46:04 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-0.24.5.tar.xz'
|
|
|
|
sha1 '7b7cabee85bd81a7e55c939740d5d7ccd7c0dda5'
|
2010-03-18 19:07:33 +00:00
|
|
|
|
2012-10-30 21:43:14 +00:00
|
|
|
option 'with-qt4', 'Build Qt backend'
|
2014-01-14 21:46:04 +00:00
|
|
|
option 'with-glib', 'Build Glib backend' # requires cairo
|
|
|
|
option 'with-lcms2', 'Use color management system'
|
2012-10-30 21:43:14 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2012-10-30 21:43:14 +00:00
|
|
|
|
2014-01-14 21:46:04 +00:00
|
|
|
depends_on 'fontconfig'
|
2012-10-30 21:43:14 +00:00
|
|
|
depends_on 'openjpeg'
|
|
|
|
|
2013-06-27 00:06:02 +00:00
|
|
|
depends_on 'qt' if build.with? 'qt4'
|
|
|
|
depends_on 'glib' => :optional
|
2014-01-14 21:46:04 +00:00
|
|
|
depends_on 'little-cms2' if build.with? 'lcms2'
|
|
|
|
depends_on 'cairo' if build.with? 'glib'
|
2010-08-10 20:05:20 +00:00
|
|
|
|
2013-12-06 17:33:24 +00:00
|
|
|
conflicts_with 'pdftohtml', :because => 'both install `pdftohtml` binaries'
|
2013-11-13 04:50:13 +00:00
|
|
|
|
2013-08-30 00:03:34 +00:00
|
|
|
conflicts_with 'pdf2image', 'xpdf',
|
|
|
|
:because => 'poppler, pdf2image, and xpdf install conflicting executables'
|
2013-08-29 17:13:15 +00:00
|
|
|
|
2013-06-09 00:29:36 +00:00
|
|
|
resource 'font-data' do
|
|
|
|
url 'http://poppler.freedesktop.org/poppler-data-0.4.6.tar.gz'
|
|
|
|
sha1 'f030563eed9f93912b1a546e6d87936d07d7f27d'
|
|
|
|
end
|
|
|
|
|
2009-12-01 19:32:23 +00:00
|
|
|
def install
|
2013-06-27 00:06:02 +00:00
|
|
|
if build.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-10-30 21:25:37 +00:00
|
|
|
#
|
|
|
|
# Also, explicitly disable Glib as Poppler will find it and set up to
|
|
|
|
# build, but Superenv will have stripped the Glib utilities out of the
|
|
|
|
# PATH.
|
2013-06-27 00:06:02 +00:00
|
|
|
args << ( build.with?('qt4') ? '--enable-poppler-qt4' : '--disable-poppler-qt4' )
|
|
|
|
args << ( build.with?('glib') ? '--enable-poppler-glib' : '--disable-poppler-glib' )
|
2014-01-14 21:46:04 +00:00
|
|
|
args << ( build.with?('glib') ? '' : '--disable-cairo-output' )
|
|
|
|
args << ( build.with?('lcms2') ? '--enable-cms=lcms2' : '' )
|
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"
|
2013-06-09 00:29:36 +00:00
|
|
|
resource('font-data').stage { system "make", "install", "prefix=#{prefix}" }
|
2009-12-01 19:32:23 +00:00
|
|
|
end
|
|
|
|
end
|