How can I compile Midori (with granite) to use WebKit2 instead of WebKit?
Open up Terminal and do the following things:
Make sure you have the necessary dependencies to compile it.
apt-get build-depgrabs almost everything from packaging, but you'll need to manually get WebKit2Gtk+
sudo apt-get build-dep midori-granite sudo apt-get install libwebkit2gtk-4.0-dev
Branch Midori's source code from Launchpad:
bzr branch lp:midori
Change into the
midorifolder you just branched and make a build directory. Then change into that directory. You don't need to make a separate build directory, but I recommend it because it makes it easy to "clean" the branch in case something goes wrong in your build and you want to try again.
cd midori mkdir build cd build
Configure CMake with the options necessary to build with Webkit2. If for whatever reason you're not interested in building with Granite, leave off the
cmake -DCMAKE_INSTALL_PREFIX=/usr -DHALF_BRO_INCOM_WEBKIT2=true -DUSE_GRANITE=true ../
Make and test
If everything seems to be great and you want to install:
sudo make install
Keep in mind that elementary carries some additional Midori patches in Packaging, so you may notice some small differences (read: breakages). You can browse those patches here. Also keep in mind that Midori isn't currently being built with WebKit2 because there are a number of unsolved bugs. You can see known bugs here.
The blog post WebKitGTK+ 2.5.1: Good bye WebKit1 suggests how to build WebKitGTK+ 2 (if it's not already installed / available):
cd webkitgtk cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR=lib -DPORT=GTK -DCMAKE_BUILD_TYPE=Release . make checkinstall
Linux from Scratch has instructions for building Midori with a switch for WebKitGTK+ 2 support. And Midori itself offers info on how-to build with Granite support (
-DUSE_GRANITE=1). So putting both together I come up with this:
cd midori mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_ZEITGEIST=OFF \ -DUSE_GTK3=1 \ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/midori-0.5.11 \ -DUSE_GRANITE=1 \ .. && make checkinstall
You could try this and report back. What's the worst that could happen? (I'd suggest using a virtual machine, as I have no idea...)
Please note, I have used
checkinstall instead of
make install to (hopefully) make it easier to get rid of everything again.