How to build WebKit for maemo chinook
Assuming you have a chinook-based scratchbox2 toolchain on your box.
1) Grab a copy of cairo 2) Grab a copy of latest pixman 3) Grab a copy of ICU 3.8 4) Build each of the previous libs beginning with pixman with the following commands:
sb2 ./configure --prefix=/usr
sb2 make
sudo sb2 make install
Check the version, like so:
sb2 pkg-config --modversion pixman-1
sb2 pkg-config --modversion cairo
Note, the /usr prefix was necessary, because the WebKit build process had some issues with including and linking of stuff in /usr/local.
5) Grab a copy of the WebKit devel git tip: git clone git://git.webkit.org/WebKit.git
6) Perform the following commands:
sb2 ./autogen.sh --prefix=/usr --enable-xslt=false --with-hildon --enable-xpath=false --enable-dashboard-support=false
sb2 make
7) After a couple of hours (yes it’s that embarrassing), perform the final step in hacking the Programs\GtkLauncher script as follows, basically extract all necessary build steps from the relink command in that script into some kind of a more decent shell script:
LD_LIBRARY_PATH=/usr/lib/libsb2:/usr/lib64/libsb2:/usr/lib32/libsb2:/emul/lib64/libsb2:/emul/lib32/libsb2
export LD_LIBRARY_PATH
PATH=/home/$USER/.scratchbox2/chinook40_armel/bin:/usr/share/scratchbox2/scripts:/usr/bin:/home/$USER/.scratchbox2/chinook40_armel/bin:/usr/share/scratchbox2/scripts:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/$USER/aplix/apache-maven-2.0.8/bin:/home/$USER/aplix/apache-maven-2.0.8/bin:/sbin:/usr/sbin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/bin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/usr/bin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/usr/local/bin:/sbin:/usr/sbin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/bin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/usr/bin:/home/$USER/.maemo-sdk/rootstraps/armel/chinook40_armel/usr/local/bin
export PATH
gcc -O2 -o webkit WebKitTools/GtkLauncher/Programs_GtkLauncher-main.o ./.libs/libwebkit-1.0.so -L/usr/lib -lXt -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lrt -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lpng12 -lXrender -lX11 -lfontconfig -lxml2 -lssl -lcrypto -lz -licui18n -licuuc -licudata -ldl -lpthread -Wl,--rpath -Wl,/home/$USER/aplix/WebKit/.libs
exit 0
Note this script is one of the worst I’ve ever seen, and your script might have different paths in the LD_LIBRARY_PATH and PATH variable setup of course.
8) Run
sb2 Programs/GtkLauncher
You should have a binary webkit afterwards in the current directory. The next you need is to pack together the following files into the following structure and deploy them on the N8xx target device:
usr/
|-- bin
| `-- webkit
|-- lib
| |-- libicudata.so.38
| |-- libicui18n.so.38
| |-- libicuuc.so.38
| |-- libpixman-1.so.0
| `-- libwebkit-1.0.so.1
Then you will be able to enjoy a GTK-based WebKit browser on your N8xx.
Older stuff
- All Plug-In bugs in WebKit
- Liveconnect bug in Webkit
- Relevant part of the Webkit source code tree Esp. jni_utility.cpp
- Simple test to see if Liveconnect is working on your system
- Look out for the environment variable
/System/Library/Frameworks/JavaVM.framework/JavaVM - Apple’s resource of plugin development
The NPAPI code in Webkit looks like it was once ripped from Mozilla’s old code base. Webkit’s NPAPI code has diverged considerably from Gecko’s. Esp. considering NPAPI is also being further extended in the Gecko code base.
NPAPI plugin support with WebKit trunk
Rodney Dawes (Dobey) from Collabora is implementing NPAPI support in the GTK backend.
UPDATE From r32766, there should be NPAPI GTK support.
Building GTK with plugin support
This is non-trivial as doing checkouts from HEAD is quite tricky. Builds often fail in my experience. So ask around for a good revision number to work from to save some time.
Here is a good guide to building the GTK
port. Typically only
a Debian/linux machine will have all the GTK libraries, so don’t bother
building on win32. Aplix collegue Mike Emmel has hacked his MacOSX to get the
darwin GTK port working. 
If you are building on a fast linux machine, ensure you’re building for 32bit architecture to say yourself some grief!
Basic steps
- Check the build report for GTK
git pullthe release that workedrm -rf WebKitBuildWebKit/WebKitTools/Scripts/build-webkit --debug --gtk --qmake=qmake-qt4WebKit/WebKitBuild/Release/WebKitTools/GtkLauncher/GtkLauncher
Setup ccache
apt-get install ccacheexport PATH=/usr/lib/ccache:$PATH- put this line into your .bashrc
Pleyo’s OWB embedded WebKit
Quick compile instructions for Debian sid:
svn co http://www.sand-labs.org/svn/branches/Doduo Doduo
mkdir Doduo/build
cd Doduo/build
x61:~/aplix/owb/Doduo/build% cmake -D WEBKIT_USE_NPAPI=ON -D CMAKE_CXX_COMPILER="/usr/bin/ccache" -D CMAKE_CXX_COMPILER_ARG1="/usr/bin/g++-4.2" -D CMAKE_C_COMPILER="/usr/bin/ccache" -D CMAKE_C_COMPILER_ARG1="/usr/bin/gcc-4.2" ..
Notice the .. and they are probably several other options like Unit tests and HTML5 video support you want to turn off to save time.
make
Building Debian GTK WebKit
[git clone git://git.debian.org/git/pkg-webkit/webkit.git](http://git.debian.org/?p=pkg-webkit/webkit.git;a=summary)
git buildpackage --git-ignore-new -nc -us -uc
User agent strings
An authorative list of historical UA strings
What follows is my little gleamed collection:
Built on won (tip of tree)
“Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/523.3+ (KHTML, like Gecko) Safari/419.3”
Safari on 10.4.10 Version 2.0.4 (419.3)
“Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419.3 (KHTML, like Gecko) Safari/419.3”
Nokia S60 browser
SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es65
Safari 3 Beta
“Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11.1 (KHTML, like Gecko) Version/3.0.3 Safari/522.12.1”
Ipod touch
“Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3”
Notes
Wtf is “Java Plug-in for Cocoa” with plugins.
Tracking in git
- Change 33500
git log --grep=33500 | grep git-svn-id | awk '{print $3}'
Look for “git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33500”
Recover
If you do something silly like replace libpixman on the host: sudo apt-get install —reinstall libpixman-1-0