homebrew-core/Formula/poppler.rb

51 lines
1.4 KiB
Ruby
Raw Normal View History

require 'formula'
def glib?; ARGV.include? '--with-glib'; end
def qt?; ARGV.include? '--with-qt4'; end
2011-03-10 05:11:03 +00:00
class PopplerData < Formula
url 'http://poppler.freedesktop.org/poppler-data-0.4.5.tar.gz'
md5 '448dd7c5077570e340340706cef931aa'
end
2011-03-10 05:11:03 +00:00
class Poppler < Formula
2012-01-27 08:42:45 +00:00
url 'http://poppler.freedesktop.org/poppler-0.18.3.tar.gz'
2011-09-30 01:57:51 +00:00
homepage 'http://poppler.freedesktop.org'
2012-01-27 08:42:45 +00:00
md5 'd70d2d63d8acd29c97185f7e5f09c9b4'
depends_on 'pkg-config' => :build
depends_on 'qt' if qt?
depends_on 'glib' if glib?
depends_on 'cairo' if glib? # Needs a newer Cairo build than OS X 10.6.7 provides
2010-08-10 20:05:20 +00:00
def options
[
["--with-qt4", "Build Qt backend"],
["--with-glib", "Build Glib backend"]
]
2010-08-10 20:05:20 +00:00
end
def install
ENV.x11 # For Fontconfig headers
if qt?
ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp
ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib"
end
args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-xpdf-headers"]
# Explicitly disable Qt if not requested because `POPPLER_QT4_CFLAGS` won't
# be set and the build will fail.
args << ( qt? ? '--enable-poppler-qt4' : '--disable-poppler-qt4' )
args << '--enable-poppler-glib' if glib?
system "./configure", *args
system "make install"
# Install poppler font data.
PopplerData.new.brew do
system "make install prefix=#{prefix}"
end
end
end