Building webkit on linux

READ ME FIRST

QT is no longer a supported port of WebKit since 2013. This document is retained for historical reasons only. For further information, please consult ​ http://www.qt.io/.

Building the Qt port on Linux

These instructions apply to Linux in general with source packages.

Dependencies

The code should be easily built on any Linux distribution which has development packages for Qt installed. Below is the list of dependencies:

  • Qt version 5.0.0 or later
  • gperf (v3.0 or later)
  • bison (v2.4.1 or later)
  • flex (v2.5.33 or later)
  • sqlite (development files)
  • fontconfig (development files)
  • xrender (development files)
  • phonon (development files)
  • libjpeg (development files)
  • libpng (development files)

Building WebKit

First follow the instructions there to get the sources. The Qt port is part of the WebKit source tree, so you don’t need anything extra.

Finally, set the QTDIR environment variable to Qt 5.x’s installation path (or qtbase/bin for a Qt developer builds) and make sure Qt 5.x’s qmake is the first qmake in your PATH (typically by running export PATH=$QTDIR/bin:$PATH ).

If you want the same environment to build bot, refer to ​ http://trac.webkit.org/wiki/QtWebKitGardening. The link contains following items.

If your qmake binary has a different name, e.g. when using Debian, use the —qmake= option to specify the name.

Build WebKit and the Qt test browser with

WebKit/Tools/Scripts/build-webkit --qt

You can also build using Intel® compilers with the following command.

WebKit/Tools/Scripts/build-webkit --qt --qmakearg="CONFIG+=icc -spec linux-icc"

build-webkit (see above) also supports special variable for specifying the OBJDIR directory, as well as some configure and build arguments

WEBKIT_OUTPUTDIR=`pwd`/qtbuild WebKit/Tools/Scripts/build-webkit --qt --makeargs="-j20 -s" --no-video --debug

Optional feature flags and CONFIG options

  • features.pri lists many configurable build options for WebCore and JavascriptCore.
  • For ​ ICU library support: pass CONFIG+=use_system_icu as an extra build-webkit argument. (Currently only tested on Linux.)
Читайте также:  Hex файлы в linux

Using QtCreator to build QtWebKit

  • To better debug QtWebKit, we can use QtCreator.
  • Open $WEBKITDIR/WebKit.pro in QtCreator.
  • Click Projects->Build Settings, In «GENERAL» un-check shadow build as it is not needed.
  • In Build Steps, remove unnecessary build steps, especially qmake and make.
  • Add a custom process step.
  • Check the «Enable custom process set up» checkbox.
  • Fill the «command» box with Tools/Scripts/build-webkit path
  • Fill the «working directory» with webkit/WebKitBuild/Debug/bin path
  • Add «—qt» to command arguments.
  • In build environment you need to update PATH variable by appending $QTDIR/gcc/bin path to existing value.
  • Add a new variable QMAKEPATH to $WEBKITDIR/Tools/qmake.

Testing the port

A very simple test browser is built along with the port and can be executed with

Tools/Scripts/run-launcher --qt

Common Build Errors

Gold Linker Error

/usr/bin/gold: fatal error: out of file descriptors and couldn't close any

This is a bug in Gold Linker. See ​ here
To fix this try the following with root privileges and build:

If you don’t have root privileges you should add the following in /etc/security/limits.conf file

This might need restarting X11/reboot.

If you wan’t a quick temporary workaround, try the following. (Tested in Ubuntu 10.10)

sudo -s; ulimit -n 65535; exec su - yourusername

Missing gperf

../../../WebCore/html/HTMLDocument.cpp: In member function 'virtual void WebCore::HTMLDocument::determineParseMode(const WebCore::String&)': ../../../WebCore/html/HTMLDocument.cpp:389: error: expected initializer before '*' token ../../../WebCore/html/HTMLDocument.cpp:390: error: 'doctypeEntry' was not declared in this scope ../../../WebCore/html/HTMLDocument.cpp:398: error: 'doctypeEntry' was not declared in this scope ../../../WebCore/html/HTMLDocument.cpp:401: error: 'PubIDInfo' has not been declared ../../../WebCore/html/HTMLDocument.cpp:405: error: 'PubIDInfo' has not been declared

This error is typically caused by not having gperf installed. Install gperf , run touch WebCore/html/DocTypeStrings.gperf and try building WebKit again.

Missing SQLite development package

../../../WebCore/loader/icon/SQLDatabase.cpp:30:21: error: sqlite3.h: No such file or directory ../../../WebCore/loader/icon/SQLDatabase.cpp:36: error: "SQLITE_ERROR" was not declared in this scope ../../../WebCore/loader/icon/SQLDatabase.cpp:37: error: "SQLITE_DONE" was not declared in this scope ../../../WebCore/loader/icon/SQLDatabase.cpp:38: error: "SQLITE_OK" was not declared in this scope ../../../WebCore/loader/icon/SQLDatabase.cpp:39: error: "SQLITE_ROW" was not declared in this scope

This error is typically caused by not having the development component of libsqlite3 installed. Install the development package and try building WebKit again.

Missing flex

