Friday, September 28, 2007

On the way to desktop freedom

Not so long ago, I blogged about my strive to get rid of the need of running non-free operating systems while developing and maintaining my (our) different libraries. One step towards freedom was to find different emulators that could help to generate WordPerfect documents. That problem solved, one last thing was forcing me to have access to a non-free operating system. By the respect to our users and knowing that a typical Windows user is not really very good at operating compilers, for each release of libwpd, libwpg and other related packages, I was booting the win32 partition to maintain the MSVC project files and to build release binaries for Windows.

This time is over now. First to contribute to my liberation was the CrossToolChain repository in OpenSUSE.org Build Service. The MinGW cross-compiler is already successfully used to build the infamous unowinreg.dll during the OpenOffice.org build process. So, I gave it a shot and, after some modifications of the makefiles, the cross-compiling is a reality. What a pleasure to be able to run make -j9 and have the libraries built faster then their shadow! Inspired by some ingenious scripts by my distinguished colleague Tor Lillqvist, I even have a creation of release packages scripted and don't have to do much manually anymore. Some of the credits go also to an extraordinary expert in cross-compilations of all kinds, Rob Staudinger, who helped to implement some of needed configure options.

The last milestone that was remaining on the way to freedom was a need of Microsoft Visual Studio to maintain the MSVC project files in the different libraries. But, this problem is solved now too. The key of the solution is called CrossOver Linux Professional. Last night, helped by Uncle Google, I managed to install Visual C++ 6.0 SP6 in a managed bottle. The cool thing with the Professional version is that once the bottle properly installed and configured, one can create an RPM package and deploy it on other computers. And the application is basically accessible to all users of the computer.

For those who are impatient to see how MSVC running under linux looks, here is what you are waiting for!

By the way, I forgot to say that if you are running one of SuSE or Fedora Linux distributions and are keen to have the newest of the newest for libraries that I maintain or contribute to, you might find useful packages in my home project in our dear openSUSE build service. It is enough to chose your distribution and point the yum, zypper or other favourite package manager to the corresponding repository. So, pick the packages and taste how sweet they are!

Tuesday, September 25, 2007

WPG Import

Recently in Barcelona, I was interested to hear there was some confusion over how the beautiful Word Perfect Graphics import was created. Since it is now shipping in most ooo-build based OO.o 2.3 versions, it'd be great to give full credit for all those who got over the time involved in it's creation and use in various FOSS applications.

Time-line

At certain point in 2006 I realized that because of lack of time I was neglecting one little useful library that I was also developing, libwpg and I made in my blog a call for new developers hoping that someone will bite the bullet.

Mathias Bauer (from Sun Microsystems) contacted me and proposed me work on this library could become part of OpenOffice.org SoC projects for 2006. After some e-mail exchanged, we agreed on the modalities of the participation: that libwpg will be developed as a standalone library (since it already existed as such) under LGPL because it was meant to be reused by other applications. Another agreement was that the goal was that the output of the Summer of Code will be standalone converter for wpg files to odg file format. This converter was supposed to be licensed under LGPL and its author was supposed to share his copyright with Sun under our beloved JCA terms.

Summer of Code candidate

I was contacted by several students in private and my choice was Ariya Hidayat of Koffice fame. The reason was that I knew his code and was quite sure about him being able to do good work on the library and converter. I worked (in my own free time, btw) together with him during the SoC on separable features, like reverse-engineering the WPG1 palette or implementing OLE2 stream abstraction. And it was really great to collaborate with Ariya who is an extraordinary hacker. What was promissed, that was done. Ariya's project got accepted for the Google summer of code, he signed the JCA, developed the library and added into it WPG2 support. In the same time, he developed a command-line tool called wpd2odg in a separate module. When the GSoC came to the end, the conditions for a successful accomplishment of the project were satisfied, the student got USD 4500 reward, Team OpenOffice.org e.V. got USD 500 and some Google swag like t-shirts and (paper) notebooks changed hands too. The "contract" was fullfilled and everybody was happy in the best of the worlds.

During the work on his Summer of Code, Ariya did an extensive blogging action, and one of Inkscape developers used a private copy of not yet released libwpg as a base for their WPG import.

After the Summer of Code

During the nights of the OpenOffice.org conference in Lyon, instead of sleeping, your servant was trying to implement a WPG import plugin as an add-on component for OpenOffice.org, one of those beasts that one builds using the SDK and that one installs using the Extension manager. It became clear that one had to refactor the wpg2odg command-line tool from scratch so that it generates Sax messages instead of a string in ODG file-format. At the end of conference, there was a refactored version of the wpg2odg tool and a non-working wpg import filter plugin for OpenOffice.org. Your servant's little brain managed to debug the plugin and have it detect correctly the WPG files and actually show some images only at the begining of October 2006.

Immediately, an OpenOffice.org integration was intented. It means, your servant tried to incorporate this plugin into the OpenOffice.org build-system as a new module. Nevertheless, since the implementation met some problems of locking when trying to imbue a locale into a C++ std::ostingstream, and your servant was pretty busy looking for a job that would help him feed his family, the work stopped there.

In the meantime, Dom Lachowicz of AbiWord fame modified the libwpg library adding into its API an SVG generating class so that it could be better reused by SVG supporting applications. Later, Marc "uwog" Maurer, implemented, using the libwpg SVG generation class, an AbiWord plugin enabling use of WPG cliparts in AbiWord files.

Hired in March 2007 by a nice company to work on OpenOffice.org, your servant requested permission to do some work on WPD and WPG filters in company time. The permission was granted and the whole odg generation framework used in the previous plugin rewritten to avoid having to use the problematic imbue on the stream (or the stream at all). The result is a patch that landed into ooo-build on 7th of May 2007. Since then, it underwent many changes due to the sharp eyes of Rene Engelhard and also due to an extensive QA by Sum1 whose favourite sport of trying to crash and tear down anything I produce is a great way to assure that my software is having a good quality inspite of the limited brain activity that TrainedMonkey is capable of.

This Summer, Ariya worked again on the libwpg library and added conversion of WPG bitmaps embedded in WPG files. During the Novell Hackweek, your servant wrote a BMP generator to be able to pass these bitmaps to OpenOffice.org and also added handling of embedded binary objects in alien file-formats (wmf, png, eps, ...). Again, thanks to AbiWord's Sum1, we were able to add handling of bitmaps in almost all supported colour-depths (indexed and direct). The result of this work is to be found in any ooo-build based OpenOffice.org 2.3 version.

Who did what

Libwpg library was written by Marc Oude Kotte, Marc Maurer, Fridrich Strba, and Ariya Hidayat. Some of the copyrights are owned by Novell because your servant was working on this library in his company time too. Some build patches were submitted by Robert Staudinger of AbiWord fame. The library is released under the terms of LGPL with some parts being licensed under BSD license.

Wpg2odg (command-line tool and the OpenOffice.org WPG import plugin extension) was written by Ariya Hidayat and Fridrich Strba. Sun Microsystem is joint copyright holder of some parts of Ariya's code and Novell is owning copyrights of some code contributed by your servant. This tool/plugin is released under the terms of LGPL with some parts being licensed under BSD license. One can use it as an OpenOffice.org extension, provided that one has libwpg library installed on the system. As a matter of fact, it runs even on some non-free operating systems with some non-free office suites.

The integrated WPG import filter in ooo-build is licensed under the terms of LGPL and copyright holders are Fridrich Strba with Novell for a huge majority of the code, Ariya Hidayat jointly with Sun Microsystems (for certain parts of the code). The patches from the above-mentioned links are free software and can be used by anyone under the terms of LGPL.

I would like to thank all those who contributed to making wpg import a reality on the free software desktop. And for those who are interested, libwpd 0.9.0 (whenever its release happens), will use libwpg for converting images embedded in WordPerfect documents.

Thursday, September 13, 2007

Emulators

Writing import filters for different WordPerfectTM file-formats can be fun and rewarding. Nevertheless, apart one rare exception, all WordPerfectTM versions run on non-free systems (Solaris Sparc, Mac OS, Micro$oft Windows). As a free and opensource software developer, moved by the will to be consistent with my own convictions, I develop using free operating system. But for filter development, and especially in cases where the documentation available is rather sketchy, it is a necessity to do some reverse-engineering. For this, one is really obliged to have working copies of different versions of WP. And also to run some versions of non-free operating systems. Nevertheless, having a server room in one's appartment can be considered as wife-and-kids-unfriendly act, and rebooting every five minutes to another partition is not so efficient workflow-wise. The good news is that a big part of the problem can be solved using free software.

