2010-03-01 13:44:59 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-05-23 21:30:02 +00:00
|
|
|
class PopplerGlib < Requirement
|
2013-01-19 01:30:43 +00:00
|
|
|
fatal true
|
|
|
|
|
2013-01-20 02:45:59 +00:00
|
|
|
satisfy :build_env => false do
|
|
|
|
Tab.for_formula("poppler").installed_with? "--with-glib"
|
2012-05-23 21:30:02 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
pdf2svg requires the Poppler-Glib bindings but Poppler was not installed
|
|
|
|
with support for glib. Please reinstall Poppler using the `--with-glib`
|
|
|
|
option.
|
|
|
|
EOS
|
|
|
|
end
|
2011-05-19 22:18:31 +00:00
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Pdf2svg < Formula
|
2011-05-19 22:18:31 +00:00
|
|
|
url 'http://www.cityinthesky.co.uk/_media/opensource/pdf2svg-0.2.1.tar.gz'
|
|
|
|
homepage 'http://www.cityinthesky.co.uk/opensource/pdf2svg'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '12f9d1bde6aa2e396eb7f196b6d8e29ade3cafe6'
|
2010-03-01 13:44:59 +00:00
|
|
|
|
2011-05-19 22:18:31 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
|
2012-06-07 01:35:12 +00:00
|
|
|
depends_on :x11
|
2010-03-01 13:44:59 +00:00
|
|
|
depends_on "poppler"
|
2012-05-23 21:30:02 +00:00
|
|
|
depends_on PopplerGlib.new
|
2011-05-19 22:18:31 +00:00
|
|
|
depends_on "gtk+"
|
|
|
|
depends_on "cairo" # Poppler-glib needs a newer cairo than provided by OS X 10.6.x
|
|
|
|
# and pdf2svg needs it to be on PKG_CONFIG_PATH during the build
|
2012-02-19 04:12:59 +00:00
|
|
|
def patches
|
|
|
|
# fix call to poppler to render normal thickness lines in firefox
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2010-03-01 13:44:59 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2012-02-19 04:12:59 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- pdf2svg-0.2.1/pdf2svg.c.ORIG 2008-02-01 10:28:35.000000000 -0800
|
|
|
|
+++ pdf2svg-0.2.1/pdf2svg.c 2011-11-26 03:56:15.000000000 -0800
|
|
|
|
@@ -65,7 +65,7 @@
|
|
|
|
drawcontext = cairo_create(surface);
|
|
|
|
|
|
|
|
// Render the PDF file into the SVG file
|
|
|
|
- poppler_page_render(page, drawcontext);
|
|
|
|
+ poppler_page_render_for_printing(page, drawcontext);
|
|
|
|
cairo_show_page(drawcontext);
|
|
|
|
|
|
|
|
// Close the SVG file
|