Tuesday, April 28, 2009

HUNDRED (packages in windows:mingw:win32)

It has been long time since I blogged for the last time and quite things changed since: My daughter and my son took one more year and my wife is every day more beautiful and younger.

It is not that I was not having things to blog about, but the main quality of many FOSS hackers, lazyness, is the reason of this relative quietness. But now there is something really really cool that pushes me to blog again: At the end of 2008 and in the beginning of 2009 I was trying to come up with a repeatable and dependable way to build GTK+ and GNOME software for Windows.

I, myself, maintain several libraries and I build their Win32 versions on my Linux box as I described it here. So, the cross-compilation came as a natural reflex. I inspired myself by the infrastructure that the Fedora mingw project used and started to go through the usual cycle of while (!tired()) { build(); debug; }. And last night, I reached a milestone. My package repository hosted by openSUSE Build Service received its package number hundred.

Why am I saying all this? In fact, these packages are not only there to be a decoration. Many times, people that know about my work ask me for packages of different libraries. All the stuff that I build (or almost all can be found there). People asking for win32 version of the GTK+ port of Webkit can be interested in the mingw32-libwebkit package. Those that would gladly try to use Evolution as their mail client on windows, can find the updated mingw32-evolution package useful. It is enough to add the repository to your installation sources and lauch zypper ref; zypper in mingw32-evolution mingw32-tango-icon-theme and the rpm dependency resolution mechanism will pull all you need for you. After that, you can just zip the content of /usr/i686-pc-mingw32/sys-root/mingw directory and you can unzip the resulting package on your windows box. As simple as that!

For developpers that would like to cherry-pick packages and use them to develop their own, it is the best to to fetch them from the openSUSE 10.3 version of the repository. For later releases, openSUSE's rpm uses lzma payload and it can be a bit more tricky to uncompress the packages on a typical windows machine, although 7zip should know what to do with them, I guess.

As a technical information for developpers, all the binaries are stripped of unnecessary sections and the debugging information can be found for each source package in a separate package typically named mingw32-%{name}-debug-%{version}-%{release}.noarch.rpm. Uncompressing them in the same prefix as the corresponding binary packages will cause gdb.exe to use their symbols and you can produce meaningfull traces.

I still contend that the best way to use those packages for developping your own software is in an openSUSE installation. And the side benefit is that in this way one gets not only nice development environment for Windows development, but also the arguably best operating system in the world as a host.

I might take some more courage and write about Windows porting of software when I rest from writing this blog entry. While waiting, it is worth to read this little collection of slides of my distinguished colleague and incontested master of win32 porting, Tor Lillqvist. Everything I know about win32 is because of sitting at his feet.