Skip to content

Instantly share code, notes, and snippets.

@abraham
Last active August 29, 2015 14:27
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 abraham/3fc0909958d90bdea89e to your computer and use it in GitHub Desktop.
Save abraham/3fc0909958d90bdea89e to your computer and use it in GitHub Desktop.
Brew formula to install wkhtmltopdf v0.9.9 with sha256
# SHA256 install formula to install wkhtmltopdf v0.9.9
# Source: https://gist.github.com/abraham/3fc0909958d90bdea89e
# Modified from https://raw.githubusercontent.com/mxcl/homebrew/6e2d550cf4961129a790bfb0973f8e88704f439d/Library/Formula/wkhtmltopdf.rb
require 'formula'
class Wkhtmltopdf < Formula
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'
homepage 'http://code.google.com/p/wkhtmltopdf/'
sha256 'e6311c0d398d50c757d43d34f1f63c4b33010441e97d07e92647542419ab1a8b'
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
# Always creates a useless .app doh,
# AFAIK this is fixed in 0.10.0beta
wkhtml_bin = 'wkhtmltopdf.app/Contents/MacOS/wkhtmltopdf'
wkhtml_man = "#{name}.1"
system "qmake"
system "make"
system "#{wkhtml_bin} --manpage > #{wkhtml_man}"
# install binary and man file
bin.install wkhtml_bin
man1.install wkhtml_man
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment