[SailfishDevel] Building with the SDK without QtC

David Greaves david.greaves at jollamobile.com
Sat Jul 27 19:10:37 UTC 2013


On 27/07/13 19:28, Lucien XU wrote:
> Hello,
> 
> I have asked the question in #SailfishOs, but it might be better to have it 
> archived in the mailing list.
> 
> We were talking about the advantages of vim vs QtCreator in JollaFr's channel, 
> so I was wondering if there is a way to code for Sailfish with a vim / editor 
> +  terminal.
> 
> The only problem is about building and deploying to simulator, but that could 
> be solved by some scripts, instead of clicking on the build / run button. But 
> we don't know how QtC manage the builds itself.
> 
> Anyone have more insights about it ?

The short answer is that there is a script in the VM called mb2 which wraps a
few commands. (Well, it is in the next release of the SailfishSDK - you'll need
to wait a short while for it to try this stuff out yourself)

Normal operation is for QtCreator to ssh into the VM, cd to the corresponding
src dir and run mb2. This wrapper takes

Here are 2 QtC 'command' : Equivalent sequences

qmake: ssh mersdk at localhost -p 2222 -i
~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk cd $src \; mb2 -t $target qmake

make: ssh mersdk at localhost -p 2222 -i
~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk cd $src \; mb2 -t $target make

The -t $target is optional and has a default and simply ensures the right
architecture and build-target-fs are used. So normal cli operation is mb2
make;mb2 qmake

Given a properly setup devices.xml configuration there is also a 'deploy'
command which takes --rsync and --zypper options. This will either rsync the
results of a "make install" to a private area on-device (quicker for daily
compile/deploy/check hacking) or will install the built rpm (for better QA checks)

Code is here: https://github.com/mer-tools/sdk-setup/blob/master/src/mb2#L31

Obviously the current focus is on making this all work 'out of the box' for the
SDK whilst keeping the normal Qt qmake/make experience - but  am keen to make
this type of script work for general day-to-day work. (In fact the undocumented
"mb2 build" command is used internally in jolla and I use it to develop the Mer
and SDK packages themselves)

HTH

David

PS I did a talk which touched on this at Akademy2013:
 http://www-ftp.lip6.fr/pub/X11/kde-applicationdata/akademy/2013/videos/David_Greaves_-_Mer_and_Qt.webm



More information about the Devel mailing list