blob: f7dc410f0b882a1ab60c70671543e5fedef15c15 [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
dpranke1a70d0c2016-12-01 02:42:294[get the code](get_the_code.md) page.
5
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.
18* You must have Git and Python installed already.
andybons3322f762015-08-24 21:37:0919
sdy93387fa2016-12-01 01:03:4420Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are
dpranke0ae7cad2016-11-30 07:47:5821some instructions for other distros below, but they are mostly unsupported.
andybons3322f762015-08-24 21:37:0922
dpranke0ae7cad2016-11-30 07:47:5823## Install `depot_tools`
andybonsad92aa32015-08-31 02:27:4424
sdy93387fa2016-12-01 01:03:4425Clone the `depot_tools` repository:
andybons3322f762015-08-24 21:37:0926
sdy93387fa2016-12-01 01:03:4427```shell
28$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
29```
andybonsad92aa32015-08-31 02:27:4430
sdy93387fa2016-12-01 01:03:4431Add `depot_tools` to the end of your PATH (you will probably want to put this
32in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to
33`/path/to/depot_tools`:
andybonsad92aa32015-08-31 02:27:4434
sdy93387fa2016-12-01 01:03:4435```shell
36$ export PATH="$PATH:/path/to/depot_tools"
37```
andybons3322f762015-08-24 21:37:0938
Claudio DeSouzaae44ac12018-02-13 16:11:4539When cloning `depot_tools` to your home directory **do not** use `~` on PATH,
40otherwise `gclient runhooks` will fail to run. Rather, you should use either
41`$HOME` or the absolute path:
42
43```shell
44$ export PATH="$PATH:${HOME}/depot_tools"
45```
46
dpranke0ae7cad2016-11-30 07:47:5847## Get the code
andybonsad92aa32015-08-31 02:27:4448
sdy93387fa2016-12-01 01:03:4449Create a `chromium` directory for the checkout and change to it (you can call
50this whatever you like and put it wherever you like, as long as the full path
51has no spaces):
52
53```shell
54$ mkdir ~/chromium && cd ~/chromium
55```
andybons3322f762015-08-24 21:37:0956
dpranke0ae7cad2016-11-30 07:47:5857Run the `fetch` tool from depot_tools to check out the code and its
58dependencies.
andybonsad92aa32015-08-31 02:27:4459
sdy93387fa2016-12-01 01:03:4460```shell
61$ fetch --nohooks chromium
62```
andybonsad92aa32015-08-31 02:27:4463
dpranke0ae7cad2016-11-30 07:47:5864If you don't want the full repo history, you can save a lot of time by
sdy93387fa2016-12-01 01:03:4465adding the `--no-history` flag to `fetch`.
andybons3322f762015-08-24 21:37:0966
dpranke0ae7cad2016-11-30 07:47:5867Expect the command to take 30 minutes on even a fast connection, and many
68hours on slower ones.
andybonsad92aa32015-08-31 02:27:4469
dpranke0ae7cad2016-11-30 07:47:5870If you've already installed the build dependencies on the machine (from another
sdy93387fa2016-12-01 01:03:4471checkout, for example), you can omit the `--nohooks` flag and `fetch`
dpranke0ae7cad2016-11-30 07:47:5872will automatically execute `gclient runhooks` at the end.
andybons3322f762015-08-24 21:37:0973
sdy93387fa2016-12-01 01:03:4474When `fetch` completes, it will have created a hidden `.gclient` file and a
75directory called `src` in the working directory. The remaining instructions
76assume you have switched to the `src` directory:
andybons3322f762015-08-24 21:37:0977
sdy93387fa2016-12-01 01:03:4478```shell
79$ cd src
80```
andybons3322f762015-08-24 21:37:0981
dpranke0ae7cad2016-11-30 07:47:5882### Install additional build dependencies
andybons3322f762015-08-24 21:37:0983
dpranke0ae7cad2016-11-30 07:47:5884Once you have checked out the code, and assuming you're using Ubuntu, run
85[build/install-build-deps.sh](/build/install-build-deps.sh)
andybons3322f762015-08-24 21:37:0986
dpranke2989a782016-12-02 02:57:1287You may need to adjust the build dependencies for other distros. There are
88some [notes](#notes) at the end of this document, but we make no guarantees
89for their accuracy.
andybonsad92aa32015-08-31 02:27:4490
dpranke0ae7cad2016-11-30 07:47:5891### Run the hooks
andybons3322f762015-08-24 21:37:0992
dpranke0ae7cad2016-11-30 07:47:5893Once you've run `install-build-deps` at least once, you can now run the
sdy93387fa2016-12-01 01:03:4494Chromium-specific hooks, which will download additional binaries and other
dpranke0ae7cad2016-11-30 07:47:5895things you might need:
andybonsad92aa32015-08-31 02:27:4496
sdy93387fa2016-12-01 01:03:4497```shell
98$ gclient runhooks
99```
andybonsad92aa32015-08-31 02:27:44100
sdy93387fa2016-12-01 01:03:44101*Optional*: You can also [install API
102keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
103build to talk to some Google services, but this is not necessary for most
104development and testing purposes.
andybons3322f762015-08-24 21:37:09105
dpranke1a70d0c2016-12-01 02:42:29106## Setting up the build
andybonsad92aa32015-08-31 02:27:44107
sdy93387fa2016-12-01 01:03:44108Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
109with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
110files. You can create any number of *build directories* with different
111configurations. To create a build directory, run:
andybons8c02a1f2015-09-04 17:02:32112
sdy93387fa2016-12-01 01:03:44113```shell
114$ gn gen out/Default
115```
dpranke0ae7cad2016-11-30 07:47:58116
sdy93387fa2016-12-01 01:03:44117* You only have to run this once for each new build directory, Ninja will
118 update the build files as needed.
119* You can replace `Default` with another name, but
120 it should be a subdirectory of `out`.
121* For other build arguments, including release settings, see [GN build
122 configuration](https://www.chromium.org/developers/gn-build-configuration).
dpranke0ae7cad2016-11-30 07:47:58123 The default will be a debug component build matching the current host
124 operating system and CPU.
125* For more info on GN, run `gn help` on the command line or read the
126 [quick start guide](../tools/gn/docs/quick_start.md).
127
amoylana960fa52016-12-09 22:47:28128### <a name="faster-builds"></a>Faster builds
dpranke0ae7cad2016-11-30 07:47:58129
dpranke2989a782016-12-02 02:57:12130This section contains some things you can change to speed up your builds,
131sorted so that the things that make the biggest difference are first.
132
Philip Rogerseb841682017-10-09 16:08:50133#### Jumbo/Unity builds
134
135Jumbo builds merge many translation units ("source files") and compile them
136together. Since a large portion of Chromium's code is in shared header files,
137this dramatically reduces the total amount of work needed. Check out the
138[Jumbo / Unity builds](jumbo.md) for more information.
139
140Enable jumbo builds by setting the GN arg `use_jumbo_build=true`.
141
dpranke2989a782016-12-02 02:57:12142#### Disable NaCl
143
144By default, the build includes support for
145[Native Client (NaCl)](https://developer.chrome.com/native-client), but
Victor Costan44af72b2017-11-13 20:01:30146most of the time you won't need it. You can set the GN argument
dpranke2989a782016-12-02 02:57:12147`enable_nacl=false` and it won't be built.
148
149#### Include fewer debug symbols
150
151By default GN produces a build with all of the debug assertions enabled
152(`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
153`symbol_level=1` will produce enough information for stack traces, but not
154line-by-line debugging. Setting `symbol_level=0` will include no debug
155symbols at all. Either will speed up the build compared to full symbols.
156
dpranke2989a782016-12-02 02:57:12157#### Disable debug symbols for Blink
158
159Due to its extensive use of templates, the Blink code produces about half
160of our debug symbols. If you don't ever need to debug Blink, you can set
161the GN arg `remove_webcore_debug_symbols=true`.
162
163#### Use Icecc
164
165[Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
166central scheduler to share build load. Currently, many external contributors use
167it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma).
168
169In order to use `icecc`, set the following GN args:
170
171```
172linux_use_bundled_binutils=false
173use_debug_fission=false
174is_clang=false
dpranke2989a782016-12-02 02:57:12175```
176
Victor Costan44af72b2017-11-13 20:01:30177See these links for more on the
dpranke2989a782016-12-02 02:57:12178[bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92),
179the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
180
181Using the system linker may also be necessary when using glibc 2.21 or newer.
182See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
183
184#### ccache
185
186You can use [ccache](https://ccache.samba.org) to speed up local builds (again,
Kush Sinhae6aa1d182017-11-20 13:56:53187this is not useful if you're a Googler using Goma).
dpranke2989a782016-12-02 02:57:12188
189Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
190that the working directories all have in common (e.g.,
191`/home/yourusername/development`). Consider using
192`CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
193directories, header times in svn sync'ed portions of your trees will be
194different - see
195[the ccache troubleshooting section](http://ccache.samba.org/manual.html#_troubleshooting)
196for additional information). If you use symbolic links from your home directory
197to get to the local physical disk directory where you keep those working
198development directories, consider putting
199
200 alias cd="cd -P"
201
202in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
203logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
204parent).
205
206If you tune ccache correctly, a second working directory that uses a branch
207tracking trunk and is up to date with trunk and was gclient sync'ed at about the
208same time should build chrome in about 1/3 the time, and the cache misses as
209reported by `ccache -s` should barely increase.
210
211This is especially useful if you use `git-new-workdir` and keep multiple local
212working directories going at once.
213
214#### Using tmpfs
215
216You can use tmpfs for the build output to reduce the amount of disk writes
217required. I.e. mount tmpfs to the output directory where the build output goes:
218
219As root:
220
221 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
222
223*** note
224**Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
225debug build, you will need about 20 GB. Less for just building the chrome target
226or for a release build.
227***
228
229Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
230hyperthreaded, 12 GB RAM)
231
232* With tmpfs:
233 * 12m:20s
234* Without tmpfs
235 * 15m:40s
236
dpranke0ae7cad2016-11-30 07:47:58237## Build Chromium
238
239Build Chromium (the "chrome" target) with Ninja using the command:
240
sdy93387fa2016-12-01 01:03:44241```shell
242$ ninja -C out/Default chrome
243```
dpranke0ae7cad2016-11-30 07:47:58244
sdy93387fa2016-12-01 01:03:44245You can get a list of all of the other build targets from GN by running `gn ls
246out/Default` from the command line. To compile one, pass the GN label to Ninja
247with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C
248out/Default chrome/test:unit_tests`).
dpranke0ae7cad2016-11-30 07:47:58249
250## Run Chromium
251
252Once it is built, you can simply run the browser:
253
sdy93387fa2016-12-01 01:03:44254```shell
255$ out/Default/chrome
256```
dpranke0ae7cad2016-11-30 07:47:58257
258## Running test targets
259
260You can run the tests in the same way. You can also limit which tests are
261run using the `--gtest_filter` arg, e.g.:
262
sdy93387fa2016-12-01 01:03:44263```shell
dpranke1a70d0c2016-12-01 02:42:29264$ out/Default/unit_tests --gtest_filter="PushClientTest.*"
sdy93387fa2016-12-01 01:03:44265```
dpranke0ae7cad2016-11-30 07:47:58266
267You can find out more about GoogleTest at its
268[GitHub page](https://github.com/google/googletest).
269
270## Update your checkout
271
272To update an existing checkout, you can run
273
sdy93387fa2016-12-01 01:03:44274```shell
275$ git rebase-update
276$ gclient sync
277```
dpranke0ae7cad2016-11-30 07:47:58278
279The first command updates the primary Chromium source repository and rebases
sdy93387fa2016-12-01 01:03:44280any of your local branches on top of tip-of-tree (aka the Git branch
281`origin/master`). If you don't want to use this script, you can also just use
282`git pull` or other common Git commands to update the repo.
dpranke0ae7cad2016-11-30 07:47:58283
sdy93387fa2016-12-01 01:03:44284The second command syncs dependencies to the appropriate versions and re-runs
285hooks as needed.
dpranke0ae7cad2016-11-30 07:47:58286
287## Tips, tricks, and troubleshooting
andybons3322f762015-08-24 21:37:09288
289### Linker Crashes
andybonsad92aa32015-08-31 02:27:44290
andybons3322f762015-08-24 21:37:09291If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44292
sdy93387fa2016-12-01 01:03:44293```
294LINK out/Debug/chrome
295```
andybonsad92aa32015-08-31 02:27:44296
andybons3322f762015-08-24 21:37:09297You get an error like:
andybons3322f762015-08-24 21:37:09298
sdy93387fa2016-12-01 01:03:44299```
300collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
301collect2: ld terminated with signal 11 [Segmentation fault], core dumped
302```
andybonsad92aa32015-08-31 02:27:44303
brettwc25693b32016-05-26 01:11:52304you are probably running out of memory when linking. You *must* use a 64-bit
305system to build. Try the following build settings (see [GN build
306configuration](https://www.chromium.org/developers/gn-build-configuration) for
sdy93387fa2016-12-01 01:03:44307other settings):
andybonsad92aa32015-08-31 02:27:44308
sdy93387fa2016-12-01 01:03:44309* Build in release mode (debugging symbols require more memory):
brettwc25693b32016-05-26 01:11:52310 `is_debug = false`
sdy93387fa2016-12-01 01:03:44311* Turn off symbols: `symbol_level = 0`
312* Build in component mode (this is for development only, it will be slower and
313 may have broken functionality): `is_component_build = true`
andybons3322f762015-08-24 21:37:09314
dpranke0ae7cad2016-11-30 07:47:58315### More links
andybons3322f762015-08-24 21:37:09316
brettwc25693b32016-05-26 01:11:52317* Information about [building with Clang](clang.md).
dpranke0ae7cad2016-11-30 07:47:58318* You may want to [use a chroot](using_a_linux_chroot.md) to
319 isolate yourself from versioning or packaging conflicts.
andybonsad92aa32015-08-31 02:27:44320* Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md).
321* Want to use Eclipse as your IDE? See
322 [LinuxEclipseDev](linux_eclipse_dev.md).
dpranke0ae7cad2016-11-30 07:47:58323* Want to use your built version as your default browser? See
andybonsad92aa32015-08-31 02:27:44324 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09325
dpranke2989a782016-12-02 02:57:12326## Next Steps
andybonsad92aa32015-08-31 02:27:44327
328If you want to contribute to the effort toward a Chromium-based browser for
329Linux, please check out the [Linux Development page](linux_development.md) for
330more information.
dpranke2989a782016-12-02 02:57:12331
332## Notes for other distros <a name="notes"></a>
333
334### Arch Linux
335
336Instead of running `install-build-deps.sh` to install build dependencies, run:
337
338```shell
339$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
Tim Brown36312fc2017-12-15 22:56:20340nss alsa-lib glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus libgnome-keyring
dpranke2989a782016-12-02 02:57:12341```
342
343For the optional packages on Arch Linux:
344
345* `php-cgi` is provided with `pacman`
346* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
347 in AUR/`yaourt`
348* `sun-java6-fonts` do not seem to be in main repository or AUR.
349
350### Debian
351
thomasandersonb4a2bca2016-12-08 06:46:05352Some tests require the `ttf-mscorefonts-installer` package from the `contrib`
353component. `contrib` packages may have dependencies on non-free software.
dpranke2989a782016-12-02 02:57:12354
thomasandersonb4a2bca2016-12-08 06:46:05355If you need to run tests requiring MS TTF fonts, you can edit your apt
356`sources.list` by adding `contrib` to the end of each line beginning with `deb`.
357You might end up with something like this:
358
359```
360deb http://ftp.us.debian.org/debian/ jessie main contrib
361deb-src http://ftp.us.debian.org/debian/ jessie main contrib
362
363deb http://security.debian.org/ jessie/updates main contrib
364deb-src http://security.debian.org/ jessie/updates main contrib
365
366# jessie-updates, previously known as 'volatile'
367deb http://ftp.us.debian.org/debian/ jessie-updates main contrib
368deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib
369```
370
371Next, run:
372
373``` shell
374$ sudo apt-get update
375$ sudo apt-get install ttf-mscorefonts-installer
376```
377
378If you already have the `contrib` component enabled, `install-build-deps.sh`
379will install `ttf-mscorefonts-installer` for you.
dpranke2989a782016-12-02 02:57:12380
381### Fedora
382
383Instead of running `build/install-build-deps.sh`, run:
384
385```shell
386su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
387bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
388cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
Tim Brown36312fc2017-12-15 22:56:20389freetype-devel gcc-c++ glib2-devel glibc.i686 gperf glib2-devel gtk2-devel \
390gtk3-devel java-1.*.0-openjdk-devel libatomic libcap-devel libffi-devel \
391libgcc.i686 libgnome-keyring-devel libjpeg-devel libstdc++.i686 libX11-devel \
392libXScrnSaver-devel libXtst-devel libxkbcommon-x11-devel ncurses-compat-libs \
393nspr-devel nss-devel pam-devel pango-devel pciutils-devel \
394pulseaudio-libs-devel zlib.i686 httpd mod_ssl php php-cli python-psutil wdiff \
395xorg-x11-server-Xvfb'
dpranke2989a782016-12-02 02:57:12396```
397
Victor Costan44af72b2017-11-13 20:01:30398The fonts needed by Blink's LayoutTests can be obtained by following [these
399instructions](https://gist.github.com/pwnall/32a3b11c2b10f6ae5c6a6de66c1e12ae).
400For the optional packages:
dpranke2989a782016-12-02 02:57:12401
402* `php-cgi` is provided by the `php-cli` package.
Victor Costan44af72b2017-11-13 20:01:30403* `sun-java6-fonts` is covered by the instructions linked above.
dpranke2989a782016-12-02 02:57:12404
405### Gentoo
406
407You can just run `emerge www-client/chromium`.
408
dpranke2989a782016-12-02 02:57:12409### OpenSUSE
410
411Use `zypper` command to install dependencies:
412
413(openSUSE 11.1 and higher)
414
415```shell
Tim Brown36312fc2017-12-15 22:56:20416sudo zypper in subversion pkg-config python perl bison flex gperf \
417 mozilla-nss-devel glib2-devel gtk-devel wdiff lighttpd gcc gcc-c++ \
418 mozilla-nspr mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
dpranke2989a782016-12-02 02:57:12419 libjpeg-devel libbz2-devel
420```
421
422For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
423`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need
424`gtk2-devel`.
425
426(openSUSE 11.0)
427
428```shell
429sudo zypper in subversion pkg-config python perl \
430 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
431 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
Tim Brown36312fc2017-12-15 22:56:20432 php5-cgi alsa-devel gtk2-devel jpeg-devel
dpranke2989a782016-12-02 02:57:12433```
434
435The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
436Since this package requires Java as a prerequisite anyway, we can do the same
437thing by just installing the equivalent openSUSE Sun Java package:
438
439```shell
440sudo zypper in java-1_6_0-sun
441```
442
443WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
444
445```shell
446sudo zypper in fetchmsttfonts pullin-msttf-fonts
447```
448
449To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
450create symlinks to the appropriate locations:
451
452```shell
453sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
454sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
455sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
456sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
457sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
458sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
459sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
460sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
461sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
462sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
463sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
464sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
465sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
466sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
467sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
468sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
469sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
470sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
471sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
472sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
473```
474
475The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
476Since this package requires Java as a prerequisite anyway, we can do the same
477thing by just installing the equivalent openSUSE Sun Java package:
478
479```shell
480sudo zypper in java-1_6_0-sun
481```
482
483WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
484
485```shell
486sudo zypper in fetchmsttfonts pullin-msttf-fonts
487```
488
489To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
490create symlinks to the appropriate locations:
491
492```shell
493sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
494sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
495sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
496sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
497sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
498sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
499sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
500sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
501sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
502sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
503sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
504sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
505sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
506sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
507sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
508sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
509sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
510sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
511sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
512sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
513```
514
515And then for the Java fonts:
516
517```shell
518sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
519sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
520 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
521```