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
* https://github.com/resworb/scripts
* https://trac.webkit.org/wiki/BuildingQt5OnHarmattan
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
{{{
#!html
[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: [https://sed.hu/projects/webkit/attachment/wiki/Build%20Qt5%20and%20WebKit2%20for%20N9%20%28Resworb%20Scripts%29/browser-script.patch?format=raw 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.
{{{
#!html
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
=== 4. Build QtWebKit ===
Login to scratchbox (run@host):
{{{
$ /scratchbox/login
[sbox-HARMATTAN_ARMEL: ~] >
[sbox-HARMATTAN_ARMEL: ~] > cd ~/swork
}}}
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:
{{{
#!html
/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:
{{{
#!html
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:
{{{
#!html
...
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. ==