Difference between revisions of "Qt4 Maemo Binding"

From Free Pascal wiki
Jump to navigationJump to search
Line 3: Line 3:
 
This page describes the Free Pascal Qt4 Binding for Maemo.  
 
This page describes the Free Pascal Qt4 Binding for Maemo.  
 
Currently Maemo5 on the Nokia N900 version PR1.2 is supported.  
 
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.
+
The binding is an interface to Qt 4.6.2 of the PR1.2 release.
  
 
== Introduction ==
 
== Introduction ==
 
To develop with C++ Qt for the N900, Nokia provides a scratchbox based SDK: [http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installation Maemo5 SDK Installation]
 
To develop with C++ Qt for the N900, Nokia provides a scratchbox based SDK: [http://wiki.maemo.org/Documentation/Maemo_5_Final_SDK_Installation 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.
 
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.
+
 
 +
To develop with Free Pascal Qt for the N900, you do not need to install the scratchbox environment, you can use the provided binding binary.
  
  
Line 53: Line 54:
  
 
These instructions explain how to cross compile a Free Pascal Qt4 Maemo program from linux to N900.
 
These instructions explain how to cross compile a Free Pascal Qt4 Maemo program from linux to N900.
 +
 +
=== Setup Cross Compilation ===
 +
 
It is strongly advised to read the Free Pascal Docmumentation about cross compilation to understand what you do : [http://www.stack.nl/~marcov/buildfaq.pdf Build Faq]
 
It is strongly advised to read the Free Pascal Docmumentation about cross compilation to understand what you do : [http://www.stack.nl/~marcov/buildfaq.pdf Build Faq]
The scratchbox sdk is not needed, but the device libraries are, these will be copied to a directory named arm
+
The scratchbox SDK is not needed, only N900 binutils and some N900 device libraries are needed and will be copied to a directory named /arm
 +
 
  
=== Setup Device Libraries ===
 
 
  md /arm ; cd /arm
 
  md /arm ; cd /arm
  md binutils ; cp /scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/* binutils
+
  wget http://users.telenet.be/Jan.Van.hijfte/qtforfpc/n900-binutils.tar.gz
  md -p lib ; scp yor:/lib/* lib
+
tar zxvf n900-binutils.tar.gz
  md -p usr/lib; scp yor:/usr/lib/* usr/lib
+
rm -f n900-binutils.tar.gz
 +
  md -p lib ; scp root@n900:/lib/* lib
 +
  md -p usr/lib; scp root@n900:/usr/lib/* usr/lib

Revision as of 13:16, 28 July 2010

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 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.

To develop with Free Pascal Qt for the N900, you do not need to install the scratchbox environment, you can use the provided binding binary.


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.

Setup Cross Compilation

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, only N900 binutils and some N900 device libraries are needed and will be copied to a directory named /arm


md /arm ; cd /arm
wget http://users.telenet.be/Jan.Van.hijfte/qtforfpc/n900-binutils.tar.gz
tar zxvf n900-binutils.tar.gz
rm -f n900-binutils.tar.gz
md -p lib ; scp root@n900:/lib/* lib
md -p usr/lib; scp root@n900:/usr/lib/* usr/lib