Projects/Mobile/kdepim: Difference between revisions

From KDE TechBase
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This article describes how to compile KDEPIM for maemo. It takes the Nokia N810 as example device. It uses the cross-compiling environment scratchbox on an Intel-based computer.
This article describes how to compile KDEPIM for maemo. It takes the Nokia N810 as example device. It uses the cross-compiling environment scratchbox on an Intel-based computer.
= Overview =
* ''garage'' is where the projects for maemo are hosted. Compare it with sourceforge.
* ''diablo'' is the version of maemo. Compare it with lenny.
* ''maemo'' is the software that runs on a device like Nokia's N810
* ''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 a desktop like plasma
For more information see wikipedia.


= On the Nokia itself =
= On the Nokia itself =


== install subversion ==
== install openssh ==
* to install openssh on a nokia 810
* to install openssh on a nokia 810
* activate the maemo repository in the package manager
* activate the maemo repository in the package manager
Line 14: Line 24:
** openssh
** openssh
** install
** install
== install subversion ==
  ssh root@localhost
  ssh root@localhost
  apt-get install subversion
  apt-get install subversion


= In scratchbox =
= In scratchbox =
You cannot install scratchbox on an X64 computer, so, install an i386 into a VMWare virtual machine. This example uses SUSE 11, but it might work on other distributions as well. The following describes how to install scratchbox into that SUSE 11 32bit installation.
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 ==
== Hello world ==
First, we want to compile a "hello world" program for the Nokia. Here is how.
First, we want to compile a "hello world" program for the Nokia. Here is how.
* Set up scratchbox
* Set up scratchbox
  root@i386 # wget http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.sh
root@i386 # useradd -m scratchboxuser
  root@i386 # chmod 777 maemo-scratchbox-install_4.1.sh
  root@i386 # wget http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.2.sh
  root@i386 # ./maemo-scratchbox-install_4.1.sh -s /scratchbox
  root@i386 # chmod 777 maemo-scratchbox-install_4.1.2.sh
  root@i386 # /scratchbox/sbin/sbox_adduser myuser
  root@i386 # ./maemo-scratchbox-install_4.1.2.sh -s /scratchbox
  root@i386 # su - myuser
  root@i386 # /scratchbox/sbin/sbox_adduser scratchboxuser
  root@i386 # su - scratchboxuser
* set up the SDK
* set up the SDK
  myuser@i386 $ wget http://repository.maemo.org/stable/diablo/maemo-sdk-install_4.1.sh
  scratchboxuser@i386 $ wget http://repository.maemo.org/stable/diablo/maemo-sdk-install_4.1.2.sh
Start the install script and accept all choices:
Start the install script and accept all choices:
  myuser@i386 $ sh maemo-sdk-install_4.1.sh
  scratchboxuser@i386 $ sh maemo-sdk-install_4.1.2.sh
* start scratchbox
* start scratchbox
  myuser@i386 $ /scratchbox/login
  scratchboxuser@i386 $ /scratchbox/login
  [sbox-DIABLO_ARMEL: ~] > sb-conf select DIABLO_ARMEL
  [sbox-DIABLO_ARMEL: ~] > sb-conf select DIABLO_ARMEL
  [sbox-DIABLO_ARMEL: ~] > cat > main.c << EOF
  [sbox-DIABLO_ARMEL: ~] > cat > main.c << EOF
Line 55: Line 68:
  /scratchbox/login
  /scratchbox/login


== install cmake ==
== set up repositories ==
* Here you should better make a snapshot of your virtual machine.
* Here you should better make a snapshot of your virtual machine.
* Then create the installation repositories and install cmake:
* Then create the installation repositories and install cmake:
Line 65: Line 78:
  deb http://repository.maemo.org/extras-devel/ diablo free
  deb http://repository.maemo.org/extras-devel/ diablo free
  deb-src http://repository.maemo.org/extras-devel/ diablo free
  deb-src http://repository.maemo.org/extras-devel/ diablo free
deb http://qt4.garage.maemo.org diablo extra
  EOF
  EOF
  apt-get update
  apt-get update
  apt-get install cmake
 
  root@i386 # cp /etc/resolv.conf /scratchbox/etc/resolv.conf
 
== install cmake ==
wget http://www.cmake.org/files/v2.6/cmake-2.6.2.tar.gz
tar xvzf cmake-2.6.2.tar.gz
cd cmake-2.6.2
./bootstrap && make -j4 && make install  
 
=== more information ===
* You can also choose to add the repositories mentioned in http://www.forwardbias.in/data/articles/qt_on_maemo.txt, but as of 2008-09-07, qmake installed from there crashes with signal 11.
* You can also choose to build qt on your own, but for me it does not find openssl during its installation process.


== Install kde applications ==
== Install kde applications ==
Line 73: Line 98:
  apt-get install shared-mime-info
  apt-get install shared-mime-info
  apt-get install xsltproc
  apt-get install xsltproc
apt-get install libboost-dev
apt-get install libakonadi-dev
  apt-get install kdepimlibs5-dev
  apt-get install kdepimlibs5-dev
  svn co https://svn.kde.org/home/kde/trunk/kdesupport
  apt-get install libstreamanalyzer-dev
cd kdesupport
cmake . && make && make install
  svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdepim
  svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdepim
  cd kdepim
  cd kdepim
Line 82: Line 107:
Here you can get to run singular applications, e.g. ktimetracker.
Here you can get to run singular applications, e.g. ktimetracker.


== re-install kdelibs ==
== on the N810 again ==
 
Copy the applications and libs to the Nokia. Singular applications work, e.g. ktimetracker. Put all libraries and executables onto your flash storage (/media/mmc1) and start it:
=== pcre ===
  EXPORT LD_LIBRARY_PATH=.
