| 1 | under construction |
| 2 | |
| 3 | = Setting up development environment for Nokia N9 = |
| 4 | |
| 5 | Build Qt5 and WebKit2 for N9 on Ubuntu 11.10 x64. Running MiniBrowser on the device. |
| 6 | |
| 7 | == I. Scratchbox Instructions == |
| 8 | |
| 9 | This section based on |
| 10 | * https://github.com/resworb/scripts |
| 11 | * https://trac.webkit.org/wiki/BuildingQt5OnHarmattan |
| 12 | |
| 13 | Follow the instructions exactly! |
| 14 | |
| 15 | === 1. Install and configure Scratchbox for Harmattan: === |
| 16 | (run@host) |
| 17 | {{{ |
| 18 | $ wget http://harmattan-dev.nokia.com/unstable/beta3/harmattan-sdk-setup.py |
| 19 | $ chmod +x harmattan-sdk-setup.py |
| 20 | $ sudo ./harmattan-sdk-setup.py admininstall |
| 21 | }}} |
| 22 | |
| 23 | Post install (run@host): |
| 24 | {{{ |
| 25 | $ newgrp sbox |
| 26 | }}} |
| 27 | or logout / login to get user access to /scratchbox/login. |
| 28 | Verify by writing (run@host) |
| 29 | {{{ |
| 30 | $ /scratchbox/login |
| 31 | }}} |
| 32 | you will get prompt |
| 33 | {{{ |
| 34 | #!html |
| 35 | <div style="color:#000055;border: 1pt dotted; margin:1em 2em 1em 2em; padding: 1em;background:none repeat scroll 0 0 #CCDDFF;"> |
| 36 | <pre> |
| 37 | [sbox-HARMATTAN_X86: ~] > |
| 38 | </pre></div> |
| 39 | }}} |
| 40 | |
| 41 | and now you can switch to armel target (run@sbox) |
| 42 | {{{ |
| 43 | [sbox-HARMATTAN_X86: ~] >sb-conf select HARMATTAN_ARMEL |
| 44 | [sbox-HARMATTAN_ARMEL: ~] > |
| 45 | }}} |
| 46 | |
| 47 | CTRL+D to exit. |
| 48 | |
| 49 | Sync resolv.conf and host.conf for network access in Scratchbox (run@host): |
| 50 | {{{ |
| 51 | $ sudo /scratchbox/sbin/sbox_sync |
| 52 | }}} |
| 53 | |
| 54 | |
| 55 | === 2. Prepare your environment === |
| 56 | (run@host) |
| 57 | {{{ |
| 58 | $ mkdir /scratchbox/users/$USER/home/$USER/swork |
| 59 | $ ln -s /scratchbox/users/$USER/home/$USER/swork ~/swork |
| 60 | }}} |
| 61 | |
| 62 | NB: You don't need the explicit swork directory as long as the script directory resides on the same level as the source directories. |
| 63 | |
| 64 | You should now have a working dir (~/swork), residing in/accessible from Scratchbox, linked in the root of your user root. (Not root user!) |
| 65 | |
| 66 | Go to swork directory (run@host): |
| 67 | {{{ |
| 68 | $ cd ~/swork |
| 69 | }}} |
| 70 | |
| 71 | Download scripts for building (run@host): |
| 72 | {{{ |
| 73 | $ git clone https://github.com/resworb/scripts.git browser-scripts |
| 74 | }}} |
| 75 | |
| 76 | 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] |
| 77 | |
| 78 | {{{ |
| 79 | $ cd browser-scripts |
| 80 | $ patch -p1 < browser-script.patch |
| 81 | }}} |
| 82 | |
| 83 | Download testfonts (run@host): |
| 84 | {{{ |
| 85 | $ git clone git://gitorious.org/qtwebkit/testfonts.git ~/swork/testfonts |
| 86 | }}} |
| 87 | |
| 88 | Install required dependencies inside scratchbox (run@host): |
| 89 | {{{ |
| 90 | $ /scratchbox/login |
| 91 | [sbox-HARMATTAN_ARMEL: ~] > cd swork |
| 92 | [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/builddeps-install.sh |
| 93 | [sbox-HARMATTAN_ARMEL: ~/swork] > exit |
| 94 | $ |
| 95 | }}} |
| 96 | |
| 97 | In order to get git installed inside Scratchbox please follow these steps (run@host): |
| 98 | {{{ |
| 99 | $ sudo su |
| 100 | $ echo "deb http://scratchbox.org/debian harmattan main" >> /etc/apt/sources.list.d/sb.list |
| 101 | $ apt-get update |
| 102 | $ apt-get install scratchbox-devkit-git |
| 103 | $ exit |
| 104 | }}} |
| 105 | |
| 106 | Add this to your PATH inside Scratchbox (preferrably add to .bashrc) (run@sbox): |
| 107 | {{{ |
| 108 | [sbox-HARMATTAN_ARMEL: ~] > echo "export PATH=/scratchbox/devkits/git/bin:\$PATH" >> ~/.bashrc |
| 109 | [sbox-HARMATTAN_ARMEL: ~] > . ./.bashrc |
| 110 | }}} |
| 111 | |
| 112 | The next step is getting the source of Qt5 and WebKit (run@host): |
| 113 | {{{ |
| 114 | $ browser-scripts/clone-sources.sh |
| 115 | }}} |
| 116 | This will try to clone Qt5 and WebKit git repository to ~/swork/qt5 and ~/swork/webkit. |
| 117 | |
| 118 | {{{ |
| 119 | #!html |
| 120 | <div style="color:#550000;border: 1pt dotted; margin:1em 2em 1em 2em; padding: 1em;background:none repeat scroll 0 0 #FFCCBB;"> |
| 121 | <b>Warning</b>: 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 .</div> |
| 122 | }}} |
| 123 | |
| 124 | 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): |
| 125 | {{{ |
| 126 | $ browser-scripts/update-sources.sh |
| 127 | }}} |
| 128 | |
| 129 | === 3. Create ICECC toolchain (optional) === |
| 130 | |
| 131 | If you have |
| 132 | |
| 133 | === 4. Build QtWebKit === |
| 134 | |
| 135 | Login to scratchbox (run@host): |
| 136 | {{{ |
| 137 | $ /scratchbox/login |
| 138 | [sbox-HARMATTAN_ARMEL: ~] > |
| 139 | [sbox-HARMATTAN_ARMEL: ~] > cd ~/swork |
| 140 | }}} |
| 141 | |
| 142 | Before building, you have to remove environment variable that was used to work with other Qt version (run@sbox): |
| 143 | {{{ |
| 144 | [sbox-HARMATTAN_ARMEL: ~/swork] > export -n QTDIR |
| 145 | }}} |
| 146 | |
| 147 | You should also remove '''/usr/X11R6/bin''' and '''Qt''' from PATH. |
| 148 | Check and modify your path variable (run@sbox): |
| 149 | {{{ |
| 150 | [sbox-HARMATTAN_ARMEL: ~/swork] > echo $PATH |
| 151 | }}} |
| 152 | You may get something similar to this: |
| 153 | {{{ |
| 154 | #!html |
| 155 | <div style="color:#000055;border: 1pt dotted; margin:1em 2em 1em 2em; padding: 1em;background:none repeat scroll 0 0 #CCDDFF;"> |
| 156 | /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 |
| 157 | </div> |
| 158 | }}} |
| 159 | |
| 160 | |
| 161 | Building Qt5 for Harmattan. You should use the --clean parameter (run@sbox): |
| 162 | {{{ |
| 163 | [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/qt5-build.sh --clean |
| 164 | }}} |
| 165 | |
| 166 | |
| 167 | When building is successful you get a similar message: |
| 168 | {{{ |
| 169 | #!html |
| 170 | <div style="color:#000055;border: 1pt dotted; margin:1em 2em 1em 2em; padding: 1em;background:none repeat scroll 0 0 #CCDDFF;"> |
| 171 | <pre> |
| 172 | Build completed, run the following to use your new Qt build |
| 173 | export PATH=/scratchbox/users/$USER/home/$USER/swork/browser-scripts/../qt5/qtbase/bin:$PATH |
| 174 | </pre> |
| 175 | </div> |
| 176 | }}} |
| 177 | So, follow this instuction that printed (run@sbox): |
| 178 | {{{ |
| 179 | [sbox-HARMATTAN_ARMEL: ~/swork] > export PATH=/scratchbox/users/$USER/home/$USER/swork/browser-scripts/../qt5/qtbase/bin:$PATH |
| 180 | }}} |
| 181 | |
| 182 | Now, build !QtWebKit2 (run@sbox): |
| 183 | {{{ |
| 184 | [sbox-HARMATTAN_ARMEL: ~/swork] > browser-scripts/webkit-build.sh |
| 185 | }}} |
| 186 | |
| 187 | If everything is right you should get similar result: |
| 188 | {{{ |
| 189 | #!html |
| 190 | <div style="color:#000055;border: 1pt dotted; margin:1em 2em 1em 2em; padding: 1em;background:none repeat scroll 0 0 #CCDDFF;"> |
| 191 | <pre> |
| 192 | ... |
| 193 | make[1]: Leaving directory `/home/azbest/swork/qtwebkit-webkit2-dev-builddir-armel-m6/Release' |
| 194 | |
| 195 | =========================================================== |
| 196 | WebKit is now built (30m:22s). |
| 197 | To run QtTestBrowser with this newly-built code, use the |
| 198 | "Tools/Scripts/run-launcher" script. |
| 199 | =========================================================== |
| 200 | </pre></div> |
| 201 | }}} |
| 202 | |
| 203 | == II. == |