2010-07-09 09:30:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Wkhtmltopdf < Formula
|
2010-07-09 09:30:17 +00:00
|
|
|
homepage 'http://code.google.com/p/wkhtmltopdf/'
|
2012-04-02 19:21:23 +00:00
|
|
|
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1.tar.bz2'
|
|
|
|
sha1 'db03922d281856e503b3d562614e3936285728c7'
|
|
|
|
version '0.11.0_rc1'
|
2010-07-09 09:30:17 +00:00
|
|
|
|
|
|
|
depends_on 'qt'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
|
|
|
def install
|
2012-04-02 19:21:23 +00:00
|
|
|
# fix that missing TEMP= include.
|
|
|
|
inreplace 'common.pri' do |s|
|
2010-07-09 09:30:17 +00:00
|
|
|
s.gsub! 'TEMP = $$[QT_INSTALL_LIBS] libQtGui.prl', ''
|
|
|
|
s.gsub! 'include($$join(TEMP, "/"))', ''
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2012-04-02 19:21:23 +00:00
|
|
|
# It tries to build universally, but Qt is bottled as 64bit => build error.
|
|
|
|
# If we are 64bit, do not compile with -arch i386. This is a Homebrew
|
|
|
|
# issue with our Qt4, not upstream, because wkhtmltopdf bundles a patched
|
|
|
|
# Qt4 that Homebrew doesn't use.
|
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
inreplace 'src/pdf/pdf.pro', 'x86', 'x86_64'
|
|
|
|
inreplace 'src/image/image.pro', 'x86', 'x86_64'
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2012-04-02 19:21:23 +00:00
|
|
|
system 'qmake', '-spec', 'macx-g++'
|
|
|
|
system 'make'
|
|
|
|
ENV['DYLD_LIBRARY_PATH'] = './bin'
|
|
|
|
`bin/wkhtmltopdf --manpage > wkhtmltopdf.1`
|
|
|
|
`bin/wkhtmltoimage --manpage > wkhtmltoimage.1`
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2012-04-02 19:21:23 +00:00
|
|
|
# install binaries, libs, and man pages
|
|
|
|
bin.install Dir[ "bin/wkh*" ]
|
|
|
|
lib.install Dir[ "bin/lib*" ]
|
|
|
|
man1.install Dir[ "wkht*.1" ]
|
2010-07-09 09:30:17 +00:00
|
|
|
end
|
|
|
|
end
|