Monday, September 9, 2013

Adding armv7hl target to Sailfish SDK

One day I was talking with David Greaves on IRC about the possibility to add an armv7hl target to Sailfish SDK, namely Qt Creator component, as the SDK is based on Mer Qt Creator but Mer's Qt Creator is a bit outdated as it doesn't support Qt5 as Sailfish SDK does. David said that the fix for adding cross-tools to Mer SDK virtual machine shipped with has not yet been released but I got the manual fix from him, so here goes:

First go to your Mer SDK VM:

ssh -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk -p 2222 mersdk@localhost
sudo -s
Edit your /usr/share/ssu/repos.ini, go to [release] section and add to end:

mer-cross=%(releaseProtocol)://%(releaseDomain)/%(releasePath)/%(release)/mer/%(arch)/cross/
Also one must add mer-cross to: [default-repos]
release=jolla,nemo,mer-core,mer-cross
Exit your editor and then refresh your mer-cross repository with command:

Now a word of warning, this will add an experimental repository to your system!

ssu er mer-cross
ssu ur
zypper ar http://repo.merproject.org/obs/mer-tools:/testing/latest_i486/mer-tools:testing.repo
zypper ref
zypper dup

After this, go to your Qt Creator, select tab SailfishOS.
In that pages tabs, select 'Toolchains' and press install on 'Mer-SB2-armv7hl'.
The toolchain should be installed without intervention from user.

The Sailfish SDK now has arm toolchain installed by default, so you only need to add a target:

The next step is to install a viable target to the SDK. Return to 'Targets' tab and make sure that Mer-SB2-armv7hl is the selected toolchain, then add whatever name you'd like for you target and as the target url add:
https://dl.dropboxusercontent.com/s/5w8uwazmdsaalgn/nemo-wayland-arm.tar.bz2

Target installation should now proceed to download the target image, unpacking it and then updating Qt Creator with the newly created target.

And that's pretty much it, you can now compile Qt5 applications with Sailfish SDK. The build will also work for Sailfish applications but running them won't work as Jolla is still to release the Silica library for armv7hl.

Stay tuned for the knowledge of getting Qt5 apps to run on your N9/50 Nemo Wayland, from within Qt Creator, in the near future!

No comments: