Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

wkhtmltopdf 0.11.0_rc1 + fix 64bit compile error #11400

Closed
wants to merge 1 commit into from

Conversation

2bits
Copy link
Contributor

@2bits 2bits commented Apr 2, 2012

  • Upgrade wkhtmltopdf to version 0.11.0_rc1
  • Adjust existing inreplace because the file has a different name.
  • Fix compile error when 64bit Qt4 doesn't have i386 symbols by
    using inreplace to set the qmake build as 64bit, not universal.
  • Use qmake -spec macx-g++ to configure it, from Sharpie.
  • Temporarily set DYLD_LIBRARY_PATH to help the binaries find
    libwkhtmltopdf.0.dylib for generating the man pages.
  • Adjust command to generate man page, as wkhtmltopdf is in bin.
  • Add command to generate man page for wkhtmltoimage.
  • Add command to install wkhtmltoimage.
  • Add command to install wkhtmltoimage.1 into man1.
  • Add command to install all libraries.

Built and tested by converting a url to pdf on Lion and 64bit SL
using all five compilers from XCode-4.3.2 and 4.0.2.

Fixes #9265

* Upgrade wkhtmltopdf to version 0.11.0_rc1
* Adjust existing inreplace because the file has a different name.
* Fix compile error when 64bit Qt4 doesn't have i386 symbols by
using inreplace to set the qmake build as 64bit, not universal.
* Use `qmake -spec macx-g++` to configure it, from Sharpie.
* Temporarily set DYLD_LIBRARY_PATH to help the binaries find
libwkhtmltopdf.0.dylib for generating the man pages.
* Adjust command to generate man page, as wkhtmltopdf is in bin.
* Add command to generate man page for wkhtmltoimage.
* Add command to install wkhtmltoimage.
* Add command to install wkhtmltoimage.1 into man1.
* Add command to install all libraries.

Built and tested by converting a url to pdf on Lion and 64bit SL
using all five compilers from XCode-4.3.2 and 4.0.2.

Fixes Homebrew#9265
@juggy
Copy link

juggy commented Apr 10, 2012

Does this address the issue of patched QT (discussed here in "reduced fonctionalities" section http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html)?

@2bits
Copy link
Contributor Author

2bits commented Apr 10, 2012

I'm fairly certain the admins would not accept brewing their patched Qt4. So I maintained the current method of building this against the one Homebrew provides. It will have one or more of those deficiencies you linked. However, OSX's Preview can overcome at least the first major one, if you are willing to do the task manually,

  • Printing more then one HTML document into a PDF file.

If you have two different pdfs open in two Preview windows, you can drag one and drop it on the other to concatenate them. Because documentation can get outdated, though, I would try to do it in wkhtmltopdf first. It might work.

@juggy
Copy link

juggy commented Apr 10, 2012

This code runs server side :P

I spent almost a day to other month wondering why my headers were not printing properly locally. It was because of the homebrew wkhtmltopdf installation missing the patched QT.

Before building wkthmltopdf, would it make sense to copy the patches to a previously built qt installation and rebuild it?

@2bits
Copy link
Contributor Author

2bits commented Apr 10, 2012

Yeah, running server side it would be useful to have. I'll investigate whether it's possible to option --build-patched-qt4. This could be acceptable if it has no chance of clobbering Homebrew's Qt4. Getting it reviewed is another thing, because spending a couple of hours compiling it on different platforms would be a low priority. You asked if we could craft it so that it copies the patches and applies them to the Qt4 we have in the Cache. I don't think that would fly, because it would take too much upkeep. Let me see, and I'll get back to you.

@2bits
Copy link
Contributor Author

2bits commented Apr 15, 2012

@juggy I managed to craft a formula that will build their patched qt4 as an option. It has a runtime bug that I'm working out. I noticed on their website that someone had crafted a precompiled wkhtmltopdf for OSX, built with their patched Qt4. Did you try that one? The discussion about it is located here. Maybe you can test that, because mine will be nearly identical, and it would be shame if it didn't work for you.

@adamv
Copy link
Contributor

adamv commented Apr 29, 2012

Pulled this fix - thanks @2bits .

@thomasbachem
Copy link

@2bits could you publish your formula with a patched qt4?

@2bits
Copy link
Contributor Author

2bits commented May 18, 2012

This is a new version of the wkhtmltopdf formula that supports stable 0.9.9, devel 0.11.0_rc1, and building against their patched Qt4 if you build devel and use the option. There were significant link errors building 0.9.9 against their patched Qt4, where the qmake step creates a Makefile that tries to link with -lqjpeg -lqtiff -lqpng -lqgif -lqsvg which don't exist (they are all combined into one large -lQtGui). There is no way I will be able to get that to work. Because I can't get anyone to give me a URL that they claim takes 40sec to convert with 0.11.0_rc1 while 0.9.9 takes only 5sec, I have no way to verify how well this works. What I can tell you is that it is very fast for me on a Core i5 with 8MB of RAM. If you want to try out this new formula, download the raw version to /usr/local/Library/Formula/wkhtmltopdf.rb and do one of these:

brew install --devel --build-patched-qt wkhtmltopdf

would be the way to get all the benefits, whereas

brew install wkhtmltopdf

is how you brew 0.9.9 against Homebrew's regular Qt4. I tested this on Lion with clang and llvm from XCode-4.3.2,but I can't remember if I tested it on Snow Leopard, sorry.

@2bits
Copy link
Contributor Author

2bits commented May 18, 2012

@antialize Am I correct that wkhtmltopdf-0.9.9 will not build anymore against the patched Qt4? It won't link from my tests.

@2bits
Copy link
Contributor Author

2bits commented May 24, 2012

I updated the formula in the gist https://gist.github.com/2724019 because I made a typo where I used && instead of and which was causing it to skip building the patched qt. Sorry bout that.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wkhtmltopdf fails to install
4 participants