Host-based development with Xoo and Xephyr

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Building the OpenMoko applications)
m (Starting the nested OpenMoko)
Line 113: Line 113:
 
==Starting the nested OpenMoko==
 
==Starting the nested OpenMoko==
  
=== Launch Xoo ===
+
We have prepared a script for you that starts Xoo and all the necessary X clients in one run. The script om-run-xoo contains the following commands:
In another terminal (not related to mokobox), start Xoo. Download [http://www.datenfreihafen.org/~stefan/OpenMoko/neo1973-xoo-device.tar.bz2] and run for a nice neo 1973 theme.
+
# xoo --device neo1973.xml
+
  
=== Using Xnest without xoo ===
+
  {{todo|...}}
 
+
If you don't want to use xoo (perhaps you don't have the required resolutions to display the large image) you can use Xnest on its own,
+
 
+
  # Xnest :1 -dpi 283 -geometry 480x640+86+295
+
(if you get "Xnest: client 1 rejected from IP 127.0.0.1", try running Xnest with the -ac flag)
+
 
+
=== Start X Client ===
+
Now, back in chroo'ted environment, start X client: <br /><br />
+
Export display to connect to started xoo
+
# export DISPLAY=localhost:1.0
+
Start window manager.
+
# x-window-manager
+
By this time you should have Xnest & Xoo running OpenMoko in a window.
+
 
+
 
+
=== Set your theme to OpenMoko ===
+
 
+
If you find that graphics within Xnest & xoo are broken, try the following:
+
* Add a user and group 'messagebus', on some systems by adduser, on others by editing /etc/passwd and /etc/group)
+
* Start dbus:
+
 
+
  /etc/init.d/dbus-1 start
+
 
+
* Register pango modules
+
 
+
  pango-querymodules > /etc/pango/pango.modules
+
 
+
* Set the GTK2_RC_FILES variable before running OpenMoko applications:
+
 
+
  export GTK2_RC_FILES=$OPENMOKODIR/artwork/themes/openmoko-standard/gtk-2.0/gtkrc
+
 
+
Or edit $HOME/.gtkrc-2.0 to something like this:
+
 
+
  include "/home/moko/openmoko/trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc"
+
 
+
However, this will make all Gtk2 apps run with the OpenMoko theme.
+
  
 +
run xoo
 +
set DISPLAY
 +
set gconf keys
 +
set GTK2_RC_FILES
 +
run window manager
 +
run panel
 +
run openmoko-dialer
 +
run openmoko-today
 +
run neod
  
 
[[Category:Developer software]]
 
[[Category:Developer software]]

Revision as of 17:18, 11 December 2007

Please see Getting OpenMoko working on host with Xephyr which might contain more up-to-date information.

Contents

Host-based development

This term means you develop most of your application in your standard desktop environment until it's almost finished. Then you can use a Toolchain to cross-compile your application for the Neo1973. Host-based development is incredibly more efficient since you can use your (typically) fast computer, large monitor, etc.

Xoo and Xephyr

Xoo is a GTK2 based graphical wrapper around a ‘Windowed’ X Server. The X server is typically Xnest, the nested X server, or Xephyr. It is intended for embedded developers that want to simulate a target device (with an accurate display size, working hardware buttons, etc) on a desktop machine.

Note that Xoo is not required to simulate OpenMoko hardware - it just improves the presentation.

Prerequisites

Part I (precompiled software)

You need to install some software that is usually not present on a desktop system, but used on the Neo1973. Some of this software has already been precompiled by your friendly distribution packager, so you don't need to compile it yourself. Most likely you can install the following packages from your distribution repository:

  • xephyr
  • xoo
  • matchbox-window-manager
  • matchbox-keyboard
  • libgtk2.0-dev
  • libecal1.2-dev

Gentoo users run just

# emerge <package>

Debian/Ubuntu

$ sudo apt-get install <package>

For Fedora, you can use

# yum install <package>

For Mandriva, you may try

# urpmi <package>

for any other find a way how to do it in your distro.

Part II (building from source)

You also need some software that is typically not found in your distribution repository, either because it's too new, too specific, or unheard of.

Most likely you will need to compile the following packages for your distribution:

  • matchbox-panel-2
  • libjana
  • libipkg

To compile and install matchbox-panel-2:

mkdir -f /local/pkg/ohand
cd /local/pkg/ohand
svn co http://svn.o-hand.com/repos/matchbox/trunk matchbox
cd matchbox/matchbox-panel-2
./autogen.sh
make install

To compile and install libjana:

mkdir -f /local/pkg/ohand
cd /local/pkg/ohand
svn co http://svn.o-hand.com/repos/jana/trunk jana
cd jana
./autogen.sh
make install

To compile and install libipkg:

mkdir -f /local/pkg/handhelds.org
cd /local/pkg/handhelds.org
wget http://downloads.openmoko.org/sources/ipkg-0.99.163.tar.gz
tar xzf ipkg-0.99.163.tar.gz
cd ipkg-0.99.163
./configure
make install

Building the OpenMoko core

First we download the OpenMoko subversion repository:

 mkdir -f /local/pkg/openmoko
 cd /local/pkg/openmoko
 svn co http://svn.openmoko.org/src/trunk src

Then you compile the software contained there, e.g. you will definitely want to compile at least:

In directory src/target/:

  • gsmd

In directory src/target/OM-2007.2/libraries/:

  • libmokoui2
  • libmokopanelui2
  • libmokojournal2
  • libmokogsmd2

In directory src/target/OM-2007.2/daemons/:

  • neod