. /WebKitBuild/Release/lib/libWebKitQt.so: undefined reference to `WebCore::CSSParser::lex()'

This error is typically caused by not having flex installed. Install flex , run touch WebCore/css/tokenizer.flex and try building WebKit again.

Читайте также:  Linux open ports by process

Incompatible version of bison

bison -d -p kjsyy JavaScriptCore/kjs/grammar.y -o grammar.tab.c && mv grammar.tab.c tmp/grammar.cpp && mv grammar.tab.h tmp/grammar.h JavaScriptCore/kjs/grammar.y:364.3-366.9: type clash (`node' `') on default action JavaScriptCore/kjs/grammar.y:366.10: parse error, unexpected ":", expecting ";" or "|"

This error is caused by having an incompatible version of bison installed. The single reported case of this error occurred with bison 1.75, and was resolved by updating to bison 2.3.

Missing Phonon

In file included from ../../../WebCore/platform/graphics/MediaPlayer.cpp:46: ../../../WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h:27:29: error: phononnamespace.h: No such file or directory In file included from ../../../WebCore/platform/graphics/MediaPlayer.cpp:46: ../../../WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h:120: error: ‘Phonon::State’ has not been declared ../../../WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h:120: error: ‘Phonon::State’ has not been declared

This error is caused by not having Phonon installed. Install the development version to resolve.

Missing fontconfig

error: fontconfig/fontconfig.h: No such file or directory

Install fontconfig-dev (libfontconfig-dev).

Outdated Mesa library

../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp: In member function ‘void WebCore::BitmapTextureGL::bind()’: ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:581:9: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:585:9: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:585:9: error: ‘GL_DEPTH_STENCIL’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:587:9: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:589:9: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:590:9: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:590:9: error: ‘GL_COLOR_ATTACHMENT0’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:591:9: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:591:9: error: ‘GL_STENCIL_ATTACHMENT’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:591:9: error: ‘GL_RENDERBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:600:9: error: ‘GL_FRAMEBUFFER’ was not declared in this scope ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp: In member function ‘virtual void WebCore::TextureMapperGL::bindSurface(WebCore::BitmapTexture*)’: ../../../Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp:646:9: error: ‘GL_FRAMEBUFFER’ was not declared in this scope

Update the Mesa OpenGL library ( ​ libgl1-mesa-dev on Debian systems).

Источник

Introduction

WebKit is an open source web browser engine. WebKit is also the name of the Mac OS X system framework version of the engine that’s used by Safari, Dashboard, Mail, and many other OS X applications. WebKit’s HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE. This page will help you compile WebKit on your Ubuntu system.

Karmic and newer

Since Karmic, WebKit has been available in the Ubuntu archives as package libwebkit-1.0-2. It can be launched as a standalone demo (for testing bugs independently of the various browsers that use it) by running /usr/lib/webkit-1.0-2/libexec/GtkLauncher

Читайте также:  Linux создайте символьную ссылку

Prerequisites

You should be familiar with the terminal. Visit UsingTheTerminal to learn more about the terminal.

Get dependencies

WebKit requires a newer version of libsoup than provided by the official Ubuntu repositories. Add the PPA for WebKit Team repository to get access to the right version:

sudo add-apt-repository ppa:webkit-team sudo apt-get update

WebKit requires libraries to successfully aquire, configure, and compile. You can get libraries by issuing the following command in your terminal:

sudo apt-get install subversion gtk-doc-tools autoconf automake libtool libgtk2.0-dev libpango1.0-dev libicu-dev libxslt-dev libsoup2.4-dev libsqlite3-dev gperf bison flex libjpeg62-dev libpng12-dev libxt-dev autotools-dev libgstreamer-plugins-base0.10-dev libenchant-dev libgail-dev

Get the source code

To acquire the WebKit source code issue the following command in your terminal:

svn checkout http://svn.webkit.org/repository/webkit/trunk ~/src/WebKit

Be patient, this step will take some time.

Compile the code

Change the directory in your terminal to the newly created ~/src/WebKit directory with the following command:

Now you will need to configure the source to be sure all dependencies are present on your system. Issue this simple command in your terminal:

If your ./autogen.sh command runs without any hitches you are ready to compile WebKit. Issue the following command in your terminal and grab a beer:

Test WebKit

Assuming no errors occurred during the build you can now test WebKit. Launch the demo browser by issuing the following command in your terminal:

~/src/WebKit/Programs/GtkLauncher

Enter the following URL in the browser: http://acid3.acidtests.org, you should see something like the following image:

The Acid3 Test: 100/100

  • < http://webkit.org/ > — The WebKit Open Source Project.
  • < http://trac.webkit.org/wiki/BuildingGtk > — Building the GTK+ port.
  • < http://trac.webkit.org/wiki/HackingGtk > — Hacker’s guide to WebKit/GTK+.
  • < http://trac.webkit.org/wiki/ApplicationsGtk > — Applications using WebKit/GTK+.
  • < http://live.gnome.org/WebKitGtk > — Gnome hosted site dedicated to WebKit/GTK+.
  • < http://planet.webkit.org/ > — Planet WebKit provides updated news about WebKit.

WebKit (последним исправлял пользователь a72-246-0-10 2010-10-27 21:15:40)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

Оцените статью
Adblock
detector