User talk:Emreturkay

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Adding a new application)
 
Line 1: Line 1:
== Developing Applications for OpenMoko Platform ==
 
  
=== Setting up the environment ===
 
 
The OMDIR environment variable should be set to the path in which you downloaded the Moko Makefile. All the relative paths in this tutorial are given relative to the OMDIR. Therefore the first command should be
 
 
<pre> cd $OMDIR </pre>
 
 
First we should create a local tree within our openmoko layout.
 
 
<pre>
 
mkdir local local/classes local/conf local/packages
 
cp openmoko/trunk/oe/conf/site.conf local/conf
 
</pre>
 
 
Then change the following two lines in the local/conf/site.conf file to
 
 
<pre>
 
BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/local/packages/*/*.bb"
 
BBFILE_COLLECTIONS = "upstream local overlay"
 
</pre>
 
 
and add these lines
 
 
<pre>
 
BBFILE_PATTERN_overlay = "^${OMDIR}/local/"
 
BBFILE_PRIORITY_overlay = "20"
 
</pre>
 
 
Then update setup-env as below
 
<pre>
 
export BBPATH="${OMDIR}/build:${OMDIR}/local:${OMDIR}/openembedded"
 
</pre>
 
 
Then change the line below in /home/emre/moko/openmoko/trunk/src/host/openembedded/site.conf
 
<pre>
 
BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/local/packages/*/*.bb"
 
</pre>
 
 
=== Adding a new application ===
 
I recommend using autotools when developing your application, other than common benefits there is an autotools class in bitbake brings easiness for openmoko applications.
 
 
After you develop and test your application make a distribution for your sources.
 
<pre>
 
make dist
 
</pre>
 
 
There should be a .tar.gz file in your project directory (or a .tar.bz2 file depending on your settings).
 
 
Here comes the openmoko related parts. Let's say your package's name is hello_moko and your distribution file is named hello_moko-0.0.1.tar.gz
 
 
Create a directory layout for your project.
 
<pre>
 
mkdir local/packages/hello_moko
 
mkdir local/packages/hello_moko/files
 
</pre>
 
 
Put the hello_moko-0.0.1.tar.gz file into local/packages/hello_moko/files.
 
 
Create a bitbake recipe file: local/packages/hello_moko/hello_moko.bb
 
 
<pre>
 
DESCRIPTION = "A sample openmoko application"
 
HOMEPAGE = "http://sample.openmoko.org"
 
SECTION = "openmoko/applications"
 
DEPENDS = "libmokoui2"
 
PRIORITY = "optional"
 
LICENSE = "GPL"
 
 
PV = "0.0.1"
 
PR = "r1"
 
 
inherit autotools pkgconfig
 
 
SRC_URI = "file://hello_moko-0.0.1.tar.gz"
 
</pre>
 
 
To compile
 
 
<pre>
 
make setup
 
make build-package-hello_moko
 
</pre>
 
 
Copy the file to the phone and install
 
<pre>
 
scp build/tmp/deploy/glibc/ipk/armv4/hello_moko_0.0.1-r1_armv4t.ipk 192.168.0.202:
 
ssh root@192.168.0.202
 
ipkg install hello_moko_0.0.1-r1_armv4t.ipk
 
</pre>
 
 
If you want to uninstall
 
<pre>
 
ipkg remove hello_moko
 
</pre>
 

Latest revision as of 14:56, 21 September 2007

Personal tools