Lightweight high-level openmoko development environment

ramsesoriginal ramsesoriginal at gmail.com
Fri Sep 28 05:11:46 CEST 2007


On 9/26/07, Jon Phillips <jon at rejon.org> wrote:
>
> Please do post this to the wiki, and/or what is the wiki url on
> openmoko's public wiki?
>
> Jon
>
> On Wed, 2007-09-26 at 14:21 +0200, Stefan Winkler wrote:
> > Ok, to answer my own question: ("What do you recommend in order to
> > start app hacking for OM? (Ok, I can just write plain GTK+ and compile
> > libmokoui x86-natively on my dev machine, but I also want to see, how
> > my app looks like on a neo...")
> >
> > I figured out a way to develop high-level openmoko-apps.
> >
> > Let's call it lightweight development environment. I tried to figure
> > this out from diverse wiki descriptions and other resources. The
> > rationale behind this is, that in order to get more developers hacking
> > on user-level software, we should provide them with an easy start, so
> > that they can get a hello world working in openmoko-ui style in 10
> > minutes (and not 2 days like the openmoko-devel-image).
> >
> > If someone finds this helpful, please comment or feel free to publish
> > it in the wiki.
> >
> > == Openmoko lightweight high-level development environment ==
> >
> > Preconditions:
> >       * you want to develop high-level OM applications. High-level
> >         meaning involving some GUI and logic and no accessing gps, gsm
> >         or other specialities. (I haven't tried dbus yet...)
> >       * you have no openmoko-devel-image and you don't want to build
> >         one right now (you won't get around this step, later - but
> >         then, openmoko-devel-image building and simulation is maybe
> >         not stable and fast enough for your current use and you don't
> >         want to lose 2 days of compiling and fixing build issues just
> >         to start developing a simple GTK+-hello world).
> >       * you have an isolated sandbox, or you don't care having
> >         openmoko suff messing up your usual directories (the process
> >         below will install libmokoui and maybe others into your
> >         standard lib directory. I haven't tries to change library
> >         install locations, but you can do that if you like/need. I
> >         don't because I have set up a vmware instance just for
> >         openmoko development).
> >
> > You can follow these steps to get openmoko-calculator running in
> > openmoko style using Xephyr (if you want other applications, like the
> > openmoko-feedreader, you need to resolve the library dependencies):
> >
> > Do this once:
> >       * install xserver-xephyr, matchbox-window-manager, and all that
> >         development stuff (including, but certainly not limited to
> >         gtk-2.0-dev, gtk-doc-tools, autoconf, automake, libtool,
> >         gettext, gcc, ...)
> >         This list is for Ubuntu/Debian, Packages may be named
> >         differently depending on your distro.
> >
> >       * svn checkout
> >         http://svn.openmoko.org/trunk/src/target/OM2007.2/
> >         into a directory of your choice. Let's call this $OMDIR from
> >         now on ...
> >       * cd $OMDIR/OM-2007.2/libraries/libmokoui2; autogen.sh; make
> >         all; sudo make install
> >       * mkdir ~/.themes
> >       * ln -s $OMDIR/OM-2007.2/artwork/themes/openmoko-standard-2
> >         ~/.themes/openmoko-standard-2
> > Do this to start the embedded X server:
> >       * Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 &
> >       * matchbox-window-manager -display :1 -theme openmoko-standard-2
> >         &
> > Do this in every terminal you use to start an openmoko application:
> >       * export DISPLAY=:1
> >       * export
> >         GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc
> > For example, to get openmoko-calculator to run:
> >       * cd $OMDIR/OM-2007.2/applications/openmoko-calculator;
> >         autogen.sh; make
> >       * export DISPLAY=:1
> >       * export
> >         GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc
> >       * src/openmoko-calculator
> > Voilà, there is your calculator.
> >
> > Please note once again, that this method works only for a quick and
> > easy start into openmoko development.
> > If your application shall run on the real hardware, later on, you will
> > have to switch over to openmoko-devel-image and the bitbake process
> > some time in the future.
> >
> > I'd love to hear comments ;-)
> >
> > Cheers,
> > Stefan "jumpy" Winkler
> --
> Jon Phillips
>
> San Francisco, CA
> USA PH 510.499.0894
> jon at rejon.org
> http://www.rejon.org
>
> MSN, AIM, Yahoo Chat: kidproto
> Jabber Chat: rejon at gristle.org
> IRC: rejon at irc.freenode.net
>
> Please note: the contents of this email are not intended to be
> legal advice nor should they be relied upon as or represented to be
> legal advice. Jon Phillips does not represent any organization through
> this email address.
>
>
>
Great tutorial. So grat that I made a script out of it ;)
Be aware: the script is made on my computer, for my computer. I have nearly
no shell scripting experience, and some sort of strange habits. So use the
script at your own risk. I guarantee for nothing!
Here it comes:

##############################
##################################################################

#!/bin/sh

# run script as sudo. If not, it won't run un my machine
# No Arguments = just set up the x server
# -i = install everyting
# -c = run the calculator
# -i -c =install and run the calculator
# -i -s = start right away: install and setup x server
# -r foo = set up x server and start "foo"

case $# in
0)
#Here comes the startup of the "pseudomoko", and the setting of the correct
X server
Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager
-display :1 -theme openmoko-standard-2 &
export DISPLAY=:1
export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc;;
1)
case $1 in
-i)
#ok, install it.
apt-get install xserver-xephyr matchbox-window-manager gtk-doc-tools
autoconf automake libtool gettext gcc libgtk2.0-dev subversion g++
cd ~
mkdir OM
mkdir .themes
cd OM
svn checkout http://svn.openmoko.org/trunk/src/target/OM-2007.2/
cd OM-2007.2 /libraries/libmokoui2/
sh autogen.sh
make all
rm /usr/share/themes/openmoko-standard-2
ln -s ../../artwork/themes/openmoko-standard-2
/usr/share/themes/openmoko-standard-2
#Here comes the calculator part
cd ../../applications/openmoko-calculator2/
sh autogen.sh
make;;
-c)
~/OM/OM-2007.2
/libraries/libmokoui2/applications/openmoko-calculator2/src/openmoko-calculator;;
esac;;
2)
case $1 in
-r)
#Here comes the startup of the "pseudomoko", and the setting of the correct
X server
Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager
-display :1 -theme openmoko-standard-2 &
export DISPLAY=:1
export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc
$2;;
-i)
#ok, install it.#Here comes the calculator part
cd ../../applications/openmoko-calculator2/
sh autogen.sh
make
apt-get install xserver-xephyr matchbox-window-manager gtk-doc-tools
autoconf automake libtool gettext gcc libgtk2.0-dev subversion g++
cd ~
mkdir OM
mkdir .themes
cd OM
svn checkout http://svn.openmoko.org/trunk/src/target/OM-2007.2/
cd OM-2007.2 /libraries/libmokoui2/
sh autogen.sh
make all
rm /usr/share/themes/openmoko-standard-2
ln -s ../../artwork/themes/openmoko-standard-2
/usr/share/themes/openmoko-standard-2
Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager
-display :1 -theme openmoko-standard-2 &
export DISPLAY=:1
export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc
case $2 in
-c)
src/openmoko-calculator;;
esac;;
esac;;
esac



##############################################################################################################################################


Ok, i didn't even test everything, i'ts 5AM, and i'm tired. Hopefulyl it
helps somebody.

Oh, i forgot: Made for Ubuntu 7.04.

Tomorrow i will look deeper into it, i just wanted to psot it befor i was
too tired.



-- 
My corner of the web: http://blog.ramsesoriginal.org
My dream, my world: http://abenu.wordpress.com
My work: http://unicoinuffico.wordpress.com

Before printing this email, assess if it is really needed. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/openmoko-devel/attachments/20070928/10c5d275/attachment-0001.html


More information about the openmoko-devel mailing list