The event

The Document Liberation Project released its framework library, librevenge, the last Friday (announcement e-mail, blog post of one of the authors). At the same time, the project released new versions of all its import libraries–11 by current count–and 1 export library; all of these are based on librevenge now.

The story

Since I had always wanted to make the switch to librevenge-based libraries in LibreOffice 4.3, ever since we first started to work on librevenge in November 2013, I immediately began working on that. I had already prepared the ground for that switch some time ago, when I had extended WPXSvInputStream class with the functionality that it would need to implement librevenge::RVNGInputStream interface. I had also added import tests for many of the supported formats, in anticipation of breakage 🙂 So, all that remained was to bundle librevenge, update all the other libraries and then do some WPX-to-RVNG substitutions in writerperfect module. Sounds easy, right?
As it turned out, it was not. The first problem appeared when I tried to build librevenge as a shared library (all the other libraries are built statically for historical reasons. Most of them are only needed by a single shared library anyway.) Unfortunately it turned out that our autotools wrappers for MSVC compiler cannot handle that, so this needed special handling for MS Windows: building the code just as it was an internal library. Which should have been easy, except for the fact that the linker failed to create the DLL, without any error message. I did not have a Windows machine, so I tested the build by scheduling builds through gerrit, which made debugging the problem a bit cumbersome. After some fiddling with the code and makefiles and several hours later, I figured out that it is because the code did not export any symbol and correctly defined the macros to enable that. [Censored: several choice expletives addressed at the authors of link.exe at Microsoft.] After that, I only needed to repeat the same recipe to change libodfgen from static to shared library.
So, about a day later then I originally expected, I finally started to rebase the libraries. This went a bit smoother: I only needed to patch two of the libraries–one to avoid an unwanted dependency and the other to workaround a bug in MSVC–and make a few adjustments to gbuild to make it build on Windows. And a few more fixes to get it to build with system libraries. The whole thing was pushed to master (and a bit later to libreoffice-4-3 branch) on Monday, 3 days after the release of librevenge.
There are still outstanding items: the most important of them is that the import tests for 3 of the file types handled by these libraries fail. I suspect it is an integration problem, but I have not checked and just disabled the tests for now. After I fix these, I also want to enable the formats libmwaw and libwps newly support.

The conclusion

Now it is time to return to the topic sentence and say together with ./configure:

checking which librevenge to use... external
checking for REVENGE... yes
Advertisements