blob: b4a4795321e77716882b017f1e94a9b905435419 [file] [log] [blame] [view]
dpranke0ae7cad2016-11-30 07:47:581# Checking out and building Chromium on Linux
andybons3322f762015-08-24 21:37:092
Victor Costan44af72b2017-11-13 20:01:303There are instructions for other platforms linked from the
Nicolas Norvezba040062020-01-15 01:17:264[get the code](../get_the_code.md) page.
dpranke1a70d0c2016-12-01 02:42:295
dpranke1a70d0c2016-12-01 02:42:296## Instructions for Google Employees
7
8Are you a Google employee? See
9[go/building-chrome](https://goto.google.com/building-chrome) instead.
andybons8c02a1f2015-09-04 17:02:3210
dpranke0ae7cad2016-11-30 07:47:5811[TOC]
andybonsad92aa32015-08-31 02:27:4412
dpranke0ae7cad2016-11-30 07:47:5813## System requirements
andybonsad92aa32015-08-31 02:27:4414
dpranke0ae7cad2016-11-30 07:47:5815* A 64-bit Intel machine with at least 8GB of RAM. More than 16GB is highly
16 recommended.
17* At least 100GB of free disk space.
Mike Taylorfe7d72e2021-10-11 15:03:1118* You must have Git and Python v3.6+ installed already (and `python3` must point
19 to a Python v3.6+ binary).
andybons3322f762015-08-24 21:37:0920
Ben Pastened89a45b2023-06-28 22:57:3421
22Most development is done on Ubuntu (Chromium's build infrastructure currently
23runs 22.04, Jammy Jellyfish). There are some instructions for other distros
24below, but they are mostly unsupported.
andybons3322f762015-08-24 21:37:0925
Brian Sheedycadbcd22022-11-09 23:50:1526### Docker requirements
27
28While it is not a common setup, Chromium compilation should work from within a
29Docker container. If you choose to compile from within a container for whatever
30reason, you will need to make sure that the following tools are available:
31
32* `curl`
33* `git`
34* `lsb_release`
35* `python3`
36* `sudo`
37
38There may be additional Docker-specific issues during compilation. See
39[this bug](https://crbug.com/1377520) for additional details on this.
40
dpranke0ae7cad2016-11-30 07:47:5841## Install `depot_tools`
andybonsad92aa32015-08-31 02:27:4442
sdy93387fa2016-12-01 01:03:4443Clone the `depot_tools` repository:
andybons3322f762015-08-24 21:37:0944
sdy93387fa2016-12-01 01:03:4445```shell
46$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
47```
andybonsad92aa32015-08-31 02:27:4448
sdy93387fa2016-12-01 01:03:4449Add `depot_tools` to the end of your PATH (you will probably want to put this
50in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
51`/path/to/depot_tools`:
andybonsad92aa32015-08-31 02:27:4452
sdy93387fa2016-12-01 01:03:4453```shell
54$ export PATH="$PATH:/path/to/depot_tools"
55```
andybons3322f762015-08-24 21:37:0956
Claudio DeSouzaae44ac12018-02-13 16:11:4557When cloning `depot_tools` to your home directory **do not** use `~` on PATH,
58otherwise `gclient runhooks` will fail to run. Rather, you should use either
59`$HOME` or the absolute path:
60
61```shell
62$ export PATH="$PATH:${HOME}/depot_tools"
63```
64
dpranke0ae7cad2016-11-30 07:47:5865## Get the code
andybonsad92aa32015-08-31 02:27:4466
sdy93387fa2016-12-01 01:03:4467Create a `chromium` directory for the checkout and change to it (you can call
68this whatever you like and put it wherever you like, as long as the full path
69has no spaces):
70
71```shell
72$ mkdir ~/chromium && cd ~/chromium
73```
andybons3322f762015-08-24 21:37:0974
dpranke0ae7cad2016-11-30 07:47:5875Run the `fetch` tool from depot_tools to check out the code and its
76dependencies.
andybonsad92aa32015-08-31 02:27:4477
sdy93387fa2016-12-01 01:03:4478```shell
79$ fetch --nohooks chromium
80```
andybonsad92aa32015-08-31 02:27:4481
dpranke0ae7cad2016-11-30 07:47:5882If you don't want the full repo history, you can save a lot of time by
sdy93387fa2016-12-01 01:03:4483adding the `--no-history` flag to `fetch`.
andybons3322f762015-08-24 21:37:0984
dpranke0ae7cad2016-11-30 07:47:5885Expect the command to take 30 minutes on even a fast connection, and many
86hours on slower ones.
andybonsad92aa32015-08-31 02:27:4487
dpranke0ae7cad2016-11-30 07:47:5888If you've already installed the build dependencies on the machine (from another
sdy93387fa2016-12-01 01:03:4489checkout, for example), you can omit the `--nohooks` flag and `fetch`
dpranke0ae7cad2016-11-30 07:47:5890will automatically execute `gclient runhooks` at the end.
andybons3322f762015-08-24 21:37:0991
sdy93387fa2016-12-01 01:03:4492When `fetch` completes, it will have created a hidden `.gclient` file and a
93directory called `src` in the working directory. The remaining instructions
94assume you have switched to the `src` directory:
andybons3322f762015-08-24 21:37:0995
sdy93387fa2016-12-01 01:03:4496```shell
97$ cd src
98```
andybons3322f762015-08-24 21:37:0999
dpranke0ae7cad2016-11-30 07:47:58100### Install additional build dependencies
andybons3322f762015-08-24 21:37:09101
dpranke0ae7cad2016-11-30 07:47:58102Once you have checked out the code, and assuming you're using Ubuntu, run
103[build/install-build-deps.sh](/build/install-build-deps.sh)
andybons3322f762015-08-24 21:37:09104
Aaron Gable3bc93682019-01-11 02:16:07105```shell
106$ ./build/install-build-deps.sh
107```
108
dpranke2989a782016-12-02 02:57:12109You may need to adjust the build dependencies for other distros. There are
110some [notes](#notes) at the end of this document, but we make no guarantees
111for their accuracy.
andybonsad92aa32015-08-31 02:27:44112
dpranke0ae7cad2016-11-30 07:47:58113### Run the hooks
andybons3322f762015-08-24 21:37:09114
dpranke0ae7cad2016-11-30 07:47:58115Once you've run `install-build-deps` at least once, you can now run the
sdy93387fa2016-12-01 01:03:44116Chromium-specific hooks, which will download additional binaries and other
dpranke0ae7cad2016-11-30 07:47:58117things you might need:
andybonsad92aa32015-08-31 02:27:44118
sdy93387fa2016-12-01 01:03:44119```shell
120$ gclient runhooks
121```
andybonsad92aa32015-08-31 02:27:44122
sdy93387fa2016-12-01 01:03:44123*Optional*: You can also [install API
124keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
125build to talk to some Google services, but this is not necessary for most
126development and testing purposes.
andybons3322f762015-08-24 21:37:09127
dpranke1a70d0c2016-12-01 02:42:29128## Setting up the build
andybonsad92aa32015-08-31 02:27:44129
Tom Bridgwatereef401542018-08-17 00:54:43130Chromium uses [Ninja](https://ninja-build.org) as its main build tool along with
Andrew Williamsbbc1a1e2021-07-21 01:51:22131a tool called [GN](https://gn.googlesource.com/gn/+/main/docs/quick_start.md)
Tom Bridgwatereef401542018-08-17 00:54:43132to generate `.ninja` files. You can create any number of *build directories*
133with different configurations. To create a build directory, run:
andybons8c02a1f2015-09-04 17:02:32134
sdy93387fa2016-12-01 01:03:44135```shell
136$ gn gen out/Default
137```
dpranke0ae7cad2016-11-30 07:47:58138
sdy93387fa2016-12-01 01:03:44139* You only have to run this once for each new build directory, Ninja will
140 update the build files as needed.
141* You can replace `Default` with another name, but
142 it should be a subdirectory of `out`.
143* For other build arguments, including release settings, see [GN build
144 configuration](https://www.chromium.org/developers/gn-build-configuration).
dpranke0ae7cad2016-11-30 07:47:58145 The default will be a debug component build matching the current host
146 operating system and CPU.
147* For more info on GN, run `gn help` on the command line or read the
Andrew Williamsbbc1a1e2021-07-21 01:51:22148 [quick start guide](https://gn.googlesource.com/gn/+/main/docs/quick_start.md).
dpranke0ae7cad2016-11-30 07:47:58149
amoylana960fa52016-12-09 22:47:28150### <a name="faster-builds"></a>Faster builds
dpranke0ae7cad2016-11-30 07:47:58151
dpranke2989a782016-12-02 02:57:12152This section contains some things you can change to speed up your builds,
153sorted so that the things that make the biggest difference are first.
154
Fumitoshi Ukaie15fd782019-10-15 05:52:48155#### Use Goma
156
157Google developed the distributed compiler called
158[Goma](https://chromium.googlesource.com/infra/goma/client).
Fumitoshi Ukaie15fd782019-10-15 05:52:48159
Yoshisato Yanagisawab66864e2021-03-11 21:22:48160If you would like to use `Goma` provisioned by Google,
161please follow [Goma for Chromium contributors](https://chromium.googlesource.com/infra/goma/client/+/HEAD/doc/early-access-guide.md).
Fumitoshi Ukaie15fd782019-10-15 05:52:48162
Yoshisato Yanagisawab66864e2021-03-11 21:22:48163If you are a Google employee, see
164[go/building-chrome](https://goto.google.com/building-chrome) instead.
Fumitoshi Ukaie15fd782019-10-15 05:52:48165
dpranke2989a782016-12-02 02:57:12166#### Disable NaCl
167
168By default, the build includes support for
169[Native Client (NaCl)](https://developer.chrome.com/native-client), but
Victor Costan44af72b2017-11-13 20:01:30170most of the time you won't need it. You can set the GN argument
dpranke2989a782016-12-02 02:57:12171`enable_nacl=false` and it won't be built.
172
173#### Include fewer debug symbols
174
175By default GN produces a build with all of the debug assertions enabled
176(`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
177`symbol_level=1` will produce enough information for stack traces, but not
178line-by-line debugging. Setting `symbol_level=0` will include no debug
179symbols at all. Either will speed up the build compared to full symbols.
180
Bruce Dawson63e0be72021-11-29 20:34:41181#### Disable debug symbols for Blink and v8
dpranke2989a782016-12-02 02:57:12182
183Due to its extensive use of templates, the Blink code produces about half
184of our debug symbols. If you don't ever need to debug Blink, you can set
Bruce Dawson63e0be72021-11-29 20:34:41185the GN arg `blink_symbol_level=0`. Similarly, if you don't need to debug v8 you
186can improve build speeds by setting the GN arg `v8_symbol_level=0`.
dpranke2989a782016-12-02 02:57:12187
188#### Use Icecc
189
190[Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
191central scheduler to share build load. Currently, many external contributors use
Fumitoshi Ukaie15fd782019-10-15 05:52:48192it. e.g. Intel, Opera, Samsung (this is not useful if you're using Goma).
dpranke2989a782016-12-02 02:57:12193
194In order to use `icecc`, set the following GN args:
195
196```
dpranke2989a782016-12-02 02:57:12197use_debug_fission=false
198is_clang=false
dpranke2989a782016-12-02 02:57:12199```
200
Victor Costan44af72b2017-11-13 20:01:30201See these links for more on the
dpranke2989a782016-12-02 02:57:12202[bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92),
203the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
204
205Using the system linker may also be necessary when using glibc 2.21 or newer.
206See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
207
208#### ccache
209
David Sandersddc9a7f2022-01-28 03:19:19210You can use [ccache](https://ccache.dev) to speed up local builds (again,
Fumitoshi Ukaie15fd782019-10-15 05:52:48211this is not useful if you're using Goma).
dpranke2989a782016-12-02 02:57:12212
213Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
214that the working directories all have in common (e.g.,
215`/home/yourusername/development`). Consider using
216`CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
217directories, header times in svn sync'ed portions of your trees will be
218different - see
David Sandersddc9a7f2022-01-28 03:19:19219[the ccache troubleshooting section](https://ccache.dev/manual/latest.html#_troubleshooting)
dpranke2989a782016-12-02 02:57:12220for additional information). If you use symbolic links from your home directory
221to get to the local physical disk directory where you keep those working
222development directories, consider putting
223
224 alias cd="cd -P"
225
226in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
227logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
228parent).
229
230If you tune ccache correctly, a second working directory that uses a branch
231tracking trunk and is up to date with trunk and was gclient sync'ed at about the
232same time should build chrome in about 1/3 the time, and the cache misses as
233reported by `ccache -s` should barely increase.
234
Song Fangzhen4b68a6e32021-07-14 05:53:40235This is especially useful if you use
236[git-worktree](http://git-scm.com/docs/git-worktree) and keep multiple local
dpranke2989a782016-12-02 02:57:12237working directories going at once.
238
239#### Using tmpfs
240
241You can use tmpfs for the build output to reduce the amount of disk writes
242required. I.e. mount tmpfs to the output directory where the build output goes:
243
244As root:
245
246 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
247
248*** note
249**Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
250debug build, you will need about 20 GB. Less for just building the chrome target
251or for a release build.
252***
253
254Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
255hyperthreaded, 12 GB RAM)
256
257* With tmpfs:
258 * 12m:20s
259* Without tmpfs
260 * 15m:40s
261
Bruce Dawsonbe823202022-03-10 23:40:50262### Smaller builds
263
264The Chrome binary contains embedded symbols by default. You can reduce its size
265by using the Linux `strip` command to remove this debug information. You can
Peter Boström38748962023-05-08 21:24:26266also reduce binary size and turn on all optimizations by enabling official build
267mode, with the GN arg `is_official_build = true`.
Bruce Dawsonbe823202022-03-10 23:40:50268
dpranke0ae7cad2016-11-30 07:47:58269## Build Chromium
270
271Build Chromium (the "chrome" target) with Ninja using the command:
272
sdy93387fa2016-12-01 01:03:44273```shell
Max Morozf5b31fcd2018-08-10 21:55:48274$ autoninja -C out/Default chrome
sdy93387fa2016-12-01 01:03:44275```
dpranke0ae7cad2016-11-30 07:47:58276
Dirk Pranke8bd55f22018-10-24 21:22:10277(`autoninja` is a wrapper that automatically provides optimal values for the
278arguments passed to `ninja`.)
Max Morozf5b31fcd2018-08-10 21:55:48279
sdy93387fa2016-12-01 01:03:44280You can get a list of all of the other build targets from GN by running `gn ls
281out/Default` from the command line. To compile one, pass the GN label to Ninja
Max Morozf5b31fcd2018-08-10 21:55:48282with no preceding "//" (so, for `//chrome/test:unit_tests` use `autoninja -C
sdy93387fa2016-12-01 01:03:44283out/Default chrome/test:unit_tests`).
dpranke0ae7cad2016-11-30 07:47:58284
285## Run Chromium
286
287Once it is built, you can simply run the browser:
288
sdy93387fa2016-12-01 01:03:44289```shell
290$ out/Default/chrome
291```
dpranke0ae7cad2016-11-30 07:47:58292
Victor Viannaeda6fcc42023-03-14 17:18:22293If you're using a remote machine that supports Chrome Remote Desktop, you can
294add this to your .bashrc / .bash_profile.
295
296```shell
297if [[ -z "${DISPLAY}" ]]; then
298 export DISPLAY=:$(
299 find /tmp/.X11-unix -maxdepth 1 -mindepth 1 -name 'X*' |
300 grep -o '[0-9]\+$' | head -n 1
301 )
302fi
303```
304
305This means if you launch Chrome from an SSH session, the UI output will be
306available in Chrome Remote Desktop.
307
dpranke0ae7cad2016-11-30 07:47:58308## Running test targets
309
Andrew Williamsfa9b7d62023-03-20 15:48:28310Tests are split into multiple test targets based on their type and where they
311exist in the directory structure. To see what target a given unit test or
312browser test file corresponds to, the following command can be used:
313
314```shell
315$ gn refs out/Default --testonly=true --type=executable --all chrome/browser/ui/browser_list_unittest.cc
316//chrome/test:unit_tests
317```
318
319In the example above, the target is unit_tests. The unit_tests binary can be
320built by running the following command:
Fred Shih865fb8f2022-02-03 03:54:19321
322```shell
323$ autoninja -C out/Default unit_tests
324```
325
326You can run the tests by running the unit_tests binary. You can also limit which
327tests are run using the `--gtest_filter` arg, e.g.:
dpranke0ae7cad2016-11-30 07:47:58328
sdy93387fa2016-12-01 01:03:44329```shell
Andrew Williamsfa9b7d62023-03-20 15:48:28330$ out/Default/unit_tests --gtest_filter="BrowserListUnitTest.*"
sdy93387fa2016-12-01 01:03:44331```
dpranke0ae7cad2016-11-30 07:47:58332
333You can find out more about GoogleTest at its
334[GitHub page](https://github.com/google/googletest).
335
336## Update your checkout
337
338To update an existing checkout, you can run
339
sdy93387fa2016-12-01 01:03:44340```shell
341$ git rebase-update
342$ gclient sync
343```
dpranke0ae7cad2016-11-30 07:47:58344
345The first command updates the primary Chromium source repository and rebases
sdy93387fa2016-12-01 01:03:44346any of your local branches on top of tip-of-tree (aka the Git branch
Andrew Williamsbbc1a1e2021-07-21 01:51:22347`origin/main`). If you don't want to use this script, you can also just use
sdy93387fa2016-12-01 01:03:44348`git pull` or other common Git commands to update the repo.
dpranke0ae7cad2016-11-30 07:47:58349
sdy93387fa2016-12-01 01:03:44350The second command syncs dependencies to the appropriate versions and re-runs
351hooks as needed.
dpranke0ae7cad2016-11-30 07:47:58352
353## Tips, tricks, and troubleshooting
andybons3322f762015-08-24 21:37:09354
355### Linker Crashes
andybonsad92aa32015-08-31 02:27:44356
andybons3322f762015-08-24 21:37:09357If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44358
sdy93387fa2016-12-01 01:03:44359```
360LINK out/Debug/chrome
361```
andybonsad92aa32015-08-31 02:27:44362
andybons3322f762015-08-24 21:37:09363You get an error like:
andybons3322f762015-08-24 21:37:09364
sdy93387fa2016-12-01 01:03:44365```
366collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
367collect2: ld terminated with signal 11 [Segmentation fault], core dumped
368```
andybonsad92aa32015-08-31 02:27:44369
Song Qinglin5ac3cf922022-11-09 04:12:22370or:
371
372```
373LLVM ERROR: out of memory
374```
375
brettwc25693b32016-05-26 01:11:52376you are probably running out of memory when linking. You *must* use a 64-bit
377system to build. Try the following build settings (see [GN build
378configuration](https://www.chromium.org/developers/gn-build-configuration) for
sdy93387fa2016-12-01 01:03:44379other settings):
andybonsad92aa32015-08-31 02:27:44380
sdy93387fa2016-12-01 01:03:44381* Build in release mode (debugging symbols require more memory):
brettwc25693b32016-05-26 01:11:52382 `is_debug = false`
sdy93387fa2016-12-01 01:03:44383* Turn off symbols: `symbol_level = 0`
384* Build in component mode (this is for development only, it will be slower and
385 may have broken functionality): `is_component_build = true`
Song Qinglin5ac3cf922022-11-09 04:12:22386* For official (ThinLTO) builds on Linux, increase the vm.max_map_count kernel
387 parameter: increase the `vm.max_map_count` value from default (like 65530)
388 to for example 262144. You can run the `sudo sysctl -w vm.max_map_count=262144`
389 command to set it in the current session from the shell, or add the
390 `vm.max_map_count=262144` to /etc/sysctl.conf to save it permanently.
andybons3322f762015-08-24 21:37:09391
dpranke0ae7cad2016-11-30 07:47:58392### More links
andybons3322f762015-08-24 21:37:09393
Nicolas Norvezba040062020-01-15 01:17:26394* Information about [building with Clang](../clang.md).
Tom Andersonabdbd6a2020-01-09 16:59:27395* You may want to [use a chroot](using_a_chroot.md) to
dpranke0ae7cad2016-11-30 07:47:58396 isolate yourself from versioning or packaging conflicts.
Tom Anderson93e49e492019-12-23 19:55:37397* Cross-compiling for ARM? See [LinuxChromiumArm](chromium_arm.md).
andybonsad92aa32015-08-31 02:27:44398* Want to use Eclipse as your IDE? See
Tom Anderson93e49e492019-12-23 19:55:37399 [LinuxEclipseDev](eclipse_dev.md).
dpranke0ae7cad2016-11-30 07:47:58400* Want to use your built version as your default browser? See
Tom Anderson93e49e492019-12-23 19:55:37401 [LinuxDevBuildAsDefaultBrowser](dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09402
dpranke2989a782016-12-02 02:57:12403## Next Steps
andybonsad92aa32015-08-31 02:27:44404
405If you want to contribute to the effort toward a Chromium-based browser for
Tom Anderson93e49e492019-12-23 19:55:37406Linux, please check out the [Linux Development page](development.md) for
andybonsad92aa32015-08-31 02:27:44407more information.
dpranke2989a782016-12-02 02:57:12408
409## Notes for other distros <a name="notes"></a>
410
411### Arch Linux
412
413Instead of running `install-build-deps.sh` to install build dependencies, run:
414
415```shell
416$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
Tom Anderson761687a2023-06-14 17:27:39417nss alsa-lib glib2 gtk3 nspr freetype2 cairo dbus xorg-server-xvfb \
418xorg-xdpyinfo
dpranke2989a782016-12-02 02:57:12419```
420
421For the optional packages on Arch Linux:
422
423* `php-cgi` is provided with `pacman`
424* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
425 in AUR/`yaourt`
dpranke2989a782016-12-02 02:57:12426
Kenneth Russell56293772018-09-21 01:46:15427### Crostini (Debian based)
428
David Munro9b5f4c4f2019-07-24 08:23:27429First install the `file` and `lsb-release` commands for the script to run properly:
Kenneth Russell56293772018-09-21 01:46:15430
431```shell
David Munro9b5f4c4f2019-07-24 08:23:27432$ sudo apt-get install file lsb-release
Kenneth Russell56293772018-09-21 01:46:15433```
434
435Then invoke install-build-deps.sh with the `--no-arm` argument,
436because the ARM toolchain doesn't exist for this configuration:
437
438```shell
439$ sudo install-build-deps.sh --no-arm
440```
441
dpranke2989a782016-12-02 02:57:12442### Fedora
443
444Instead of running `build/install-build-deps.sh`, run:
445
446```shell
447su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
448bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
449cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
Tom Anderson287339e2018-08-22 21:52:02450freetype-devel gcc-c++ glib2-devel glibc.i686 gperf glib2-devel \
Tim Brown36312fc2017-12-15 22:56:20451gtk3-devel java-1.*.0-openjdk-devel libatomic libcap-devel libffi-devel \
Tom Anderson761687a2023-06-14 17:27:39452libgcc.i686 libjpeg-devel libstdc++.i686 libX11-devel libXScrnSaver-devel \
453libXtst-devel libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel \
454pam-devel pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd \
455mod_ssl php php-cli python-psutil wdiff xorg-x11-server-Xvfb'
dpranke2989a782016-12-02 02:57:12456```
457
Kent Tamura59ffb022018-11-27 05:30:56458The fonts needed by Blink's web tests can be obtained by following [these
Victor Costan44af72b2017-11-13 20:01:30459instructions](https://gist.github.com/pwnall/32a3b11c2b10f6ae5c6a6de66c1e12ae).
460For the optional packages:
dpranke2989a782016-12-02 02:57:12461
462* `php-cgi` is provided by the `php-cli` package.
Victor Costan44af72b2017-11-13 20:01:30463* `sun-java6-fonts` is covered by the instructions linked above.
dpranke2989a782016-12-02 02:57:12464
465### Gentoo
466
467You can just run `emerge www-client/chromium`.
468
dpranke2989a782016-12-02 02:57:12469### OpenSUSE
470
471Use `zypper` command to install dependencies:
472
473(openSUSE 11.1 and higher)
474
475```shell
Tim Brown36312fc2017-12-15 22:56:20476sudo zypper in subversion pkg-config python perl bison flex gperf \
477 mozilla-nss-devel glib2-devel gtk-devel wdiff lighttpd gcc gcc-c++ \
478 mozilla-nspr mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
dpranke2989a782016-12-02 02:57:12479 libjpeg-devel libbz2-devel
480```
481
482For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
Tom Anderson287339e2018-08-22 21:52:02483`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`.
dpranke2989a782016-12-02 02:57:12484
485(openSUSE 11.0)
486
487```shell
488sudo zypper in subversion pkg-config python perl \
489 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
490 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
Tom Anderson287339e2018-08-22 21:52:02491 php5-cgi alsa-devel gtk3-devel jpeg-devel
dpranke2989a782016-12-02 02:57:12492```
493
494The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
495Since this package requires Java as a prerequisite anyway, we can do the same
496thing by just installing the equivalent openSUSE Sun Java package:
497
498```shell
499sudo zypper in java-1_6_0-sun
500```
501
502WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
503
504```shell
505sudo zypper in fetchmsttfonts pullin-msttf-fonts
506```
507
508To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
509create symlinks to the appropriate locations:
510
511```shell
512sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
513sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
514sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
515sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
516sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
517sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
518sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
519sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
520sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
521sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
522sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
523sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
524sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
525sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
526sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
527sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
528sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
529sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
530sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
531sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
532```
533
534The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
535Since this package requires Java as a prerequisite anyway, we can do the same
536thing by just installing the equivalent openSUSE Sun Java package:
537
538```shell
539sudo zypper in java-1_6_0-sun
540```
541
542WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
543
544```shell
545sudo zypper in fetchmsttfonts pullin-msttf-fonts
546```
547
548To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
549create symlinks to the appropriate locations:
550
551```shell
552sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
553sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
554sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
555sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
556sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
557sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
558sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
559sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
560sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
561sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
562sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
563sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
564sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
565sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
566sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
567sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
568sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
569sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
570sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
571sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
572```
573
574And then for the Java fonts:
575
576```shell
577sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
578sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
579 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
580```