summaryrefslogtreecommitdiff
path: root/Docs/BUILDING-GTK
blob: f329a18a683413b0e76b577002951edb925edf9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
--------------------------------------------------------------------------------
  Build Instructions for GTK NetSurf                            13 August 2009
--------------------------------------------------------------------------------

  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
  Solaris 10.


  Building and executing NetSurf
================================

  First of all, you should examine the contents of Makefile.defaults
  and enable and disable relevant features as you see fit by creating
  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.
  
  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.
  
  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 "netsurf" shell script:

      $ ./netsurf

  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.

  If you are packaging NetSurf, see the PACKAGING-GTK document.


  Obtaining NetSurf's build dependencies
========================================

  Many of NetSurf's dependencies are packaged on various operating systems.
  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
  in common distros.  For now, you'll have to make do with svn checkouts.

  Some of NetSurf's own libraries will be installed in /usr/local/ by default.
  Fedora, and perhaps some other distributions of Linux, do not ship a
  pkg-config that will search here, so you will either need to change where
  these libraries install, or do the following before building NetSurf itself;
  
      $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
      $ export PKG_CONFIG_PATH

  Package installation
----------------------

  Debian-like OS:

      $ apt-get install libglade2-dev libcurl3-dev libxml2-dev libmng-dev 
      $ apt-get install librsvg2-dev

  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.

  Fedora:

      $ yum install libglade2-devel curl-devel libxml2-devel libmng-devel
      $ yum install librsvg2-devel lcms-devel

  Other:

  You'll need to install the development resources for libglade2, libcurl3,
  libxml2, libmng and librsvg.

  Note that if you don't require MNG or JNG image support, NetSurf can be
  configured to use libpng instead of libmng. If you wish to do this, install
  the libpng development package instead.

  The NetSurf project's libraries
---------------------------------

  The NetSurf project has developed several libraries which are required by
  the browser. These are:

  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

  To fetch each of these libraries, run the following commands:

      $ svn co svn://svn.netsurf-browser.org/trunk/libparserutils
      $ svn co svn://svn.netsurf-browser.org/trunk/libwapcaplet
      $ svn co svn://svn.netsurf-browser.org/trunk/hubbub
      $ svn co svn://svn.netsurf-browser.org/trunk/libcss
      $ svn co svn://svn.netsurf-browser.org/trunk/libnsgif
      $ svn co svn://svn.netsurf-browser.org/trunk/libnsbmp

  To build and install these libraries, simply enter each of their directories
  and run:
  
      $ sudo make install

  Librosprite
-------------

  NetSurf uses James Shaw's librosprite for rendering RISC OS Sprite
  files on non-RISC OS platforms.  The Makefile will automatically use
  librosprite if it is installed.  You can disable it entirely by
  creating a Makefile.config file.

  To build librosprite, check out from svn://svn.rjek.com/jshaw/libsprite/trunk
  Build and install it:

      $ sudo make install

  Optionally, specify an install prefix:

      $ PREFIX=/path/to/install make install

  Libhpdf
---------

  NetSurf can use Haru PDF to enable PDF export and printing in GTK.  This
  is currently enabled by default, and cannot be auto-detected by the Makefile.
  If you wish to disable it, do so by creating a Makefile.config file.

  Haru PDF can be obtained from http://libharu.org/, although we currently
  depend on features that none of the official released versions does have.
  The current development versions of libharu are fine and we anticipate
  the libharu 2.2 release will be fine for NetSurf usage.
  A recently taken snapshot of one of those libharu development versions can
  be found at:

      svn://svn.netsurf-browser.org/trunk/libharu

  General requirements
----------------------

  NetSurf requires at minimum GTK 2.12. Earlier versions will not work. It also
  depends on Cairo for rendering, but you should have this already with
  versions of GTK 2.12 or later.

  This will pull in loads of things, like all the GTK dev libraries, the PNG
  and JPEG libraries, colour management libraries, zlib, OpenSSL etc that
  NetSurf also depends on.