On 9/26/07, <b class="gmail_sendername">Jon Phillips</b> <<a href="mailto:jon@rejon.org">jon@rejon.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Please do post this to the wiki, and/or what is the wiki url on<br>openmoko's public wiki?<br><br>Jon<br><br>On Wed, 2007-09-26 at 14:21 +0200, Stefan Winkler wrote:<br>> Ok, to answer my own question: ("What do you recommend in order to
<br>> start app hacking for OM? (Ok, I can just write plain GTK+ and compile<br>> libmokoui x86-natively on my dev machine, but I also want to see, how<br>> my app looks like on a neo...")<br>><br>> I figured out a way to develop high-level openmoko-apps.
<br>><br>> Let's call it lightweight development environment. I tried to figure<br>> this out from diverse wiki descriptions and other resources. The<br>> rationale behind this is, that in order to get more developers hacking
<br>> on user-level software, we should provide them with an easy start, so<br>> that they can get a hello world working in openmoko-ui style in 10<br>> minutes (and not 2 days like the openmoko-devel-image).<br>
><br>> If someone finds this helpful, please comment or feel free to publish<br>> it in the wiki.<br>><br>> == Openmoko lightweight high-level development environment ==<br>><br>> Preconditions:<br>> * you want to develop high-level OM applications. High-level
<br>> meaning involving some GUI and logic and no accessing gps, gsm<br>> or other specialities. (I haven't tried dbus yet...)<br>> * you have no openmoko-devel-image and you don't want to build
<br>> one right now (you won't get around this step, later - but<br>> then, openmoko-devel-image building and simulation is maybe<br>> not stable and fast enough for your current use and you don't
<br>> want to lose 2 days of compiling and fixing build issues just<br>> to start developing a simple GTK+-hello world).<br>> * you have an isolated sandbox, or you don't care having<br>
> openmoko suff messing up your usual directories (the process<br>> below will install libmokoui and maybe others into your<br>> standard lib directory. I haven't tries to change library
<br>> install locations, but you can do that if you like/need. I<br>> don't because I have set up a vmware instance just for<br>> openmoko development).<br>><br>> You can follow these steps to get openmoko-calculator running in
<br>> openmoko style using Xephyr (if you want other applications, like the<br>> openmoko-feedreader, you need to resolve the library dependencies):<br>><br>> Do this once:<br>> * install xserver-xephyr, matchbox-window-manager, and all that
<br>> development stuff (including, but certainly not limited to<br>> gtk-2.0-dev, gtk-doc-tools, autoconf, automake, libtool,<br>> gettext, gcc, ...)<br>> This list is for Ubuntu/Debian, Packages may be named
<br>> differently depending on your distro.<br>><br>> * svn checkout<br>> <a href="http://svn.openmoko.org/trunk/src/target/OM2007.2/">http://svn.openmoko.org/trunk/src/target/OM2007.2/</a>
<br>> into a directory of your choice. Let's call this $OMDIR from<br>> now on ...<br>> * cd $OMDIR/OM-2007.2/libraries/libmokoui2; autogen.sh; make<br>> all; sudo make install
<br>> * mkdir ~/.themes<br>> * ln -s $OMDIR/OM-2007.2/artwork/themes/openmoko-standard-2<br>> ~/.themes/openmoko-standard-2<br>> Do this to start the embedded X server:<br>> * Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 &
<br>> * matchbox-window-manager -display :1 -theme openmoko-standard-2<br>> &<br>> Do this in every terminal you use to start an openmoko application:<br>> * export DISPLAY=:1<br>> * export
<br>> GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc<br>> For example, to get openmoko-calculator to run:<br>> * cd $OMDIR/OM-2007.2/applications/openmoko-calculator;<br>> autogen.sh
; make<br>> * export DISPLAY=:1<br>> * export<br>> GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc<br>> * src/openmoko-calculator<br>> Voilą, there is your calculator.<br>
><br>> Please note once again, that this method works only for a quick and<br>> easy start into openmoko development.<br>> If your application shall run on the real hardware, later on, you will<br>> have to switch over to openmoko-devel-image and the bitbake process
<br>> some time in the future.<br>><br>> I'd love to hear comments ;-)<br>><br>> Cheers,<br>> Stefan "jumpy" Winkler<br>--<br>Jon Phillips<br><br>San Francisco, CA<br>USA PH 510.499.0894<br>
<a href="mailto:jon@rejon.org">jon@rejon.org</a><br><a href="http://www.rejon.org">http://www.rejon.org</a><br><br>MSN, AIM, Yahoo Chat: kidproto<br>Jabber Chat: <a href="mailto:rejon@gristle.org">rejon@gristle.org</a><br>
IRC: <a href="mailto:rejon@irc.freenode.net">rejon@irc.freenode.net</a><br><br>Please note: the contents of this email are not intended to be<br>legal advice nor should they be relied upon as or represented to be<br>legal advice. Jon Phillips does not represent any organization through
<br>this email address.<br><br><br></blockquote></div><br>Great tutorial. So grat that I made a script out of it ;)<br>
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!<br>
Here it comes:<br><br>##############################<div id="mb_3">##################################################################<br><br>#!/bin/sh<br><br># run script as sudo. If not, it won't run un my machine<br>
# No Arguments = just set up the x server
<br># -i = install everyting<br># -c = run the calculator<br># -i -c =install and run the calculator<br># -i -s = start right away: install and setup x server<br># -r foo = set up x server and start "foo"<br><br>
case $# in <br>0) <br>#Here comes the startup of the "pseudomoko", and the setting of the correct X server<span class="q"><br>Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager -display :1 -theme openmoko-standard-2 &
<br></span>export DISPLAY=:1<br>export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc;;<br>1)<br>case $1 in<br>-i)<br>#ok, install it.<br>apt-get install xserver-xephyr matchbox-window-manager gtk-doc-tools autoconf automake libtool gettext gcc
libgtk2.0-dev subversion g++<br>cd ~<br>mkdir OM<br>mkdir .themes<br>cd OM<br>svn checkout <a href="http://svn.openmoko.org/trunk/src/target/OM-2007.2/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://svn.openmoko.org/trunk/src/target/OM-2007.2/</a><br>cd OM-2007.2
/libraries/libmokoui2/<br>sh autogen.sh<br>make all<br>rm /usr/share/themes/openmoko-standard-2<br>ln -s ../../artwork/themes/openmoko-standard-2 /usr/share/themes/openmoko-standard-2<br>#Here comes the calculator part<br>
cd ../../applications/openmoko-calculator2/<br>sh autogen.sh <br>make;;<br>-c)<br>~/OM/OM-2007.2/libraries/libmokoui2/applications/openmoko-calculator2/src/openmoko-calculator;;<br>esac;;<br>2)<br>case $1 in<br>-r)<br>#Here comes the startup of the "pseudomoko", and the setting of the correct X server
<span class="q"><br>Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager -display :1 -theme openmoko-standard-2 &<br></span><span class="q">export DISPLAY=:1<br>export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-
2.0/gtkrc<br></span>$2;;
<br>-i)<br>#ok, install it.#Here comes the calculator part<br>cd ../../applications/openmoko-calculator2/<br>sh autogen.sh <br>make<br>apt-get install xserver-xephyr matchbox-window-manager gtk-doc-tools autoconf automake libtool gettext gcc
libgtk2.0-dev subversion g++<br>cd ~<br>mkdir OM<br>mkdir .themes<br>cd OM<br>svn checkout <a href="http://svn.openmoko.org/trunk/src/target/OM-2007.2/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://svn.openmoko.org/trunk/src/target/OM-2007.2/</a><br>cd OM-2007.2
/libraries/libmokoui2/<br>sh autogen.sh<br>make all<br>rm /usr/share/themes/openmoko-standard-2<br>ln -s ../../artwork/themes/openmoko-standard-2 /usr/share/themes/openmoko-standard-2<span class="q"><br>Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 & matchbox-window-manager -display :1 -theme openmoko-standard-2 &
<br></span><span class="q">export DISPLAY=:1<br>export GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc<br></span>case $2 in<br>-c)<br>src/openmoko-calculator;;<br>esac;;<br>esac;;<br>esac<br><br><br><br>##############################################################################################################################################
<br><br>Ok, i didn't even test everything, i'ts 5AM, and i'm tired. Hopefulyl it helps somebody.<br><br>Oh, i forgot: Made for Ubuntu 7.04.<br><br>Tomorrow i will look deeper into it, i just wanted to psot it befor i was too tired.
<br><span class="sg"><br></span></div><br clear="all"><br>-- <br>My corner of the web: <a href="http://blog.ramsesoriginal.org">http://blog.ramsesoriginal.org</a><br>My dream, my world: <a href="http://abenu.wordpress.com">
http://abenu.wordpress.com</a><br>My work: <a href="http://unicoinuffico.wordpress.com">http://unicoinuffico.wordpress.com</a><br><br>Before printing this email, assess if it is really needed. Thank you.