2009-12-01 19:32:23 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2010-05-09 18:36:26 +00:00
|
|
|
class PopplerData <Formula
|
2010-08-06 09:20:46 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-data-0.4.3.tar.gz'
|
|
|
|
md5 '2d648047e5d0b315df1571b460ee6a96'
|
2010-05-09 18:36:26 +00:00
|
|
|
end
|
|
|
|
|
2009-12-01 19:32:23 +00:00
|
|
|
class Poppler <Formula
|
2010-08-06 09:20:46 +00:00
|
|
|
url 'http://poppler.freedesktop.org/poppler-0.14.1.tar.gz'
|
2009-12-01 19:32:23 +00:00
|
|
|
homepage 'http://poppler.freedesktop.org/'
|
2010-08-06 09:20:46 +00:00
|
|
|
md5 '1d27cb8a09aaa373660fd608b258022a'
|
2010-03-18 19:07:33 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-05-09 18:36:26 +00:00
|
|
|
depends_on "qt" if ARGV.include? "--with-qt4"
|
2009-12-01 19:32:23 +00:00
|
|
|
|
2010-08-06 09:20:46 +00:00
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2010-08-10 20:05:20 +00:00
|
|
|
def options
|
|
|
|
[["--with-qt4", "Include Qt4 support (which compiles all of Qt4!)"]]
|
|
|
|
end
|
|
|
|
|
2009-12-01 19:32:23 +00:00
|
|
|
def install
|
2010-05-09 18:36:26 +00:00
|
|
|
if ARGV.include? "--with-qt4"
|
|
|
|
qt4Flags = `pkg-config QtCore --libs` + `pkg-config QtGui --libs`
|
|
|
|
qt4Flags.gsub!("\n","")
|
|
|
|
ENV['POPPLER_QT4_CFLAGS'] = qt4Flags
|
|
|
|
end
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
|
|
|
|
args << "--disable-poppler-qt4" unless ARGV.include? "--with-qt4"
|
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
|
2010-08-06 09:20:46 +00:00
|
|
|
|
|
|
|
# fix location of fontconfig, http://www.mail-archive.com/poppler@lists.freedesktop.org/msg03837.html
|
|
|
|
__END__
|
|
|
|
--- a/cpp/Makefile.in 2010-07-08 20:57:56.000000000 +0200
|
|
|
|
+++ b/cpp/Makefile.in 2010-08-06 11:11:27.000000000 +0200
|
|
|
|
@@ -375,7 +375,8 @@
|
|
|
|
INCLUDES = \
|
|
|
|
-I$(top_srcdir) \
|
|
|
|
-I$(top_srcdir)/goo \
|
|
|
|
- -I$(top_srcdir)/poppler
|
|
|
|
+ -I$(top_srcdir)/poppler \
|
|
|
|
+ $(FONTCONFIG_CFLAGS)
|
|
|
|
|
|
|
|
SUBDIRS = . tests
|
|
|
|
poppler_includedir = $(includedir)/poppler/cpp
|