For Windows versions, a solution was already outlined by Ariya some time ago. I modified a little bit the software installed and managed to fit all the necessary Windows and DOS versions of WordPerfectTM on less then half GB disk image running a 98lite-modified version of Windows 98SE. The screenshot of this situation can be found here. The advantage is that such an image is fitting quite confortably on a USB stick.

Another problem was the Mac OS versions. And here it is really crucial to have a running versions. Because for some of the old file-formats, the only documentation that web is able to give you is the libwpd source code and this blog entry. And inspite of the "Mac Mini donated by unnamed on behalf of unnamed", the situation was less then optimal. Besides the fact that my KVM switch supports only PS/2 keyboard/mouse ports and a normal VGA monitor connector, it is quite difficult to use the Mac Mini when traveling. And frankly, MacOSX is quite an overkill for applications that install and work happily in a MacOS8 running on a Quadra. After looking on internet, I decided to give a ride to the Basilisk II emulator. After some time of struggling and helped extensively by Filip Molcan, Hubert Figuiere and hsfutils, I am able to run a little MacIntosh on each of my GNU/Linux computers, i386 as well as x86_64.

Although I installed all this thing on a disk image of 512MB, I realze that I have still more then 400MB of free space there. But even 512MB is small enough to back it up on a CD and put it somewhere on a USB stick. I also have to admit that I am quite impressed by the stability and speed of BasiliskII emulation. On modern processors, the emulated MacOS8 works faster than I ever have seen it running on a native Apple hardware back then when we were still young and handsome. I will not go into the details of the installation, but if the popular demand is there, I might document things that are not well documented on the web.

So, now only one little problem remains. How to run the WordPerfectTM 5.1 for Solaris Sparc? Anybody knows about an emulator that could run the version 2.5 of this proprietary system?

Wednesday, September 12, 2007

Amused

I was mildly amused when reading Michael's blog. Suarez-Potts had nothing else to invent to bash Novell then to start to criticise the way they spent money to bring developers to one place. In my not so humble opinion, inspite of the food served in the "World Capital of Gastronomy", there was not really anything to say against that experience. It was way better then the some-special-selected-people dinner sponsored by another company in Koper.

I was just wondering whether it is the same Suarez-Potts that did not refuse to profit of Google hospitality (flight and hotel payed) during the Google Summer of Code "Mentor" Summit. Funny enough, I don't remember suddenly what was the Summer of Code project he was mentoring last year.

But the bottom-line of this is that LSP is even criticizing the fact that people want to contribute engineering resources and try to encourage developers to contribute to OpenOffice.org. Just wondering whether Louis has an idea about what a FOSS project is. It is all about producing software and as good software as possible. As a by-product of this, there can be human relationships of other type that come to be, but the focus is still on the software.

Although it is true that OpenOffice.org project "structures" are quite efficient at producing talking shops instead of developers, this situation should be considered more as a dysfunction then as a normality. As well as it should be considered dysfunctional to have someone who is not developer representing OpenOffice.org at hacker's meetings. What is the argument such a person can have to encourage contributions? What level of understanding of everyday concerns of a FOSS hacker?

Frankly, it should be our target to fight these dysfunctions. And only if we succeed in this, there is hope that the "OpenOffice.org Community Manager" will have actually something to manage.

Friday, September 07, 2007

x86_64 tinderbox slave

Just to tell you that we just added into the OpenOffice.org tinderbox build an x86_64 slave. Moreover, it builds with gcc-4.1.2 and with FSF java. So, if your build breaks in java files, check whether you did not write in an "übersetz mich" or other umlaut containing words. The other typical errors might be extra qualifications in declarations of C++ classes and/or treating of ULONG/LONG as if they were assured to be 32-bits. Keeping this in mind might prevent too frequent red status.

Thanks to Intel that provided this machine last year. And thanks to Christian Lohmaier who is guiding it and forcing it to do the right thing.