Posts Tagged ‘patches’

KOffice on OpenSolaris

Sunday, January 24th, 2010

KWord on OpenSolaris screenshotInge Wallin recently blogged about the portability of KOffice — spurred on, no doubt, by the success of the port to the Nokia n900 and to Haiku. So he listed GNU/Linux, Mac OSX, Windows, FreeBSD (thanks, Inge, for checking), Haiku. That list is missing (Open)Solaris though, which as a UNIX flavor. ought to be a pretty simple target.

Of course, Solaris has been a primary target for OpenOffice for ages, so KOffice is a little late to the game on this particular platform. But I guess that’s my fault, since I’m one of the packagers for KDE4 on Solaris, and I hadn’t gotten around to it yet. So this weekend I spent a little under two hours hammering together a specfile (RPM-style) for koffice and getting the whole darn thing to build. Screenshot of KWord in action as proof. I tried KPresenter as well, but that crashed on changing the list style, so I didn’t think that was a good demonstration.

Of course, no port is without its patches, so here they are:

  • constness — this patch matches the constness of parameters in definitions with those in declarations, so that int foo(const int) is defined with int foo(const int i) and not as int foo(int i). Now, since the last time constness-matching blew up, I’ve learned that this is really a bug in Sun’s compiler, because constness is not supposed to be mangled into the name. However, I’ll claim that code neatness demands that they match, anyway.
  • double — some math functions like sqrt() can take both float or double, and Sun’s compiler doesn’t just pick one when you pass it integer parameters, so we need some explicit disambiguation. This is common all across the KDE codebase.
  • NaN — the KOffice code uses val != NAN which uses the gcc-specific NAN #define; probably !isnan() is better.
  • math — the header file math.h in Solaris uses the identifier “exception”, which becomes ambiguous in the context of the STL, so it needs to be included earlier, rather than later. This patch bungs in math.h as the first include in a number of C++ files — not necessarily something to merge upstream, because it’s mostly working around a bug elsewhere.
  • stupid — yes, this is a stupid patch. I can’t convince Sun Studio that 8.5 * 1440 is an secretly an integer constant and that it shouldn’t complain about a bunch of initializers in the MS Word import filters. I’m not really sure what’s going on here, it’s something special about static const initializers of class variables, since doing the same in a non-class context works just fine.

So there you have it. Five tiny patches for a codebase of a little over 600000 lines of code. Nice. Tip of the hat (I have lots of hats, but all of them are baseball caps and I don’t have a decent Stetson) to Inge and the KOffice folks for a nice portable office suite. You may be troubled, but your code is good.

Travel and To-Do

Wednesday, June 10th, 2009

Spent yesterday in Germany. The usual applies: nice train ride and for once the ICE from Arnhem wasn’t horrifically late or broken down (for some reason the ICE in the Netherlands and on the stretch to Oberhausen is unreliable, but after that very good). Battery life of laptop pretty much as expected and published: a little over 2 hours. That’s fine for the purposes for which I bought it. Ridiculously pleased about German food. For some reason I nearly always leave a Dutch restaurant feeling like I got ripped off, while schweinhaxe (pork hock) and beer (I didn’t count, but it was tasty) seemed like an excellent deal. Thought a little about a To-Do list based on the hacking on KDE 4.3 that I’ve done recently — very often patches get delayed and then blocked because of freezes and then bumped to the next cycle and delayed again .. it’s a maintainence nightmare when fixes are not sent upstream (e.g. to KDE SVN).

  • File bug report for CMake’s FindBoost. Attach patch to that bug report.
  • Fix up KPilot’s akonadi resources wrt. Boost includes.
  • Figure out how to package soprano — I’m told that KDE 4.3 beta relies on an unreleased Soprano version. Guys, that just makes it more difficult to build, package and test stuff.
  • Write a spec file / package for the oxygen icons so that KDE looks less empty — or less tango-y, as the case may be. Thanks to sebas, nuno and other commenters who pointed out that they have moved.
  • Finally merge in the kpci nested-anonymous-union changes.
  • Try to change qstringmatcher.h so it doesn’t define a type in an anonymous union — this isn’t critical, but it’s an annoying warning to get for each and every file that is compiled.
  • And dozens more patches to upstream, but these are the ones that bother me most.