Qt4 Maemo Binding

From Lazarus wiki
Jump to navigationJump to search

Qt4 Maemo Binding

This page describes the Free Pascal Qt4 Binding for Maemo. Currently Maemo5 on the Nokia N900 version PR1.2 is supported. The binding is an interface to the Qt 4.6.2 of the PR1.2 release.

Introduction

To develop with C++ Qt for the N900, Nokia provides a scratchbox based SDK: Maemo5 SDK Installation The Free Pascal binding is technically just a Qt C++ library, so to compile this binding library, the scratchbox SDK is needed. However if you use the provided library binary of the Free Pascal Binding for Maemo, you do not need to install the scratchbox environment.


Compilation of the binding

These instructions explain how to compile the Free Pascal Qt4 Binding for Maemo sources. If you use the provided binary of the binding, this is not necessary.

  • Install the scratchbox based Maemo5 SDK: Maemo5 SDK Installation
  • After installation, start as root scratchbox: /scratchbox/sbin/sbox_ctl start
  • As normal user login: /scratchbox/login
  • select using sb-menu the arm environment
  • install the Qt4 devel package
    • fakeroot apt-get update
    • fakeroot apt-get install libqt4-dev
  • download (e.g. using wget) and unpack the sources
  • cd into the sources directory
  • qmake (creates Makefile)
  • make (compiles)
  • strip LibraryFileName (reduce filesize)
  • fakeroot make install (installs in scratchbox)

Installation on the N900 device

These instructions explain how to install the Free Pascal Qt4 Binding for Maemo on the Nokia N900 device.

How to setup a wifi or usb access to the device is out of the scope (see Nokia instructions) The instructions assume a working ssh access to the N900 using hostname n900.

First obtain the binding library (libQt4Pas.so.6.2.2) either from the provided binary or from compilation within scratchbox.

Note that it is possible to setup ssh from within scratchbox and ssh from scratchbox to the N900. You can also access the compiled library that resides in scratchbox outside the scratchbox environment. If you installed scratchbox to /scratchbox, then the scratchbox user home directory is located at /scratchbox/users/username/home/username/.


  • Copy the library to the device opt directory (optify)
scp libQt4Pas.so.6.2.2 root@n900:/opt/lib/
  • login to the device as root
ssh root@n900
  • create symlinks
ln -s /opt/lib/libQt4Pas.so.6.2.2 /usr/lib/libQt4Pas.so.6
ln -s /opt/lib/libQt4Pas.so.6.2.2 /usr/lib/libQt4Pas.so

Cross compile for N900

These instructions explain how to cross compile a Free Pascal Qt4 Maemo program from linux to N900. It is strongly advised to read the Free Pascal Docmumentation about cross compilation to understand what you do : Build Faq The scratchbox sdk is not needed, but the device libraries are, these will be copied to a directory named arm

Setup Device Libraries

md /arm ; cd /arm
md binutils ; cp /scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/* binutils
md -p lib ; scp yor:/lib/* lib
md -p usr/lib; scp yor:/usr/lib/* usr/lib