cd
  ./ktimetracker
curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.7.tar.gz>pcre-7.7.tar.gz
  tar xvzf pcre-7.7.tar.gz
cd pcre-7.7
./configure && make && make install
 
=== kdelibs ===
cd
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdelibs
mkdir kdelibs-build
cd kdelibs-build
  cmake ../kdelibs
make
make install
 
== install kdepim ==
cd
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdepim
cd kdepim
cmake .
make && make install


= Know-how =
= Know-how =
Line 122: Line 127:
  wget http://93.157.1.37/~marijn/maemo/binary/libqt4-assistant_4.4.1-1maemo0_armel.deb
  wget http://93.157.1.37/~marijn/maemo/binary/libqt4-assistant_4.4.1-1maemo0_armel.deb
  wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xmlpatterns_4.4.1-1maemo0_armel.deb
  wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xmlpatterns_4.4.1-1maemo0_armel.deb
== kompile kdelibs ==
=== pcre ===
cd
curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz>pcre-7.9.tar.gz
tar xvzf pcre-7.9.tar.gz
cd pcre-7.9
./configure && make && make install
=== kdelibs ===
cd
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdelibs
mkdir kdelibs-build
cd kdelibs-build
cmake ../kdelibs
make
make install


= TroubleShooting =
= TroubleShooting =
Line 151: Line 174:
* http://tablets-dev.nokia.com/4.1/INSTALL.txt
* http://tablets-dev.nokia.com/4.1/INSTALL.txt
* http://blogs.forum.nokia.com//data/blogs/resources/300003/maemo_and_sdk_for_qt.pdf
* http://blogs.forum.nokia.com//data/blogs/resources/300003/maemo_and_sdk_for_qt.pdf
* [http://qt4.garage.maemo.org/diablo.html Get the source from garage]
[[Category:PIM]]

Latest revision as of 07:56, 31 May 2010

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

Overview

  • garage is where the projects for maemo are hosted. Compare it with sourceforge.
  • diablo is the version of maemo. Compare it with lenny.
  • maemo is the software that runs on a device like Nokia's N810
  • 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 a desktop like plasma

For more information see wikipedia.

On the Nokia itself

install openssh

  • to install openssh on a nokia 810
  • activate the maemo repository in the package manager
    • settings->application manager
    • tools -> application catalog
    • memo extras -> edit -> un-tag "disabled"
    • close
    • browse installable applications
    • all
    • openssh
    • install

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

set up repositories

  • Here you should better make a snapshot of your virtual machine.
  • Then create the installation repositories and install cmake:
cat >>/etc/apt/sources.list<<EOF
# repository with experimental kde packages and dependencies
deb http://93.157.1.37/~marijn/maemo binary/
deb http://repository.maemo.org/ diablo free non-free
deb-src http://repository.maemo.org/ diablo free
deb http://repository.maemo.org/extras-devel/ diablo free
deb-src http://repository.maemo.org/extras-devel/ diablo free
deb http://qt4.garage.maemo.org diablo extra
EOF
apt-get update
root@i386 # cp /etc/resolv.conf /scratchbox/etc/resolv.conf

install cmake

wget http://www.cmake.org/files/v2.6/cmake-2.6.2.tar.gz
tar xvzf cmake-2.6.2.tar.gz
cd cmake-2.6.2
./bootstrap && make -j4 && make install 

more information

  • You can also choose to add the repositories mentioned in http://www.forwardbias.in/data/articles/qt_on_maemo.txt, but as of 2008-09-07, qmake installed from there crashes with signal 11.
  • You can also choose to build qt on your own, but for me it does not find openssl during its installation process.

Install kde applications

cd
apt-get install shared-mime-info
apt-get install xsltproc
apt-get install libboost-dev
apt-get install libakonadi-dev
apt-get install kdepimlibs5-dev
apt-get install libstreamanalyzer-dev
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdepim
cd kdepim
cmake . && make && make install

Here you can get to run singular applications, e.g. ktimetracker.

on the N810 again

Copy the applications and libs to the Nokia. Singular applications work, e.g. ktimetracker. Put all libraries and executables onto your flash storage (/media/mmc1) and start it:

EXPORT LD_LIBRARY_PATH=.
./ktimetracker

Know-how

manually dpkg

wget http://93.157.1.37/~marijn/maemo/binary/libqt4-qt3support_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-designer_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-script_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-dbus_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqtcore4_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqtgui4_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xml_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-test_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-sql_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-webkit_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-svg_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-assistant_4.4.1-1maemo0_armel.deb
wget http://93.157.1.37/~marijn/maemo/binary/libqt4-xmlpatterns_4.4.1-1maemo0_armel.deb

kompile kdelibs

pcre

cd
curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz>pcre-7.9.tar.gz
tar xvzf pcre-7.9.tar.gz
cd pcre-7.9
./configure && make && make install

kdelibs

cd
svn co https://svn.kde.org/home/kde/branches/KDE/4.1/kdelibs
mkdir kdelibs-build
cd kdelibs-build
cmake ../kdelibs
make 
make install

TroubleShooting

kernel too old

If

cmake 

delivers

FATAL: kernel too old

This happened for me with SLES 10. Better use SUSE 10.3 or SUSE 11.

unable to install maemo-sdk-dev

On SLES 10, I got

Processing was halted because there were too many errors.
E: Sub-process /scratchbox/devkits/debian-etch/bin/dpkg returned an error code (1)
E: Unable to install maemo-sdk-dev on DIABLO_ARMEL target.
E: Please check the sources.list for errors.
E: Scratchbox login returned error 100.

In this case, change your distribution and start again.

ld terminated with signal 9

Should you get

collect2: ld terminated with signal 9 [Killed]

Increase the amount of memory for the virtual machine, 512MB is not always enough.

See also