sparklemotion/nokogiri — pull request #989 by larskanis (2013-10-27 20:22:34+00:00)
Title: Add support for cross compiling x64-mingw32 fat binary gem and add support for native builds on Windows.

This PR fixes https://github.com/sparklemotion/nokogiri/issues/864 and obsoletes https://github.com/sparklemotion/nokogiri/issues/976.

The PR moves all MiniPortile recipes into extconf.rb. That enables native builds on Windows and ensures that all depending libraries are build with the same compiler version as the C-ext when cross compiling.

Probably the most easy way to cross build the mingw gems is by using the rake-compiler-dev-box: https://github.com/tjschuck/rake-compiler-dev-box

There are currently some outstanding external issues:
1. libxslt needs to be patched for mingw-w64: https://bugzilla.gnome.org/show_bug.cgi?id=676511 This patch is already included in this PR.
2. There is an issue with the strip command in the dev-box, so you probably need this patch: https://github.com/tjschuck/rake-compiler-dev-box/pull/4
3. There is an issue with ```bundle exec``` in combination with rake-compiler's faking mechanism, that can be worked around by this patch: https://github.com/luislavena/rake-compiler/pull/83

I've successfully tested the extension by running all unit tests on Windows-7 64-Bit with Ruby-x64 2.0.0-p0 and Ruby-x86 1.9.3-p392. Both with cross compiled fat binary gem and with natively compiled source gem. They currently don't pass completely ( https://gist.github.com/larskanis/7186885 ), but they also don't pass with plain nokogiri-1.6.0 gem. I'll look at these failures later.