wiki:SettingUpDevelopmentEnvironmentForN9

Version 2 (modified by zarvai@inf.u-szeged.hu, 9 years ago) (diff)

--

under construction

Setting up development environment for Nokia N9

Build Qt5 and WebKit2 for N9 on Ubuntu 11.10 x64. Running MiniBrowser on the device.

I. Scratchbox Instructions

This section based on

Follow the instructions exactly!

1. Install and configure Scratchbox for Harmattan:

(run@host)

  $ wget http://harmattan-dev.nokia.com/unstable/beta3/harmattan-sdk-setup.py 
  $ chmod +x harmattan-sdk-setup.py 
  $ sudo ./harmattan-sdk-setup.py admininstall 

Post install (run@host):

  $ newgrp sbox

or logout / login to get user access to /scratchbox/login.

Verify by writing (run@host)

  $ /scratchbox/login 

you will get prompt

  [sbox-HARMATTAN_X86: ~] >

and now you can switch to armel target (run@sbox)

  [sbox-HARMATTAN_X86: ~] >sb-conf select HARMATTAN_ARMEL
  [sbox-HARMATTAN_ARMEL: ~] >

CTRL+D to exit.

Sync resolv.conf and host.conf for network access in Scratchbox (run@host):

  $ sudo /scratchbox/sbin/sbox_sync

2. Prepare your environment

(run@host)

  $ mkdir /scratchbox/users/$USER/home/$USER/swork 
  $ ln -s /scratchbox/users/$USER/home/$USER/swork ~/swork

NB: You don't need the explicit swork directory as long as the script directory resides on the same level as the source directories.

You should now have a working dir (~/swork), residing in/accessible from Scratchbox, linked in the root of your user root. (Not root user!)

Go to swork directory (run@host):

  $ cd ~/swork

Download scripts for building (run@host):

  $ git clone https://github.com/resworb/scripts.git browser-scripts

Apply the pach attached to this page: browser-script.patch

  $ cd browser-scripts
  $ patch -p1 < browser-script.patch

Download testfonts (run@host):

  $ git clone git://gitorious.org/qtwebkit/testfonts.git ~/swork/testfonts

Install required dependencies inside scratchbox (run@host):

  $ /scratchbox/login
  [sbox-HARMATTAN_ARMEL: ~] > cd swork
  [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/builddeps-install.sh
  [sbox-HARMATTAN_ARMEL: ~/swork] > exit
  $

In order to get git installed inside Scratchbox please follow these steps (run@host):

  $ sudo su 
  $ echo "deb http://scratchbox.org/debian harmattan main" >> /etc/apt/sources.list.d/sb.list
  $ apt-get update
  $ apt-get install scratchbox-devkit-git
  $ exit

Add this to your PATH inside Scratchbox (preferrably add to .bashrc) (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~] > echo "export PATH=/scratchbox/devkits/git/bin:\$PATH" >> ~/.bashrc
  [sbox-HARMATTAN_ARMEL: ~] > . ./.bashrc

The next step is getting the source of Qt5 and WebKit (run@host):

  $ browser-scripts/clone-sources.sh

This will try to clone Qt5 and WebKit git repository to ~/swork/qt5 and ~/swork/webkit.

Warning: Sometimes Qt5 cloning fail because of connection timeout problems. This would cause that your ~/swork/qt5/qtscript direcory stays empty and WebKit build will miss QtScript/qscriptengine.h header. In this case delete ~/swork/qt5 and re-run clone-sources.sh .

If you have already a local git repo for WebKit, you can speed up the process by copying its contents to ~/swork/webkit directory. After copying you should run git reset --hard HEAD on it before running clone-sources.sh . You can update the sources by running (run@host):

  $ browser-scripts/update-sources.sh

3. Create ICECC toolchain (optional)

If you have multiple workstations configured to use ICECC, you can speed up building process significantly.

Create a toolchain for distributed building (run@host):

  $ cd ~/swork
  $ browser-scripts/create-icecc-env.sh > icecc-env.sh

The resulted icecc-env.sh file will be similar to this:

icecc_tarball=$(readlink -f $HOME/icecc/icecc-build)
parallel_builds="40"

if [ -f $icecc_tarball ] ; then
    export ICECC_VERSION="i386:$icecc_tarball,x86_64:$icecc_tarball"
    export PATH="/home/azbest/icecc/bin:$PATH"
    export MAKEFLAGS="$MAKEFLAGS -j$parallel_builds"
    export DEB_BUILD_OPTIONS="$DEB_BUILD_OPTIONS,parallel=$parallel_builds"
fi

Make the script runnable and execute it before building inside scratchbox when you need speedup.

4. Build QtWebKit

Login to scratchbox and optionally execute script for icecc (run@host):

  $ /scratchbox/login
  [sbox-HARMATTAN_ARMEL: ~] >
  [sbox-HARMATTAN_ARMEL: ~] > cd ~/swork
  [sbox-HARMATTAN_ARMEL: ~/swork] > . icecc-env.sh

Before building, you have to remove environment variable that was used to work with other Qt version (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~/swork] > export -n QTDIR

You should also remove /usr/X11R6/bin and Qt from PATH. Check and modify your path variable (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~/swork] > echo $PATH

You may get something similar to this:

/scratchbox/devkits/git/bin:/host_usr/bin:/scratchbox/devkits/hashutils-squeeze-sdk/bin:/scratchbox/devkits/debian-squeeze/bin:/scratchbox/devkits/perl/bin:/scratchbox/devkits/qemu/bin:/scratchbox/tools/bin:/targets/links/arch_tools/bin:/scratchbox/compilers/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin

Building Qt5 for Harmattan. You should use the --clean parameter (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/qt5-build.sh --clean

When building is successful you get a similar message:

Build completed, run the following to use your new Qt build
export PATH=/scratchbox/users/$USER/home/$USER/swork/browser-scripts/../qt5/qtbase/bin:$PATH

So, follow this instuction that printed (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~/swork] > export PATH=/scratchbox/users/$USER/home/$USER/swork/browser-scripts/../qt5/qtbase/bin:$PATH

Now, build !QtWebKit2 (run@sbox):

  [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/webkit-build.sh

If everything is right you should get similar result:

...
make[1]: Leaving directory `/home/azbest/swork/qtwebkit-webkit2-dev-builddir-armel-m6/Release'

===========================================================
 WebKit is now built (30m:22s). 
 To run QtTestBrowser with this newly-built code, use the
 "Tools/Scripts/run-launcher" script.
===========================================================

II.

Attachments (2)

Download all attachments as: .zip