Roll src/third_party/WebKit 0c3f21f:4f9ce20 (svn 202223:202224)
[chromium-blink-merge.git] / docs / linux_build_instructions_prerequisites.md
blob38a43fcf0294834f7c37c7ea385374d8a56f8fc3
1 # Linux Build Instructions — Prerequisites
3 This page describes system requirements for building Chromium on Linux.
5 [TOC]
7 ## System Requirements
9 ### Linux distribution
11 You should be able to build Chromium on any reasonably modern Linux
12 distribution, but there are a lot of distributions and we sometimes break things
13 on one or another. Internally, our development platform has been a variant of
14 Ubuntu 14.04 (Trusty Tahr); we expect you will have the most luck on this
15 platform, although directions for other popular platforms are included below.
17 ### Disk space
19 It takes about 10GB or so of disk space to check out and build the source tree.
20 This number grows over time.
22 ### Memory space
24 It takes about 8GB of swap file to link chromium and its tests. If you get an
25 out-of-memory error during the final link, you will need to add swap space with
26 swapon. It's recommended to have at least 4GB of memory available for building a
27 statically linked debug build. Dynamic linking and/or building a release build
28 lowers memory requirements. People with less than 8GB of memory may want to not
29 build tests since they are quite large.
31 ### 64-bit Systems
33 Chromium can be compiled as either a 32-bit or 64-bit application. Chromium
34 requires several system libraries to compile and run. While it is possible to
35 compile and run a 32-bit Chromium on 64-bit Linux, many distributions are
36 missing the necessary 32-bit libraries, and will result in build or run-time
37 errors.
39 ### Depot tools
41 Before setting up the environment, make sure you install the
42 [depot tools](http://dev.chromium.org/developers/how-tos/depottools) first.
44 ## Software Requirements
46 ### Ubuntu Setup
48 Run [build/install-build-deps.sh](/build/install-build-deps.sh) The script only
49 supports current releases as listed on https://wiki.ubuntu.com/Releases.
51 Building on Linux requires software not usually installed with the
52 distributions.
54 The script attempts to automate installing the required software. This script is
55 used to set up the canonical builders, and as such is the most up to date
56 reference for the required prerequisites.
58 ### Other distributions
60 Note: Other distributions are not officially supported for building and the
61 instructions below might be outdated.
63 #### Debian Setup
65 Follow the Ubuntu instructions above.
67 If you want to install the build-deps manually, note that the original packages
68 are for Ubuntu. Here are the Debian equivalents:
70 *   libexpat-dev -> libexpat1-dev
71 *   freetype-dev -> libfreetype6-dev
72 *   libbzip2-dev -> libbz2-dev
73 *   libcupsys2-dev -> libcups2-dev
75 Additionally, if you're building Chromium components for Android, you'll need to
76 install the package: lib32z1
78 #### openSUSE Setup
80 For openSUSE 11.0 and later, see
81 [Linux openSUSE Build Instructions](linux_open_suse_build_instructions.md).
83 #### Fedora Setup
85 Recent systems:
87 ```shell
88 su -c 'yum install subversion pkgconfig python perl gcc-c++ bison \
89 flex gperf nss-devel nspr-devel gtk2-devel glib2-devel freetype-devel \
90 atk-devel pango-devel cairo-devel fontconfig-devel GConf2-devel \
91 dbus-devel alsa-lib-devel libX11-devel expat-devel bzip2-devel \
92 dbus-glib-devel elfutils-libelf-devel libjpeg-devel \
93 mesa-libGLU-devel libXScrnSaver-devel \
94 libgnome-keyring-devel cups-devel libXtst-devel libXt-devel pam-devel'
95 ```
97 The msttcorefonts packages can be obtained by following the instructions present
98 here: http://www.fedorafaq.org/#installfonts
100 For the optional packages:
102 *   php-cgi is provided by the php-cli package
103 *   wdiff doesn't exist in Fedora repositories, a possible alternative would be
104     dwdiff
105 *   sun-java6-fonts doesn't exist in Fedora repositories, needs investigating
107     su -c 'yum install httpd mod_ssl php php-cli wdiff'
109 #### Arch Linux Setup
111 Most of these packages are probably already installed since they're often used,
112 and the parameter --needed ensures that packages up to date are not reinstalled.
114 ```shell
115 sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
116   nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
117   libgnome-keyring
120 For the optional packages on Arch Linux:
122 *   php-cgi is provided with pacman
123 *   wdiff is not in the main repository but dwdiff is. You can get wdiff in
124     AUR/yaourt
125 *   sun-java6-fonts do not seem to be in main repository or AUR.
127 For a successful build, add `'remove_webcore_debug_symbols': 1,` to the
128 variables-object in include.gypi. Tested on 64-bit Arch Linux.
130 TODO: Figure out how to make it build with the WebCore debug symbols. `make V=1`
131 can be useful for solving the problem.
133 #### Mandriva setup
135 ```shell
136 urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
137 lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
138 lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
139 perl bison flex subversion gperf
142 *** note
143 Note 1: msttcorefonts are not available, you will need to build your own (see
144 instructions, not hard to do, see
145 [mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use drakfont to
146 import the fonts from a windows installation
149 *** note
150 Note 2: these packages are for 64 bit, to download the 32 bit packages,
151 substitute lib64 with lib
154 *** note
155 Note 3: some of these packages might not be explicitly necessary as they come as
156 dependencies, there is no harm in including them however.
159 *** note
160 Note 4: to build on 64 bit systems use, instead of
161 `GYP_DEFINES=target_arch=x64`, as mentioned in the general notes for building on
162 64 bit:
164 ```shell
165 export GYP_DEFINES="target_arch=x64"
166 gclient runhooks --force
170 #### Gentoo setup
172     emerge www-client/chromium