In directory src/target/OM-2007.2/panel-plugins/:

  • openmoko-panel-gsm
  • openmoko-panel-usb
  • openmoko-panel-battery
  • openmoko-panel-gps

In directory src/target/OM-2007.2/applications:

  • openmoko-today2
  • openmoko-calculator2
  • openmoko-appmanager2

Each of these packages are to be compiled by the well-known-triple of:

./configure (or ./autogen.sh, if it's the first time)
make
make install

Starting the nested OpenMoko

We have prepared a script for you that starts Xoo and all the necessary X clients in one run. The script om-run-xoo contains the following commands:


TODO: ... (See: To-Do List)

run xoo set DISPLAY set gconf keys set GTK2_RC_FILES run window manager run panel run openmoko-dialer run openmoko-today run neod

Personal tools

Please see Getting OpenMoko working on host with Xephyr which might contain more up-to-date information.

Host-based development

This term means you develop most of your application in your standard desktop environment until it's almost finished. Then you can use a Toolchain to cross-compile your application for the Neo1973. Host-based development is incredibly more efficient since you can use your (typically) fast computer, large monitor, etc.

Xoo and Xephyr

Xoo is a GTK2 based graphical wrapper around a ‘Windowed’ X Server. The X server is typically Xnest, the nested X server, or Xephyr. It is intended for embedded developers that want to simulate a target device (with an accurate display size, working hardware buttons, etc) on a desktop machine.

Note that Xoo is not required to simulate OpenMoko hardware - it just improves the presentation.

Prerequisites

Part I (precompiled software)

You need to install some software that is usually not present on a desktop system, but used on the Neo1973. Some of this software has already been precompiled by your friendly distribution packager, so you don't need to compile it yourself. Most likely you can install the following packages from your distribution repository:

  • xephyr
  • xoo
  • matchbox-window-manager
  • matchbox-keyboard
  • libgtk2.0-dev
  • libecal1.2-dev

Gentoo users run just

# emerge <package>

Debian/Ubuntu

$ sudo apt-get install <package>

For Fedora, you can use

# yum install <package>

For Mandriva, you may try

# urpmi <package>

for any other find a way how to do it in your distro.

Part II (building from source)

You also need some software that is typically not found in your distribution repository, either because it's too new, too specific, or unheard of.

Most likely you will need to compile the following packages for your distribution:

  • matchbox-panel-2
  • libjana
  • libipkg

To compile and install matchbox-panel-2:

mkdir -f /local/pkg/ohand
cd /local/pkg/ohand
svn co http://svn.o-hand.com/repos/matchbox/trunk matchbox
cd matchbox/matchbox-panel-2
./autogen.sh
make install

To compile and install libjana:

mkdir -f /local/pkg/ohand
cd /local/pkg/ohand
svn co http://svn.o-hand.com/repos/jana/trunk jana
cd jana
./autogen.sh
make install

To compile and install libipkg:

mkdir -f /local/pkg/handhelds.org
cd /local/pkg/handhelds.org
wget http://downloads.openmoko.org/sources/ipkg-0.99.163.tar.gz
tar xzf ipkg-0.99.163.tar.gz
cd ipkg-0.99.163
./configure
make install

Building the OpenMoko core

First we download the OpenMoko subversion repository:

 mkdir -f /local/pkg/openmoko
 cd /local/pkg/openmoko
 svn co http://svn.openmoko.org/src/trunk src

Then you compile the software contained there, e.g. you will definitely want to compile at least:

In directory src/target/:

  • gsmd

In directory src/target/OM-2007.2/libraries/:

  • libmokoui2
  • libmokopanelui2
  • libmokojournal2
  • libmokogsmd2

In directory src/target/OM-2007.2/daemons/:

  • neod

In directory src/target/OM-2007.2/panel-plugins/:

  • openmoko-panel-gsm
  • openmoko-panel-usb
  • openmoko-panel-battery
  • openmoko-panel-gps

In directory src/target/OM-2007.2/applications:

  • openmoko-today2
  • openmoko-calculator2
  • openmoko-appmanager2

Each of these packages are to be compiled by the well-known-triple of:

./configure (or ./autogen.sh, if it's the first time)
make
make install

Starting the nested OpenMoko

Launch Xoo

In another terminal (not related to mokobox), start Xoo. Download [1] and run for a nice neo 1973 theme.

# xoo --device neo1973.xml

Using Xnest without xoo

If you don't want to use xoo (perhaps you don't have the required resolutions to display the large image) you can use Xnest on its own,

# Xnest :1 -dpi 283 -geometry 480x640+86+295

(if you get "Xnest: client 1 rejected from IP 127.0.0.1", try running Xnest with the -ac flag)

Start X Client

Now, back in chroo'ted environment, start X client:

Export display to connect to started xoo

# export DISPLAY=localhost:1.0

Start window manager.

# x-window-manager

By this time you should have Xnest & Xoo running OpenMoko in a window.


Set your theme to OpenMoko

If you find that graphics within Xnest & xoo are broken, try the following:

  • Add a user and group 'messagebus', on some systems by adduser, on others by editing /etc/passwd and /etc/group)
  • Start dbus:
 /etc/init.d/dbus-1 start
  • Register pango modules
 pango-querymodules > /etc/pango/pango.modules
  • Set the GTK2_RC_FILES variable before running OpenMoko applications:
 export GTK2_RC_FILES=$OPENMOKODIR/artwork/themes/openmoko-standard/gtk-2.0/gtkrc

Or edit $HOME/.gtkrc-2.0 to something like this:

 include "/home/moko/openmoko/trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/gtkrc"

However, this will make all Gtk2 apps run with the OpenMoko theme.