Poppler: Add option for building Glib backend
Signed-off-by: Adam Vandenberg <flangy@gmail.com>master
parent
740a7045c6
commit
4f354685eb
|
@ -1,5 +1,7 @@
|
|||
require 'formula'
|
||||
|
||||
def glib?; ARGV.include? "--with-glib"; end
|
||||
|
||||
class PopplerData < Formula
|
||||
url 'http://poppler.freedesktop.org/poppler-data-0.4.4.tar.gz'
|
||||
md5 'f3a1afa9218386b50ffd262c00b35b31'
|
||||
|
@ -12,11 +14,13 @@ class Poppler < Formula
|
|||
|
||||
depends_on 'pkg-config' => :build
|
||||
depends_on "qt" if ARGV.include? "--with-qt4"
|
||||
depends_on 'cairo' if glib? # Needs a newer Cairo build than OS X 10.6.7 provides
|
||||
|
||||
def options
|
||||
[
|
||||
["--with-qt4", "Include Qt4 support (which compiles all of Qt4!)"],
|
||||
["--enable-xpdf-headers", "Also install XPDF headers."]
|
||||
["--with-qt4", "Build Qt backend"],
|
||||
["--with-glib", "Build Glib backend"],
|
||||
["--enable-xpdf-headers", "Also install XPDF headers"]
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -24,12 +28,13 @@ class Poppler < Formula
|
|||
ENV.x11 # For Fontconfig headers
|
||||
|
||||
if ARGV.include? "--with-qt4"
|
||||
ENV['POPPLER_QT4_CFLAGS'] = `pkg-config QtCore QtGui --libs`.chomp.strip
|
||||
ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp.strip
|
||||
ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib"
|
||||
end
|
||||
|
||||
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
||||
args << "--disable-poppler-qt4" unless ARGV.include? "--with-qt4"
|
||||
args << "--disable-poppler-glib" unless glib?
|
||||
args << "--enable-xpdf-headers" if ARGV.include? "--enable-xpdf-headers"
|
||||
|
||||
system "./configure", *args
|
||||
|
|
Loading…
Reference in New Issue