Monday, February 7, 2011

Living on the (nightly QtCreator) edge

Sometimes even a Tech Preview or Beta of the QtSDK or QtCreator seems too far behind, especially when you see that something that bugs you has already been resolved in the mystical master branch. My favourite is for example that I can start my Maemo apps without going through the packaging step. If you are in similar shoes, and you (and your projects) are not afraid to be mentally traumatized, cut and maimed by the bleeding edge (you have been warned !), you can always grab the stuff from gitorious. Except, building QtCreator can be a drag, especially if you're not on per tu with gitorious. This brings us to the crux of the matter:

The QtCreator nightlies

Yes, I pretty much made a blog post and a long intro just to give you this link - lame, I know :) You have Windows, Mac, Linux32 and Linux64 binaries there. Note that sometimes a particular platform might be missing due to build failures - in that case just go ../ from the latest directory and check previous day or two. The general advice is to install the nightly in a different directory (i.e. not within the QtSDK). A special note is that QtCreator keeps some of it's settings as global, which is a double-edged sword - on one hand it makes easier to use the same Qt versions and rootstraps in both the stable and nightly QtCreators, but also can lead to config pollution if going back-and-forth between various versions which might require an SDK reinstall (you have been warned - again !).

Keep the Qt applications flowing and have Qt fun(k) !


Saturday, February 5, 2011

Generating maemo.org compatible source packages from QtCreator

I hear this question every now and then - how do you avoid going to the command line and/or scratchbox to generate your uploads for Extras ? There are plenty of ways of doing it (simple and not-so-simple), with some guidance even, but here's the 'how I do it' post:

First of all, you'll need a fairly recent QtCreator. Today, that means the QtSDK 1.1 Beta. When you have that installed, all you need to do to get your .source package is add a custom build step in Projects -> Maemo -> Build:


The stanza you need is a bit of MADDE/debian magic, but fairly simple:



Windows folks - don't panic, you can do this, too, just use \QtSDK\Maemo\4.6.2\wbin\mad.cmd as the command. For the lazy typists, here's a plaintext for copy-paste:


dpkg-buildpackage -sa -S -uc -us

That's all there is to it ! Whenever you want to publish something to maemo.org, you just tick the 'Enable custom process step' and voila, after the build you'll have your .tar.gz, .changes and .source files good to go, no console or scratchbox tinkering required.

A few caveats, though:

  • This will work only after you have successfully built a binary package (deb) at least once (as that generates some of the necessary files - like changelog)
  • The Maemo/4.6.2 directory name is a known bug. In reality it contains Qt4.7, don't let that confuse you
  • If you want to sign your packages, remove the "-uc -us" from the command arguments (make sure you have previously set up your RSA keys correctly, of course).


Have Qt fun(k) and see you in Extras !