Building the GTK+ Port
- Install the base WebKitGTK dependencies:
$ Tools/gtk/install-dependencies
- Download and build all JHBuild modules:
$ Tools/Scripts/update-webkitgtk-libs-fmsoft
- Install some packages for final step:
- Install bwrap for lastest version, in any directory:
$ sudo apt-get install libcap-dev
$ git clone https://github.com/projectatomic/bubblewrap
$ cd bubblewrap
$ ./autogen.sh
$ make
$ sudo make install
$ sudo cp /usr/local/bin/bwrap /usr/bin/bwrap
- Build hiWebKit:
# where -jxxx, xxx is the number of your cpu cores.
# Release
$ Tools/Scripts/build-webkit-fmsoft --gtk --makeargs="-j4" --accelerated-2d-canvas
# Debug
$ Tools/Scripts/build-webkit-fmsoft --gtk --makeargs="-j4" --accelerated-2d-canvas --debug
- Run:
# run by scripts
$ Tools/Scripts/run-minibrowser --gtk
# run with LD_LIBRARY_PATH
# Release
$ LD_LIBRARY_PATH=WebKitBuild/DependenciesGTK/Root/lib/ WebKitBuild/Release/bin/MiniBrowser
# Debug
$ LD_LIBRARY_PATH=WebKitBuild/DependenciesGTK/Root/lib/ WebKitBuild/Debug/bin/MiniBrowser
- How to use gdb to debug webkit:
$ LD_LIBRARY_PATH=WebKitBuild/DependenciesGTK/Root/lib/ gdb WebKitBuild/Debug/bin/MiniBrowser
FAQ in Compiling
Absence of "WebKit/WKBundleDOMWindowExtension.h"
When Build hiWebKit, there is an error:
../../Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:31:10: fatal error: WebKit/WKBundleDOMWindowExtension.h: No such file or directory
#include <WebKit/WKBundleDOMWindowExtension.h>
Absence of WKBundleDOMWindowExtension.h in WebKitBuild directory caused this error. You should:
# cp Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.h ./WebKitBuild/Debug/DerivedSources/ForwardingHeaders/WebKit/
OR
# cp Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.h ./WebKitBuild/Release/DerivedSources/ForwardingHeaders/WebKit/
Version Conflict of C++
Because of the update of system, you may meet the problem in excution: ools/Scripts/update-webkitgtk-libs-fmsoft:
In file included from /usr/include/c++/7/cstdint:35:0,
from /usr/include/OpenEXR/ImfFrameBuffer.h:55,
from /usr/include/OpenEXR/ImfRgbaFile.h:51,
from ../../Source/gst-plugins-bad-1.16.0/ext/openexr/gstopenexrdec.cpp:30:
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
You should:
# vim Tools/Scripts/update-webkit-libs-jhbuild-fmsoft
Comment line 186 to 188:
if ($wipeOnChange && -e getJhbuildPath()) {
cleanJhbuild();
}
To
#if ($wipeOnChange && -e getJhbuildPath()) {
# cleanJhbuild();
#}
This modification will not make the upgrade process download the softwares which have been compiled.
Then:
# vim WebKitBuild/DependenciesGTK/Source/gst-plugins-bad-1.16.0/ext/openexr/meson.build
Change line 3:
openexr_extra_cpp_args = cxx.get_supported_arguments(['-std=c++98'])
TO
openexr_extra_cpp_args = cxx.get_supported_arguments(['-std=c++11'])