sparklemotion/nokogiri — pull request #976 by larskanis (2013-10-07 16:20:04+00:00)
Title: Add support for cross compiling for the x64-mingw32 platform.

This should fix https://github.com/sparklemotion/nokogiri/issues/864.

Probably the most easy way to build the mingw gems is by using the rake-compiler-dev-box: https://github.com/tjschuck/rake-compiler-dev-box
There is an issue with the strip command in the box, so you probably need this patch, too: https://github.com/tjschuck/rake-compiler-dev-box/pull/4

There are two more outstanding external issues, that are currently patched:
1. libxslt needs a patch for mingw-w64: https://bugzilla.gnome.org/show_bug.cgi?id=676511
2. patching done by mini_portile does not work in this context: https://github.com/luislavena/mini_portile/pull/23

This patch moves all MiniPortile recipes into extconf.rb. That ensures that all depending libraries are build with the same compiler version as the C-ext.

I wondered, if it wouldn't be better to also build libxml2 and libxslt with --enable-static for natives builds, but noticed the corresponding issue just now: https://github.com/sparklemotion/nokogiri/pull/923

If this patch is the way to go for you, then I would merge it with static_clean.

I've successfully tested the extension by running the unit tests on Windows-7 64-Bit with Ruby-x86 2.0.0-p0, Ruby-x64 2.0.0-p0 and Ruby-x86 1.9.3-p392.

Building the gem native on windows with the bundled libraries does not (yet) work, but requires probably only minor changes.