Nemo/Armv7hl Development Guide

'''NOTE: This guide uses N9/N950 as an example of target device, but it should be easy enough to adapt it to other armv7hl devices! The SB2 target image, for example, is for a generic armv7hl device. '''

So, you want to help developing Nemo or want to develop your app and test it on Nemo, using N950 or N9 devices? Great! This guide is for you.

Here's how it works:
 * Flash the Nemo wayland image to your N9/N950
 * Setup a SB2 target to build package for your N9/N950
 * Build rpm packages locally for the SB2 target and test them on your device!
 * Let us know about your app on #nemomobile IRC channel!

Flash Nemo Wayland image
Grab images from here: Nemo/Installing#Images

Once you have the .tar.bz2 image file, head to Nemo/Installing to discover how to install Nemo on your device

Build and Setup SB2 target
Prerequisites:
 * A working Mer SDK setup is required. If you have not installed Mer SDK yet, read until the "Basic Tasks" section (excluded).

Once you have a working Mer SDK setup: echo 5.9.68.173 repo.pub.meego.com | sudo tee -a /etc/hosts to workaround the recent shutdown of MeeGo repositories, and sudo zypper in -t pattern Mer-SB2-armv7hl to install needed tools to crosscompile for armv7hl arch.
 * Start the SDK, and run (inside the SDK)

Now we have to build the SB2 target image: sudo mic create fs --record-pkgs=name -o /parentroot/srv/mer/targets/ --pkgmgr=zypp --arch=armv7hl  --tokenmap=MER_RELEASE:latest,NEMO_RELEASE:latest,SSU_RELEASE_TYPE:rnd,FLAVOUR:devel
 * Download the kickstart file, which is what you will pass as parameter in the next command in 
 * Now build the image with

When the process is finished: cd /parentroot/srv/mer/targets/ sudo chown -R $USER.


 * Now complete the setup of the SB2 target by following the guide available here (NOTE: you can skip the "zypper dup" command as you'll have to do it again in the next step)

ONCE YOU HAVE DONE THAT ( ^^^^^ ) STEP, do (inside the SDK): sb2 -t  -R ssu re -r latest sb2 -t  -R ssu fl devel sb2 -t  -R ssu ar http://repo.merproject.org/obs/mer:/qt:/devel/latest_armv7hl/ mer-qt sb2 -t  -R ssu ur sb2 -t  -R zypper ref sb2 -t  -R zypper dup

if, while zypper dup'ing you get some "cpio: rename failed - Invalid cross-device link" error, feel free to ignore it by press "i" and "enter"

HOW-TO: Build a package locally
To be able to build a package locally you need a .spec file which is used to package your app. If your app doesn't have a .spec file yet, you have to write one :D There are lots of tutorials, this is an example Creating the Spec File - RPM.org
 * Create a .spec file

Or you can see how we did in Nemomobile QML apps, you can find sources here Nemomobile's GitHub repo (e.g. QmlCalc .spec file)

Once you have the .spec file, run Mer SDK, and use this command to build the .rpm package :) As simple as that! cd /path/of/your/app mb2 -t SB2_TARGET_NAME build path/to/spec/file
 * Build the package

Now you have the .rpm package of your app!

HOW-TO: Deploy and install
scp /path/to/file.rpm nemo@192.168.2.15: to copy it to /home/nemo directory on your device
 * Once you have an .rpm package, plug your device to USB and use

zypper install /home/nemo/myApp.rpm
 * To install the .rpm package, just run (on device as root)