On 9/26/07, <b class="gmail_sendername">Jon Phillips</b> &lt;<a href="mailto:jon@rejon.org">jon@rejon.org</a>&gt; 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&#39;s public wiki?<br><br>Jon<br><br>On Wed, 2007-09-26 at 14:21 +0200, Stefan Winkler wrote:<br>&gt; Ok, to answer my own question: (&quot;What do you recommend in order to
<br>&gt; start app hacking for OM? (Ok, I can just write plain GTK+ and compile<br>&gt; libmokoui x86-natively on my dev machine, but I also want to see, how<br>&gt; my app looks like on a neo...&quot;)<br>&gt;<br>&gt; I figured out a way to develop high-level openmoko-apps.
<br>&gt;<br>&gt; Let&#39;s call it lightweight development environment. I tried to figure<br>&gt; this out from diverse wiki descriptions and other resources. The<br>&gt; rationale behind this is, that in order to get more developers hacking
<br>&gt; on user-level software, we should provide them with an easy start, so<br>&gt; that they can get a hello world working in openmoko-ui style in 10<br>&gt; minutes (and not 2 days like the openmoko-devel-image).<br>
&gt;<br>&gt; If someone finds this helpful, please comment or feel free to publish<br>&gt; it in the wiki.<br>&gt;<br>&gt; == Openmoko lightweight high-level development environment ==<br>&gt;<br>&gt; Preconditions:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * you want to develop high-level OM applications. High-level
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; meaning involving some GUI and logic and no accessing gps, gsm<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or other specialities. (I haven&#39;t tried dbus yet...)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * you have no openmoko-devel-image and you don&#39;t want to build
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; one right now (you won&#39;t get around this step, later - but<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then, openmoko-devel-image building and simulation is maybe<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; not stable and fast enough for your current use and you don&#39;t
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; want to lose 2 days of compiling and fixing build issues just<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to start developing a simple GTK+-hello world).<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * you have an isolated sandbox, or you don&#39;t care having<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openmoko suff messing up your usual directories (the process<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; below will install libmokoui and maybe others into your<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; standard lib directory. I haven&#39;t tries to change library
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; install locations, but you can do that if you like/need. I<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; don&#39;t because I have set up a vmware instance just for<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; openmoko development).<br>&gt;<br>&gt; You can follow these steps to get openmoko-calculator running in
<br>&gt; openmoko style using Xephyr (if you want other applications, like the<br>&gt; openmoko-feedreader, you need to resolve the library dependencies):<br>&gt;<br>&gt; Do this once:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * install xserver-xephyr, matchbox-window-manager, and all that
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; development stuff (including, but certainly not limited to<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gtk-2.0-dev, gtk-doc-tools, autoconf, automake, libtool,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gettext, gcc, ...)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This list is for Ubuntu/Debian, Packages may be named
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; differently depending on your distro.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * svn checkout<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://svn.openmoko.org/trunk/src/target/OM2007.2/">http://svn.openmoko.org/trunk/src/target/OM2007.2/</a>
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; into a directory of your choice. Let&#39;s call this $OMDIR from<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; now on ...<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * cd $OMDIR/OM-2007.2/libraries/libmokoui2; autogen.sh; make<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all; sudo make install
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * mkdir ~/.themes<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * ln -s $OMDIR/OM-2007.2/artwork/themes/openmoko-standard-2<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~/.themes/openmoko-standard-2<br>&gt; Do this to start the embedded X server:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 &amp;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * matchbox-window-manager -display :1 -theme openmoko-standard-2<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;<br>&gt; Do this in every terminal you use to start an openmoko application:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * export DISPLAY=:1<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * export
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc<br>&gt; For example, to get openmoko-calculator to run:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * cd $OMDIR/OM-2007.2/applications/openmoko-calculator;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; autogen.sh
; make<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * export DISPLAY=:1<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * export<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GTK2_RC_FILES=~/.themes/openmoko-standard-2/gtk-2.0/gtkrc<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * src/openmoko-calculator<br>&gt; Voilą, there is your calculator.<br>
&gt;<br>&gt; Please note once again, that this method works only for a quick and<br>&gt; easy start into openmoko development.<br>&gt; If your application shall run on the real hardware, later on, you will<br>&gt; have to switch over to openmoko-devel-image and the bitbake process
<br>&gt; some time in the future.<br>&gt;<br>&gt; I&#39;d love to hear comments ;-)<br>&gt;<br>&gt; Cheers,<br>&gt; Stefan &quot;jumpy&quot; 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&#39;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 &quot;foo&quot;<br><br>

case $# in <br>0) <br>#Here comes the startup of the &quot;pseudomoko&quot;, and the setting of the correct X server<span class="q"><br>Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 &amp; matchbox-window-manager -display :1 -theme openmoko-standard-2 &amp;
<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 &quot;pseudomoko&quot;, and the setting of the correct X server
<span class="q"><br>Xephyr :1 -ac -dpi 283 -screen 480x640+86+295 &amp; matchbox-window-manager -display :1 -theme openmoko-standard-2 &amp;<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 &amp; matchbox-window-manager -display :1 -theme openmoko-standard-2 &amp;
<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&#39;t even test everything, i&#39;ts 5AM, and i&#39;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.