blob: c1943042fe2ed076230c967931f09871f21bce08 [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
Johann112b198b2021-07-01 00:25:3321Most development is done on Ubuntu (currently 18.04, Bionic Beaver). There are
dpranke0ae7cad2016-11-30 07:47:5822some instructions for other distros below, but they are mostly unsupported.
andybons3322f762015-08-24 21:37:0923
Brian Sheedycadbcd22022-11-09 23:50:1524### Docker requirements
25
26While it is not a common setup, Chromium compilation should work from within a
27Docker container. If you choose to compile from within a container for whatever
28reason, you will need to make sure that the following tools are available:
29
30* `curl`
31* `git`
32* `lsb_release`
33* `python3`
34* `sudo`
35
36There may be additional Docker-specific issues during compilation. See
37[this bug](https://crbug.com/1377520) for additional details on this.
38
dpranke0ae7cad2016-11-30 07:47:5839## Install `depot_tools`
andybonsad92aa32015-08-31 02:27:4440
sdy93387fa2016-12-01 01:03:4441Clone the `depot_tools` repository:
andybons3322f762015-08-24 21:37:0942
sdy93387fa2016-12-01 01:03:4443```shell
44$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
45```
andybonsad92aa32015-08-31 02:27:4446
sdy93387fa2016-12-01 01:03:4447Add `depot_tools` to the end of your PATH (you will probably want to put this
48in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
49`/path/to/depot_tools`:
andybonsad92aa32015-08-31 02:27:4450
sdy93387fa2016-12-01 01:03:4451```shell
52$ export PATH="$PATH:/path/to/depot_tools"
53```
andybons3322f762015-08-24 21:37:0954
Claudio DeSouzaae44ac12018-02-13 16:11:4555When cloning `depot_tools` to your home directory **do not** use `~` on PATH,
56otherwise `gclient runhooks` will fail to run. Rather, you should use either
57`$HOME` or the absolute path:
58
59```shell
60$ export PATH="$PATH:${HOME}/depot_tools"
61```
62
dpranke0ae7cad2016-11-30 07:47:5863## Get the code
andybonsad92aa32015-08-31 02:27:4464
sdy93387fa2016-12-01 01:03:4465Create a `chromium` directory for the checkout and change to it (you can call
66this whatever you like and put it wherever you like, as long as the full path
67has no spaces):
68
69```shell
70$ mkdir ~/chromium && cd ~/chromium
71```
andybons3322f762015-08-24 21:37:0972
dpranke0ae7cad2016-11-30 07:47:5873Run the `fetch` tool from depot_tools to check out the code and its
74dependencies.
andybonsad92aa32015-08-31 02:27:4475
sdy93387fa2016-12-01 01:03:4476```shell
77$ fetch --nohooks chromium
78```
andybonsad92aa32015-08-31 02:27:4479
dpranke0ae7cad2016-11-30 07:47:5880If you don't want the full repo history, you can save a lot of time by
sdy93387fa2016-12-01 01:03:4481adding the `--no-history` flag to `fetch`.
andybons3322f762015-08-24 21:37:0982
dpranke0ae7cad2016-11-30 07:47:5883Expect the command to take 30 minutes on even a fast connection, and many
84hours on slower ones.
andybonsad92aa32015-08-31 02:27:4485
dpranke0ae7cad2016-11-30 07:47:5886If you've already installed the build dependencies on the machine (from another
sdy93387fa2016-12-01 01:03:4487checkout, for example), you can omit the `--nohooks` flag and `fetch`
dpranke0ae7cad2016-11-30 07:47:5888will automatically execute `gclient runhooks` at the end.
andybons3322f762015-08-24 21:37:0989
sdy93387fa2016-12-01 01:03:4490When `fetch` completes, it will have created a hidden `.gclient` file and a
91directory called `src` in the working directory. The remaining instructions
92assume you have switched to the `src` directory:
andybons3322f762015-08-24 21:37:0993
sdy93387fa2016-12-01 01:03:4494```shell
95$ cd src
96```
andybons3322f762015-08-24 21:37:0997
dpranke0ae7cad2016-11-30 07:47:5898### Install additional build dependencies
andybons3322f762015-08-24 21:37:0999
dpranke0ae7cad2016-11-30 07:47:58100Once you have checked out the code, and assuming you're using Ubuntu, run
101[build/install-build-deps.sh](/build/install-build-deps.sh)
andybons3322f762015-08-24 21:37:09102
Aaron Gable3bc93682019-01-11 02:16:07103```shell
104$ ./build/install-build-deps.sh
105```
106
dpranke2989a782016-12-02 02:57:12107You may need to adjust the build dependencies for other distros. There are
108some [notes](#notes) at the end of this document, but we make no guarantees
109for their accuracy.
andybonsad92aa32015-08-31 02:27:44110
dpranke0ae7cad2016-11-30 07:47:58111### Run the hooks
andybons3322f762015-08-24 21:37:09112
dpranke0ae7cad2016-11-30 07:47:58113Once you've run `install-build-deps` at least once, you can now run the
sdy93387fa2016-12-01 01:03:44114Chromium-specific hooks, which will download additional binaries and other
dpranke0ae7cad2016-11-30 07:47:58115things you might need:
andybonsad92aa32015-08-31 02:27:44116
sdy93387fa2016-12-01 01:03:44117```shell
118$ gclient runhooks
119```
andybonsad92aa32015-08-31 02:27:44120
sdy93387fa2016-12-01 01:03:44121*Optional*: You can also [install API
122keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
123build to talk to some Google services, but this is not necessary for most
124development and testing purposes.
andybons3322f762015-08-24 21:37:09125
dpranke1a70d0c2016-12-01 02:42:29126## Setting up the build
andybonsad92aa32015-08-31 02:27:44127
Tom Bridgwatereef401542018-08-17 00:54:43128Chromium uses [Ninja](https://ninja-build.org) as its main build tool along with
Andrew Williamsbbc1a1e2021-07-21 01:51:22129a tool called [GN](https://gn.googlesource.com/gn/+/main/docs/quick_start.md)
Tom Bridgwatereef401542018-08-17 00:54:43130to generate `.ninja` files. You can create any number of *build directories*
131with different configurations. To create a build directory, run:
andybons8c02a1f2015-09-04 17:02:32132
sdy93387fa2016-12-01 01:03:44133```shell
134$ gn gen out/Default
135```
dpranke0ae7cad2016-11-30 07:47:58136
sdy93387fa2016-12-01 01:03:44137* You only have to run this once for each new build directory, Ninja will
138 update the build files as needed.
139* You can replace `Default` with another name, but
140 it should be a subdirectory of `out`.
141* For other build arguments, including release settings, see [GN build
142 configuration](https://www.chromium.org/developers/gn-build-configuration).
dpranke0ae7cad2016-11-30 07:47:58143 The default will be a debug component build matching the current host
144 operating system and CPU.
145* For more info on GN, run `gn help` on the command line or read the
Andrew Williamsbbc1a1e2021-07-21 01:51:22146 [quick start guide](https://gn.googlesource.com/gn/+/main/docs/quick_start.md).
dpranke0ae7cad2016-11-30 07:47:58147
amoylana960fa52016-12-09 22:47:28148### <a name="faster-builds"></a>Faster builds
dpranke0ae7cad2016-11-30 07:47:58149
dpranke2989a782016-12-02 02:57:12150This section contains some things you can change to speed up your builds,
151sorted so that the things that make the biggest difference are first.
152
Fumitoshi Ukaie15fd782019-10-15 05:52:48153#### Use Goma
154
155Google developed the distributed compiler called
156[Goma](https://chromium.googlesource.com/infra/goma/client).
Fumitoshi Ukaie15fd782019-10-15 05:52:48157
Yoshisato Yanagisawab66864e2021-03-11 21:22:48158If you would like to use `Goma` provisioned by Google,
159please follow [Goma for Chromium contributors](https://chromium.googlesource.com/infra/goma/client/+/HEAD/doc/early-access-guide.md).
Fumitoshi Ukaie15fd782019-10-15 05:52:48160
Yoshisato Yanagisawab66864e2021-03-11 21:22:48161If you are a Google employee, see
162[go/building-chrome](https://goto.google.com/building-chrome) instead.
Fumitoshi Ukaie15fd782019-10-15 05:52:48163
dpranke2989a782016-12-02 02:57:12164#### Disable NaCl
165
166By default, the build includes support for
167[Native Client (NaCl)](https://developer.chrome.com/native-client), but
Victor Costan44af72b2017-11-13 20:01:30168most of the time you won't need it. You can set the GN argument
dpranke2989a782016-12-02 02:57:12169`enable_nacl=false` and it won't be built.
170
171#### Include fewer debug symbols
172
173By default GN produces a build with all of the debug assertions enabled
174(`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
175`symbol_level=1` will produce enough information for stack traces, but not
176line-by-line debugging. Setting `symbol_level=0` will include no debug
177symbols at all. Either will speed up the build compared to full symbols.
178
Bruce Dawson63e0be72021-11-29 20:34:41179#### Disable debug symbols for Blink and v8
dpranke2989a782016-12-02 02:57:12180
181Due to its extensive use of templates, the Blink code produces about half
182of our debug symbols. If you don't ever need to debug Blink, you can set
Bruce Dawson63e0be72021-11-29 20:34:41183the GN arg `blink_symbol_level=0`. Similarly, if you don't need to debug v8 you
184can improve build speeds by setting the GN arg `v8_symbol_level=0`.
dpranke2989a782016-12-02 02:57:12185
186#### Use Icecc
187
188[Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
189central scheduler to share build load. Currently, many external contributors use
Fumitoshi Ukaie15fd782019-10-15 05:52:48190it. e.g. Intel, Opera, Samsung (this is not useful if you're using Goma).
dpranke2989a782016-12-02 02:57:12191
192In order to use `icecc`, set the following GN args:
193
194```
dpranke2989a782016-12-02 02:57:12195use_debug_fission=false
196is_clang=false
dpranke2989a782016-12-02 02:57:12197```
198
Victor Costan44af72b2017-11-13 20:01:30199See these links for more on the
dpranke2989a782016-12-02 02:57:12200[bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92),
201the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
202
203Using the system linker may also be necessary when using glibc 2.21 or newer.
204See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
205
206#### ccache
207
David Sandersddc9a7f2022-01-28 03:19:19208You can use [ccache](https://ccache.dev) to speed up local builds (again,
Fumitoshi Ukaie15fd782019-10-15 05:52:48209this is not useful if you're using Goma).
dpranke2989a782016-12-02 02:57:12210
211Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
212that the working directories all have in common (e.g.,
213`/home/yourusername/development`). Consider using
214`CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
215directories, header times in svn sync'ed portions of your trees will be
216different - see
David Sandersddc9a7f2022-01-28 03:19:19217[the ccache troubleshooting section](https://ccache.dev/manual/latest.html#_troubleshooting)
dpranke2989a782016-12-02 02:57:12218for additional information). If you use symbolic links from your home directory
219to get to the local physical disk directory where you keep those working
220development directories, consider putting
221
222 alias cd="cd -P"
223
224in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
225logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
226parent).
227
228If you tune ccache correctly, a second working directory that uses a branch
229tracking trunk and is up to date with trunk and was gclient sync'ed at about the
230same time should build chrome in about 1/3 the time, and the cache misses as
231reported by `ccache -s` should barely increase.
232
Song Fangzhen4b68a6e32021-07-14 05:53:40233This is especially useful if you use
234[git-worktree](http://git-scm.com/docs/git-worktree) and keep multiple local
dpranke2989a782016-12-02 02:57:12235working directories going at once.
236
237#### Using tmpfs
238
239You can use tmpfs for the build output to reduce the amount of disk writes
240required. I.e. mount tmpfs to the output directory where the build output goes:
241
242As root:
243
244 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
245
246*** note
247**Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
248debug build, you will need about 20 GB. Less for just building the chrome target
249or for a release build.
250***
251
252Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
253hyperthreaded, 12 GB RAM)
254
255* With tmpfs:
256 * 12m:20s
257* Without tmpfs
258 * 15m:40s
259
Bruce Dawsonbe823202022-03-10 23:40:50260### Smaller builds
261
262The Chrome binary contains embedded symbols by default. You can reduce its size
263by using the Linux `strip` command to remove this debug information. You can
264also reduce binary size by disabling debug mode, disabling dchecks, and turning
265on all optimizations by enabling official build mode, with these GN args:
266
267```
268is_debug = false
269dcheck_always_on = false
270is_official_build = true
271```
272
dpranke0ae7cad2016-11-30 07:47:58273## Build Chromium
274
275Build Chromium (the "chrome" target) with Ninja using the command:
276
sdy93387fa2016-12-01 01:03:44277```shell
Max Morozf5b31fcd2018-08-10 21:55:48278$ autoninja -C out/Default chrome
sdy93387fa2016-12-01 01:03:44279```
dpranke0ae7cad2016-11-30 07:47:58280
Dirk Pranke8bd55f22018-10-24 21:22:10281(`autoninja` is a wrapper that automatically provides optimal values for the
282arguments passed to `ninja`.)
Max Morozf5b31fcd2018-08-10 21:55:48283
sdy93387fa2016-12-01 01:03:44284You can get a list of all of the other build targets from GN by running `gn ls
285out/Default` from the command line. To compile one, pass the GN label to Ninja
Max Morozf5b31fcd2018-08-10 21:55:48286with no preceding "//" (so, for `//chrome/test:unit_tests` use `autoninja -C
sdy93387fa2016-12-01 01:03:44287out/Default chrome/test:unit_tests`).
dpranke0ae7cad2016-11-30 07:47:58288
289## Run Chromium
290
291Once it is built, you can simply run the browser:
292
sdy93387fa2016-12-01 01:03:44293```shell
294$ out/Default/chrome
295```
dpranke0ae7cad2016-11-30 07:47:58296
297## Running test targets
298
Fred Shih865fb8f2022-02-03 03:54:19299First build the unit_tests binary by running the command:
300
301```shell
302$ autoninja -C out/Default unit_tests
303```
304
305You can run the tests by running the unit_tests binary. You can also limit which
306tests are run using the `--gtest_filter` arg, e.g.:
dpranke0ae7cad2016-11-30 07:47:58307
sdy93387fa2016-12-01 01:03:44308```shell
dpranke1a70d0c2016-12-01 02:42:29309$ out/Default/unit_tests --gtest_filter="PushClientTest.*"
sdy93387fa2016-12-01 01:03:44310```
dpranke0ae7cad2016-11-30 07:47:58311
312You can find out more about GoogleTest at its
313[GitHub page](https://github.com/google/googletest).
314
315## Update your checkout
316
317To update an existing checkout, you can run
318
sdy93387fa2016-12-01 01:03:44319```shell
320$ git rebase-update
321$ gclient sync
322```
dpranke0ae7cad2016-11-30 07:47:58323
324The first command updates the primary Chromium source repository and rebases
sdy93387fa2016-12-01 01:03:44325any of your local branches on top of tip-of-tree (aka the Git branch
Andrew Williamsbbc1a1e2021-07-21 01:51:22326`origin/main`). If you don't want to use this script, you can also just use
sdy93387fa2016-12-01 01:03:44327`git pull` or other common Git commands to update the repo.
dpranke0ae7cad2016-11-30 07:47:58328
sdy93387fa2016-12-01 01:03:44329The second command syncs dependencies to the appropriate versions and re-runs
330hooks as needed.
dpranke0ae7cad2016-11-30 07:47:58331
332## Tips, tricks, and troubleshooting
andybons3322f762015-08-24 21:37:09333
334### Linker Crashes
andybonsad92aa32015-08-31 02:27:44335
andybons3322f762015-08-24 21:37:09336If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44337
sdy93387fa2016-12-01 01:03:44338```
339LINK out/Debug/chrome
340```
andybonsad92aa32015-08-31 02:27:44341
andybons3322f762015-08-24 21:37:09342You get an error like:
andybons3322f762015-08-24 21:37:09343
sdy93387fa2016-12-01 01:03:44344```
345collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
346collect2: ld terminated with signal 11 [Segmentation fault], core dumped
347```
andybonsad92aa32015-08-31 02:27:44348
Song Qinglin5ac3cf922022-11-09 04:12:22349or:
350
351```
352LLVM ERROR: out of memory
353```
354
brettwc25693b32016-05-26 01:11:52355you are probably running out of memory when linking. You *must* use a 64-bit
356system to build. Try the following build settings (see [GN build
357configuration](https://www.chromium.org/developers/gn-build-configuration) for
sdy93387fa2016-12-01 01:03:44358other settings):
andybonsad92aa32015-08-31 02:27:44359
sdy93387fa2016-12-01 01:03:44360* Build in release mode (debugging symbols require more memory):
brettwc25693b32016-05-26 01:11:52361 `is_debug = false`
sdy93387fa2016-12-01 01:03:44362* Turn off symbols: `symbol_level = 0`
363* Build in component mode (this is for development only, it will be slower and
364 may have broken functionality): `is_component_build = true`
Song Qinglin5ac3cf922022-11-09 04:12:22365* For official (ThinLTO) builds on Linux, increase the vm.max_map_count kernel
366 parameter: increase the `vm.max_map_count` value from default (like 65530)
367 to for example 262144. You can run the `sudo sysctl -w vm.max_map_count=262144`
368 command to set it in the current session from the shell, or add the
369 `vm.max_map_count=262144` to /etc/sysctl.conf to save it permanently.
andybons3322f762015-08-24 21:37:09370
dpranke0ae7cad2016-11-30 07:47:58371### More links
andybons3322f762015-08-24 21:37:09372
Nicolas Norvezba040062020-01-15 01:17:26373* Information about [building with Clang](../clang.md).
Tom Andersonabdbd6a2020-01-09 16:59:27374* You may want to [use a chroot](using_a_chroot.md) to
dpranke0ae7cad2016-11-30 07:47:58375 isolate yourself from versioning or packaging conflicts.
Tom Anderson93e49e492019-12-23 19:55:37376* Cross-compiling for ARM? See [LinuxChromiumArm](chromium_arm.md).
andybonsad92aa32015-08-31 02:27:44377* Want to use Eclipse as your IDE? See
Tom Anderson93e49e492019-12-23 19:55:37378 [LinuxEclipseDev](eclipse_dev.md).
dpranke0ae7cad2016-11-30 07:47:58379* Want to use your built version as your default browser? See
Tom Anderson93e49e492019-12-23 19:55:37380 [LinuxDevBuildAsDefaultBrowser](dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09381
dpranke2989a782016-12-02 02:57:12382## Next Steps
andybonsad92aa32015-08-31 02:27:44383
384If you want to contribute to the effort toward a Chromium-based browser for
Tom Anderson93e49e492019-12-23 19:55:37385Linux, please check out the [Linux Development page](development.md) for
andybonsad92aa32015-08-31 02:27:44386more information.
dpranke2989a782016-12-02 02:57:12387
388## Notes for other distros <a name="notes"></a>
389
390### Arch Linux
391
392Instead of running `install-build-deps.sh` to install build dependencies, run:
393
394```shell
395$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
Timothy Gufe67f0b2021-05-20 22:07:04396nss alsa-lib glib2 gtk3 nspr freetype2 cairo dbus libgnome-keyring \
397xorg-server-xvfb xorg-xdpyinfo
dpranke2989a782016-12-02 02:57:12398```
399
400For the optional packages on Arch Linux:
401
402* `php-cgi` is provided with `pacman`
403* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
404 in AUR/`yaourt`
dpranke2989a782016-12-02 02:57:12405
Kenneth Russell56293772018-09-21 01:46:15406### Crostini (Debian based)
407
David Munro9b5f4c4f2019-07-24 08:23:27408First install the `file` and `lsb-release` commands for the script to run properly:
Kenneth Russell56293772018-09-21 01:46:15409
410```shell
David Munro9b5f4c4f2019-07-24 08:23:27411$ sudo apt-get install file lsb-release
Kenneth Russell56293772018-09-21 01:46:15412```
413
414Then invoke install-build-deps.sh with the `--no-arm` argument,
415because the ARM toolchain doesn't exist for this configuration:
416
417```shell
418$ sudo install-build-deps.sh --no-arm
419```
420
dpranke2989a782016-12-02 02:57:12421### Fedora
422
423Instead of running `build/install-build-deps.sh`, run:
424
425```shell
426su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
427bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
428cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
Tom Anderson287339e2018-08-22 21:52:02429freetype-devel gcc-c++ glib2-devel glibc.i686 gperf glib2-devel \
Tim Brown36312fc2017-12-15 22:56:20430gtk3-devel java-1.*.0-openjdk-devel libatomic libcap-devel libffi-devel \
431libgcc.i686 libgnome-keyring-devel libjpeg-devel libstdc++.i686 libX11-devel \
432libXScrnSaver-devel libXtst-devel libxkbcommon-x11-devel ncurses-compat-libs \
433nspr-devel nss-devel pam-devel pango-devel pciutils-devel \
434pulseaudio-libs-devel zlib.i686 httpd mod_ssl php php-cli python-psutil wdiff \
435xorg-x11-server-Xvfb'
dpranke2989a782016-12-02 02:57:12436```
437
Kent Tamura59ffb022018-11-27 05:30:56438The fonts needed by Blink's web tests can be obtained by following [these
Victor Costan44af72b2017-11-13 20:01:30439instructions](https://gist.github.com/pwnall/32a3b11c2b10f6ae5c6a6de66c1e12ae).
440For the optional packages:
dpranke2989a782016-12-02 02:57:12441
442* `php-cgi` is provided by the `php-cli` package.
Victor Costan44af72b2017-11-13 20:01:30443* `sun-java6-fonts` is covered by the instructions linked above.
dpranke2989a782016-12-02 02:57:12444
445### Gentoo
446
447You can just run `emerge www-client/chromium`.
448
dpranke2989a782016-12-02 02:57:12449### OpenSUSE
450
451Use `zypper` command to install dependencies:
452
453(openSUSE 11.1 and higher)
454
455```shell
Tim Brown36312fc2017-12-15 22:56:20456sudo zypper in subversion pkg-config python perl bison flex gperf \
457 mozilla-nss-devel glib2-devel gtk-devel wdiff lighttpd gcc gcc-c++ \
458 mozilla-nspr mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
dpranke2989a782016-12-02 02:57:12459 libjpeg-devel libbz2-devel
460```
461
462For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
Tom Anderson287339e2018-08-22 21:52:02463`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`.
dpranke2989a782016-12-02 02:57:12464
465(openSUSE 11.0)
466
467```shell
468sudo zypper in subversion pkg-config python perl \
469 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
470 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
Tom Anderson287339e2018-08-22 21:52:02471 php5-cgi alsa-devel gtk3-devel jpeg-devel
dpranke2989a782016-12-02 02:57:12472```
473
474The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
475Since this package requires Java as a prerequisite anyway, we can do the same
476thing by just installing the equivalent openSUSE Sun Java package:
477
478```shell
479sudo zypper in java-1_6_0-sun
480```
481
482WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
483
484```shell
485sudo zypper in fetchmsttfonts pullin-msttf-fonts
486```
487
488To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
489create symlinks to the appropriate locations:
490
491```shell
492sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
493sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
494sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
495sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
496sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
497sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
498sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
499sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
500sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
501sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
502sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
503sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
504sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
505sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
506sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
507sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
508sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
509sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
510sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
511sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
512```
513
514The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
515Since this package requires Java as a prerequisite anyway, we can do the same
516thing by just installing the equivalent openSUSE Sun Java package:
517
518```shell
519sudo zypper in java-1_6_0-sun
520```
521
522WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
523
524```shell
525sudo zypper in fetchmsttfonts pullin-msttf-fonts
526```
527
528To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
529create symlinks to the appropriate locations:
530
531```shell
532sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
533sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
534sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
535sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
536sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
537sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
538sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
539sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
540sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
541sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
542sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
543sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
544sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
545sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
546sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
547sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
548sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
549sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
550sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
551sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
552```
553
554And then for the Java fonts:
555
556```shell
557sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
558sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
559 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
560```