2010-07-09 09:30:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Wkhtmltopdf <Formula
|
|
|
|
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'
|
|
|
|
homepage 'http://code.google.com/p/wkhtmltopdf/'
|
|
|
|
md5 'df2bb84b7d15140ca14732898155dd6a'
|
|
|
|
|
|
|
|
depends_on 'qt'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
|
|
|
def install
|
2010-07-09 09:30:17 +00:00
|
|
|
# fix that missing TEMP= include
|
|
|
|
inreplace 'wkhtmltopdf.pro' do |s|
|
|
|
|
s.gsub! 'TEMP = $$[QT_INSTALL_LIBS] libQtGui.prl', ''
|
|
|
|
s.gsub! 'include($$join(TEMP, "/"))', ''
|
|
|
|
end
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-07-09 09:30:17 +00:00
|
|
|
# Always creates a uselles .app doh,
|
2010-04-07 05:58:35 +00:00
|
|
|
# AFAIK this is fixed in 0.10.0beta
|
2010-07-09 09:30:17 +00:00
|
|
|
wkhtml_bin = 'wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf'
|
|
|
|
wkhtml_man = "#{name}.1"
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-07-09 09:30:17 +00:00
|
|
|
system "qmake"
|
|
|
|
system "make"
|
|
|
|
system "#{wkhtml_bin} --manpage > #{wkhtml_man}"
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-07-09 09:30:17 +00:00
|
|
|
# install binary and man file
|
|
|
|
bin.install wkhtml_bin
|
|
|
|
man1.install wkhtml_man
|
|
|
|
end
|
|
|
|
end
|