2008-03-21 23:10:23 +03:00
|
|
|
--------------------------------------------------------------------------------
|
2014-03-16 19:54:50 +04:00
|
|
|
Build Instructions for GTK NetSurf 16 March 2014
|
2008-03-21 23:10:23 +03:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2008-03-30 03:26:37 +04:00
|
|
|
This document provides instructions for building the GTK version of NetSurf
|
|
|
|
and provides guidance on obtaining NetSurf's build dependencies.
|
|
|
|
|
|
|
|
GTK NetSurf has been tested on Debian, Ubuntu, Fedora 8, FreeBSD, NetBSD and
|
2014-03-16 19:24:43 +04:00
|
|
|
Solaris 10. NetSurf requires at minimum GTK 2.12.
|
2008-03-30 03:26:37 +04:00
|
|
|
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Quick Start
|
|
|
|
=============
|
2008-03-30 03:26:37 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
See the QUICK-START document, which provides a simple environment with
|
2014-03-16 19:54:50 +04:00
|
|
|
which you can fetch, build and install NetSurf and its dependencies.
|
2008-03-21 23:10:23 +03:00
|
|
|
|
2014-03-16 19:54:50 +04:00
|
|
|
The QUICK-START is the recommended way to build NetSurf.
|
2008-03-21 23:10:23 +03:00
|
|
|
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Manual building
|
|
|
|
=================
|
2008-03-21 23:10:23 +03:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
If you can't follow the quick start instructions, you will have to build
|
|
|
|
NetSurf manually. The instructions for doing this are given below.
|
2008-03-21 23:10:23 +03:00
|
|
|
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Obtaining the build dependencies
|
|
|
|
----------------------------------
|
2008-03-21 23:10:23 +03:00
|
|
|
|
2008-03-30 03:26:37 +04:00
|
|
|
Many of NetSurf's dependencies are packaged on various operating systems.
|
2008-11-13 12:22:30 +03:00
|
|
|
The remainder must be installed manually. Currently, some of the libraries
|
|
|
|
developed as part of the NetSurf project have not had official releases.
|
|
|
|
Hopefully they will soon be released with downloadable tarballs and packaged
|
2012-07-15 21:04:15 +04:00
|
|
|
in common distros. For now, you'll have to make do with Git checkouts.
|
2008-03-30 03:26:37 +04:00
|
|
|
|
|
|
|
Package installation
|
2014-03-16 19:24:43 +04:00
|
|
|
--------------------
|
2008-03-21 23:10:23 +03:00
|
|
|
|
|
|
|
Debian-like OS:
|
|
|
|
|
2014-01-04 21:07:11 +04:00
|
|
|
$ apt-get install libgtk2.0-dev libcurl3-dev libpng-dev
|
2013-12-22 18:10:55 +04:00
|
|
|
$ apt-get install librsvg2-dev libjpeg-dev
|
2008-03-21 23:10:23 +03:00
|
|
|
|
2013-06-06 19:35:30 +04:00
|
|
|
If you want to build with gtk 3 replace libgtk2.0-dev with libgtk-3-dev
|
|
|
|
|
2009-02-22 17:51:44 +03:00
|
|
|
Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
|
|
|
|
note that when it has not been built with OpenSSL, the SSL_CTX is not
|
|
|
|
available and results that certification details won't be presented in case
|
|
|
|
they are invalid. But as this is currently unimplemented in the GTK
|
|
|
|
flavour of NetSurf, this won't make a difference at all.
|
2009-02-02 01:05:56 +03:00
|
|
|
|
2012-01-02 01:42:38 +04:00
|
|
|
For experimental javascript support the mozilla spiermonkey library
|
|
|
|
is required:
|
|
|
|
|
|
|
|
$ apt-get install libmozjs-dev
|
|
|
|
|
2008-03-21 23:10:23 +03:00
|
|
|
Fedora:
|
|
|
|
|
2014-01-04 21:07:11 +04:00
|
|
|
$ yum install curl-devel libpng-devel
|
2013-12-22 18:10:55 +04:00
|
|
|
$ yum install librsvg2-devel expat-devel
|
2008-03-21 23:10:23 +03:00
|
|
|
|
2008-11-13 12:22:30 +03:00
|
|
|
Other:
|
|
|
|
|
2009-07-24 03:25:51 +04:00
|
|
|
You'll need to install the development resources for libglade2, libcurl3,
|
2014-01-04 21:07:11 +04:00
|
|
|
libpng and librsvg.
|
2008-11-13 12:22:30 +03:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Libharu
|
|
|
|
-------
|
|
|
|
|
|
|
|
NetSurf can use Haru PDF to enable PDF export. Haru PDF can be obtained
|
|
|
|
from http://libharu.org/. We require libharu 2.2 or later.
|
|
|
|
|
|
|
|
| Note: libharu cannot be auto-detected by the Makefile. If you wish to
|
|
|
|
| enable it, do so by creating a Makefile.config file.
|
|
|
|
|
|
|
|
|
|
|
|
Preparing your workspace
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
NetSurf has a number of libraries which must be built in-order and
|
|
|
|
installed into your workspace. Each library depends on a core build
|
|
|
|
system which NetSurf projects use. This build system relies on the
|
|
|
|
presence of things like pkg-config to find libraries and also certain
|
|
|
|
environment variables in order to work correctly.
|
|
|
|
|
|
|
|
Assuming you are preparing a workspace in /home/netsurf/workspace then
|
|
|
|
the following steps will set you up:
|
|
|
|
|
|
|
|
Make the workspace directory and change to it
|
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
$ mkdir -p ${HOME}/netsurf/workspace
|
|
|
|
$ cd ${HOME}/netsurf/workspace
|
|
|
|
|
|
|
|
Make the temporary install space
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
$ mkdir inst
|
|
|
|
|
|
|
|
Make an environment script
|
|
|
|
--------------------------
|
|
|
|
$ cat > env.sh <<'EOF'
|
|
|
|
export PKG_CONFIG_PATH=${HOME}/netsurf/workspace/inst/lib/pkgconfig::
|
|
|
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/netsurf/workspace/inst/lib
|
|
|
|
export PREFIX=${HOME}/netsurf/workspace/inst
|
|
|
|
EOF
|
|
|
|
|
|
|
|
Change to workspace and source the environment
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
Whenever you wish to start development in a new shell, run the following:
|
|
|
|
|
|
|
|
$ cd ${HOME}/netsurf/workspace
|
|
|
|
$ source env.sh
|
|
|
|
|
|
|
|
From here on, any commands in this document assume you have sourced your
|
|
|
|
shell environment.
|
|
|
|
|
|
|
|
|
2009-08-14 01:08:38 +04:00
|
|
|
The NetSurf project's libraries
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
The NetSurf project has developed several libraries which are required by
|
|
|
|
the browser. These are:
|
|
|
|
|
2014-03-16 20:57:15 +04:00
|
|
|
BuildSystem -- Shared build system, needed to build the other libraries
|
2009-08-14 01:08:38 +04:00
|
|
|
LibParserUtils -- Parser building utility functions
|
|
|
|
LibWapcaplet -- String internment
|
|
|
|
Hubbub -- HTML5 compliant HTML parser
|
|
|
|
LibCSS -- CSS parser and selection engine
|
|
|
|
LibNSGIF -- GIF format image decoder
|
|
|
|
LibNSBMP -- BMP and ICO format image decoder
|
2010-02-13 12:55:28 +03:00
|
|
|
LibROSprite -- RISC OS Sprite format image decoder
|
2009-08-14 01:08:38 +04:00
|
|
|
|
2012-03-24 02:50:52 +04:00
|
|
|
To fetch each of these libraries, run the appropriate commands from the
|
2014-03-16 19:24:43 +04:00
|
|
|
Docs/LIBRARIES file, from within your workspace directory.
|
2009-08-14 01:08:38 +04:00
|
|
|
|
|
|
|
To build and install these libraries, simply enter each of their directories
|
|
|
|
and run:
|
2008-08-12 23:02:20 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
$ make install
|
2008-08-12 23:02:20 +04:00
|
|
|
|
2011-01-28 02:04:46 +03:00
|
|
|
| Note: We advise enabling iconv() support in libparserutils, which vastly
|
2010-01-03 00:22:08 +03:00
|
|
|
| increases the number of supported character sets. To do this,
|
|
|
|
| create a file called Makefile.config.override in the libparserutils
|
|
|
|
| directory, containing the following line:
|
|
|
|
|
|
|
|
|
| CFLAGS += -DWITH_ICONV_FILTER
|
|
|
|
|
|
|
|
|
| For more information, consult the libparserutils README file.
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Now you should have all the NetSurf project libraries built and installed.
|
2008-07-26 22:12:04 +04:00
|
|
|
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Getting the NetSurf source
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
From your workspace directory, run the following command to get the NetSurf
|
|
|
|
source:
|
2008-03-30 03:26:37 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
$ git clone git://git.netsurf-browser.org/netsurf.git
|
2008-03-30 03:26:37 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
And change to the 'netsurf' directory:
|
|
|
|
|
|
|
|
$ cd netsurf
|
|
|
|
|
|
|
|
Building and executing NetSurf
|
|
|
|
--------------------------------
|
|
|
|
|
2015-06-15 15:36:53 +03:00
|
|
|
First of all, you should examine the options in Makefile.defaults
|
|
|
|
and gtk/Makefile.defaults and enable and disable relevant features
|
|
|
|
as you see fit by editing a Makefile.config file.
|
|
|
|
|
|
|
|
Some of these options can be automatically detected and used, and
|
|
|
|
where this is the case they are set to such. Others cannot be
|
|
|
|
automatically detected from the Makefile, so you will either need to
|
|
|
|
install the dependencies, or set them to NO.
|
2014-03-16 19:37:47 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
You should then obtain NetSurf's dependencies, keeping in mind which options
|
|
|
|
you have enabled in the configuration file. See the next section for
|
|
|
|
specifics.
|
2014-03-16 19:37:47 +04:00
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
Once done, to build GTK NetSurf on a UNIX-like platform, simply run:
|
|
|
|
|
|
|
|
$ make
|
|
|
|
|
|
|
|
If that produces errors, you probably don't have some of NetSurf's
|
|
|
|
build dependencies installed. See "Obtaining NetSurf's dependencies"
|
|
|
|
below. Or turn off the complaining features in a Makefile.config
|
|
|
|
file. You may need to "make clean" before attempting to build after
|
|
|
|
installing the dependencies.
|
|
|
|
|
|
|
|
Run NetSurf by executing the "test-nsgtk" shell script:
|
|
|
|
|
|
|
|
$ ./test-nsgtk
|
|
|
|
|
|
|
|
This script makes it easy to run the nsgtk binary from the build tree. It
|
|
|
|
sets up some environment variables which enable NetSurf to find its
|
|
|
|
resources.
|
|
|
|
|
2015-06-15 15:36:53 +03:00
|
|
|
Builtin resources
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
There are numerous resources that accompany NetSurf, such as the
|
|
|
|
image files for icons, cursors and the ui builder files that
|
|
|
|
construct the browsers interface.
|
|
|
|
|
|
|
|
Some of these resources can be compiled into the browser executable
|
|
|
|
removing the need to install these resources separately. The GLib
|
|
|
|
library on which GTK is based provides this functionality to
|
|
|
|
NetSurf.
|
|
|
|
|
|
|
|
Up until GLib version 2.32 only the GDK pixbuf could be integrated
|
|
|
|
in this way and is controlled with the NETSURF_USE_INLINE_PIXBUF
|
|
|
|
variable (set in makefile.config).
|
|
|
|
|
|
|
|
Glib version 2.32 and later integrated support for any file to be a
|
|
|
|
resource while depreciating the old inline pixbuf interface. NetSurf
|
|
|
|
gtk executables can integrate many resources using this interface,
|
|
|
|
configuration is controlled with the NETSURF_USE_GRESOURCE variable.
|
|
|
|
|
|
|
|
Loading from file is the fallback if a resource has not been
|
|
|
|
compiled in, because of this if both of these features are
|
|
|
|
unavailable (or disabled) NetSurf will automatically fall back to
|
|
|
|
loading all its resources from files.
|
|
|
|
|
|
|
|
The resource initialisation within the browser ensures it can access
|
|
|
|
all the resources at start time, however it does not verify the
|
|
|
|
resources are valid so failures could still occur subsequently. This
|
|
|
|
is especially true for file based resources as they can become
|
|
|
|
inaccessible after initialisation.
|
|
|
|
|
2014-03-16 19:24:43 +04:00
|
|
|
|
|
|
|
Note for packagers
|
|
|
|
====================
|
|
|
|
|
|
|
|
If you are packaging NetSurf, see the PACKAGING-GTK document.
|
2008-03-21 23:10:23 +03:00
|
|
|
|