mandag den 21. juli 2008

Openmoko application development in 5 minutes

This guide will in 5 minutes, and 6 easy steps, show you how to begin development on Openmoko applications in the 2007.2 stack on Ubuntu Hardy. It will be assumed that you already have ssh access to you phone(Otherwise see Getting Started with your Neo FreeRunner on the wiki)
  1. Install the openmoko-toolchain deb-package
  2. wget http://smartere.dk/openmoko/openmoko-toolchain_0.20080521-ubuntu6_i386.deb
    sudo dpkg -i openmoko-toolchain_0.20080521-ubuntu6_i386.deb
    While you wait for the download to complete you can jump to step 2 and checkout the openmoko-calculator2 application
  3. Checkout an application of interest
  4. For the purpose of this guide an example will be given using the openmoko-calculator2 application. It is of course possible to checkout other applications. For more information about that see the "Notes:" section.
    mkdir -p ~/src/openmoko/ && cd ~/src/openmoko/
    svn co http://svn.openmoko.org/trunk/src/target/OM-2007.2/applications/openmoko-calculator2
    
  5. Set environment variables
  6. To use the openmoko-toolchain to compile some environment variables should be set
    . /usr/local/openmoko/arm/setup-env
  7. Compile the project
  8. To compile the project
    cd ~/src/openmoko/ && om-conf openmoko-calculator2
    cd openmoko-calculator2
    #now you could fix a bug
    make
    
  9. Build package
  10. cd .. && echo "Package: openmoko-calculator2
    Version: 0.1.1
    Description: package built by openmoko toolchain
    Section: openmoko/applications
    Priority: optional
    Maintainer: your name 
    Architecture: armv4t
    Homepage: http://www.openmoko.org/
    Depends: libmokoui2-0
    Source: you" > openmoko-calculator2_control
    om-make-ipkg openmoko-calculator2 openmoko-calculator2_control
  11. Use scp to copy the package to the phone and install the package
  12. You can install the package on the phone by running the floowing command on the phone.
    opkg install openmoko-calculator2_0.1.1_armv4t.ipk
Notes:
I have tested the following project:
    From http://pimlico-project.org/
  • contacts
  • dates
  • tasks
  • From svn.openmoko.org
  • openmoko-appearance
  • gsm
  • openmoko-calculator2
  • openmoko-firststart2
  • openmoko-sample2
  • openmoko-today2
  • openmoko-worldclock2
  • openmoko-browser2
Tested but did not compile but can easily be worked around:
  • openmoko-messages2
  • cd openmoko-messages2/libhito
    wget http://smartere.dk/openmoko/openmoko_messages2_missing_gdk_event_request_motions.patch
    patch -p0 < openmoko_messages2_missing_gdk_event_request_motions.patch
  • openmoko-dialer3 (could be patched with similar patch(es))
Not very tested, but won't work out of box(patches/feedback welcome!):
  • openmoko-mediaplayer
  • openmoko-feedreader
  • openmoko-appmanager2
Add packages to the openmoko-toolchain:
Adding package X:
sudo  su
. /usr/local/openmoko/arm/setup-env
opkg-target install X
exit