wiki:Getting started developing SHR

Version 20 (modified by Ben, 3 years ago) (diff)

i will create a page describing how to create new applications from scratch

To develop SHR' applications, you will have to setup a little more than required to build SHR image. First you must have a good setup which allow you to build correctly a SHR image, see Building SHR.

From SHR build system root directory, go into shr-unstable directory:

cd shr-unstable

Now you have to download sources into a new subdirectory

git clone shr-apps

Setting the build system to prefer local apps

Now you must setup OpenEmbedded to select your local sources instead of official ones (from SHR repository). To do this edit conf/local.conf and add the following line:


Override bitbake recipe variables

OpenEmbedded, which is the SHR underlayer build system, intensely use OVERRIDES concept. These OVERRIDES allow user to remplace some variables content without tweaking the original recipe. OVERRIDES variables are defined in openembedded/conf/*. This is a part of openembedded/conf/bitbake.conf:

OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"

In example with libframeworkd-phonegui-efl: SRC_URI is defined in this library's bitbake recipe, you want to made your own version of this library but you don't want to modify original one. So according to OVERRIDES, you can set SRC_URI_pn-${PN} where ${PN}='libframeworkd-phonegui-efl' to override original value of SRC_URI for libframeworkd-phonegui-efl original recipe.

Applied to our goal, which is to develop locally SHR applications, you must override four variables: SRC_URI (where does source come from), SRCREV (source revision), SRCPV (program version) and S (working directory when compiling).

To do that, create or edit conf/ with the following content (i.e libframeworkd-phonegui-efl):

SRC_URI_pn-libframeworkd-phonegui-efl = "file:///path/to/shr-apps"
SRCREV_pn-libframeworkd-phonegui-efl = "LOCAL"
SRCPV_pn-libframeworkd-phonegui-efl = "LOCAL"
S_pn-libframeworkd-phonegui-efl = "${WORKDIR}/shr-apps/shr/${PN}"

This will cause the directory pointed to by SRC_URI (shr-apps in the example) to be copied to ${WORKDIR} for compilation, and the actual source of the application (i.e., the directory where ./configure and make will be run) is expected to be found in S. If unset, S defaults to ${WORKDIR}/${PN}-${PV}.

To know the best practice to contribute SHR, please refer to Coding Conventions.

Now you can start to Developing SHR or Developing your own applications.