Saturday, February 5, 2011

Generating 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, 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 !