KDE on scratchbox for maemo 4

(New page: This article describes how to compile KDE for maemo. It takes the Nokia N810 as example device. It uses the cross-compiling environment scratchbox on an Intel-based computer. == Overview...)
(install subversion)
Line 16: Line 16:
  ssh root@localhost
  ssh root@localhost
  apt-get install subversion
  apt-get install subversion
 +
 +
= In scratchbox =
 +
You cannot install scratchbox on an X64 computer, so, install an i386 into a VMWare virtual machine. The following describes how to install scratchbox into a SUSE 11 32bit installation. It might work same or similar with any Linux.
 +
 +
== Hello world ==
 +
First, we want to compile a "hello world" program for the Nokia. Here is how.
 +
* Set up scratchbox
 +
root@i386 # useradd -m scratchboxuser
 +
root@i386 # wget http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.2.sh
 +
root@i386 # chmod 777 maemo-scratchbox-install_4.1.2.sh
 +
root@i386 # ./maemo-scratchbox-install_4.1.2.sh -s /scratchbox
 +
root@i386 # /scratchbox/sbin/sbox_adduser scratchboxuser
 +
root@i386 # su - scratchboxuser
 +
* set up the SDK
 +
scratchboxuser@i386 $ wget http://repository.maemo.org/stable/diablo/maemo-sdk-install_4.1.2.sh
 +
Start the install script and accept all choices:
 +
scratchboxuser@i386 $ sh maemo-sdk-install_4.1.2.sh
 +
* start scratchbox
 +
scratchboxuser@i386 $ /scratchbox/login
 +
[sbox-DIABLO_ARMEL: ~] > sb-conf select DIABLO_ARMEL
 +
[sbox-DIABLO_ARMEL: ~] > cat > main.c << EOF
 +
#include <stdio.h>
 +
 +
int main()
 +
{
 +
  printf("hello world");
 +
}
 +
EOF
 +
[sbox-DIABLO_ARMEL: ~] > gcc main.c
 +
[sbox-DIABLO_ARMEL: ~] > file a.out
 +
a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped
 +
* copy the file to your Nokia N810 using scp
 +
 +
=> the file is executable on the Nokia
 +
 +
== Re-login ==
 +
To re-login after a reboot of your virtual machine run
 +
/scratchbox/sbin/sbox_ctl start
 +
/scratchbox/login

Revision as of 13:50, 29 December 2009

This article describes how to compile KDE for maemo. It takes the Nokia N810 as example device. It uses the cross-compiling environment scratchbox on an Intel-based computer.

Contents

Overview

  • maemo is the core software stack that runs on mobile devices like Nokia's N810 or N900
  • garage is where the projects for maemo are hosted, somewhat compareable to Sourceforge.
  • OS2008 is maemo 4.x (more info). Compare it with Debian's Lenny.
  • Diablo is the version (feature upgrade 2008) of maemo.
  • Scratchbox is a cross-compiling environment to enable you to create software for maemo on an i386.
  • Busybox is a single binary that allows you to run commands like ls, cat and bunzip2
  • Hildon is an application framework and desktop shell for maemo, compare it to the role that Plasma plays in KDE 4

On the Nokia itself

install subversion

ssh root@localhost
apt-get install subversion

In scratchbox

You cannot install scratchbox on an X64 computer, so, install an i386 into a VMWare virtual machine. The following describes how to install scratchbox into a SUSE 11 32bit installation. It might work same or similar with any Linux.

Hello world

First, we want to compile a "hello world" program for the Nokia. Here is how.

  • Set up scratchbox
root@i386 # useradd -m scratchboxuser
root@i386 # wget http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.2.sh
root@i386 # chmod 777 maemo-scratchbox-install_4.1.2.sh
root@i386 # ./maemo-scratchbox-install_4.1.2.sh -s /scratchbox
root@i386 # /scratchbox/sbin/sbox_adduser scratchboxuser
root@i386 # su - scratchboxuser
  • set up the SDK
scratchboxuser@i386 $ wget http://repository.maemo.org/stable/diablo/maemo-sdk-install_4.1.2.sh

Start the install script and accept all choices:

scratchboxuser@i386 $ sh maemo-sdk-install_4.1.2.sh
  • start scratchbox
scratchboxuser@i386 $ /scratchbox/login
[sbox-DIABLO_ARMEL: ~] > sb-conf select DIABLO_ARMEL
[sbox-DIABLO_ARMEL: ~] > cat > main.c << EOF
#include <stdio.h>

int main()
{
  printf("hello world");
}
EOF
[sbox-DIABLO_ARMEL: ~] > gcc main.c
[sbox-DIABLO_ARMEL: ~] > file a.out
a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped
  • copy the file to your Nokia N810 using scp

=> the file is executable on the Nokia

Re-login

To re-login after a reboot of your virtual machine run

/scratchbox/sbin/sbox_ctl start
/scratchbox/login