Skip to content

Instantly share code, notes, and snippets.

@sj26
Created July 16, 2015 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sj26/754b404d09a41d35cf05 to your computer and use it in GitHub Desktop.
Save sj26/754b404d09a41d35cf05 to your computer and use it in GitHub Desktop.
require 'formula'
class Wkhtmltopdf < Formula
homepage 'http://code.google.com/p/wkhtmltopdf/'
url 'https://launchpad.net/ubuntu/+archive/primary/+files/wkhtmltopdf_0.9.0.orig.tar.gz'
sha256 '628363a79c82eb835e436cd62bce1b7323aed4e707affe57c3248e337a3ed18b'
version '0.9.0'
depends_on 'qt'
def install
# fix that missing TEMP= include.
inreplace 'wkhtmltopdf.pro' do |s|
s.gsub! 'TEMP = $$[QT_INSTALL_LIBS] libQtGui.prl', ''
s.gsub! 'include($$join(TEMP, "/"))', ''
end
if MacOS.version >= :mavericks && ENV.compiler == :clang
spec = 'unsupported/macx-clang-libc++'
else
spec = 'macx-g++'
end
system 'qmake', '-spec', spec
system 'make'
`wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf --manpage > wkhtmltopdf.1`
bin.install "wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf"
man1.install "wkhtmltopdf.1"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment