blob: f11ce2673bfb9a1c5efde925d26f7f363c9e82b1 [file] [log] [blame] [view]
dpranke0ae7cad2016-11-30 07:47:581# Checking out and building Chromium on Linux
andybons3322f762015-08-24 21:37:092
dpranke1a70d0c2016-12-01 02:42:293There are instructions for other platforms linked from the
4[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
dpranke0ae7cad2016-11-30 07:47:5839## Get the code
andybonsad92aa32015-08-31 02:27:4440
sdy93387fa2016-12-01 01:03:4441Create a `chromium` directory for the checkout and change to it (you can call
42this whatever you like and put it wherever you like, as long as the full path
43has no spaces):
44
45```shell
46$ mkdir ~/chromium && cd ~/chromium
47```
andybons3322f762015-08-24 21:37:0948
dpranke0ae7cad2016-11-30 07:47:5849Run the `fetch` tool from depot_tools to check out the code and its
50dependencies.
andybonsad92aa32015-08-31 02:27:4451
sdy93387fa2016-12-01 01:03:4452```shell
53$ fetch --nohooks chromium
54```
andybonsad92aa32015-08-31 02:27:4455
dpranke0ae7cad2016-11-30 07:47:5856If you don't want the full repo history, you can save a lot of time by
sdy93387fa2016-12-01 01:03:4457adding the `--no-history` flag to `fetch`.
andybons3322f762015-08-24 21:37:0958
dpranke0ae7cad2016-11-30 07:47:5859Expect the command to take 30 minutes on even a fast connection, and many
60hours on slower ones.
andybonsad92aa32015-08-31 02:27:4461
dpranke0ae7cad2016-11-30 07:47:5862If you've already installed the build dependencies on the machine (from another
sdy93387fa2016-12-01 01:03:4463checkout, for example), you can omit the `--nohooks` flag and `fetch`
dpranke0ae7cad2016-11-30 07:47:5864will automatically execute `gclient runhooks` at the end.
andybons3322f762015-08-24 21:37:0965
sdy93387fa2016-12-01 01:03:4466When `fetch` completes, it will have created a hidden `.gclient` file and a
67directory called `src` in the working directory. The remaining instructions
68assume you have switched to the `src` directory:
andybons3322f762015-08-24 21:37:0969
sdy93387fa2016-12-01 01:03:4470```shell
71$ cd src
72```
andybons3322f762015-08-24 21:37:0973
dpranke0ae7cad2016-11-30 07:47:5874### Install additional build dependencies
andybons3322f762015-08-24 21:37:0975
dpranke0ae7cad2016-11-30 07:47:5876Once you have checked out the code, and assuming you're using Ubuntu, run
77[build/install-build-deps.sh](/build/install-build-deps.sh)
andybons3322f762015-08-24 21:37:0978
dpranke2989a782016-12-02 02:57:1279You may need to adjust the build dependencies for other distros. There are
80some [notes](#notes) at the end of this document, but we make no guarantees
81for their accuracy.
andybonsad92aa32015-08-31 02:27:4482
dpranke0ae7cad2016-11-30 07:47:5883### Run the hooks
andybons3322f762015-08-24 21:37:0984
dpranke0ae7cad2016-11-30 07:47:5885Once you've run `install-build-deps` at least once, you can now run the
sdy93387fa2016-12-01 01:03:4486Chromium-specific hooks, which will download additional binaries and other
dpranke0ae7cad2016-11-30 07:47:5887things you might need:
andybonsad92aa32015-08-31 02:27:4488
sdy93387fa2016-12-01 01:03:4489```shell
90$ gclient runhooks
91```
andybonsad92aa32015-08-31 02:27:4492
sdy93387fa2016-12-01 01:03:4493*Optional*: You can also [install API
94keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
95build to talk to some Google services, but this is not necessary for most
96development and testing purposes.
andybons3322f762015-08-24 21:37:0997
dpranke1a70d0c2016-12-01 02:42:2998## Setting up the build
andybonsad92aa32015-08-31 02:27:4499
sdy93387fa2016-12-01 01:03:44100Chromium uses [Ninja](https://ninja-build.org) as its main build tool along
101with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja`
102files. You can create any number of *build directories* with different
103configurations. To create a build directory, run:
andybons8c02a1f2015-09-04 17:02:32104
sdy93387fa2016-12-01 01:03:44105```shell
106$ gn gen out/Default
107```
dpranke0ae7cad2016-11-30 07:47:58108
sdy93387fa2016-12-01 01:03:44109* You only have to run this once for each new build directory, Ninja will
110 update the build files as needed.
111* You can replace `Default` with another name, but
112 it should be a subdirectory of `out`.
113* For other build arguments, including release settings, see [GN build
114 configuration](https://www.chromium.org/developers/gn-build-configuration).
dpranke0ae7cad2016-11-30 07:47:58115 The default will be a debug component build matching the current host
116 operating system and CPU.
117* For more info on GN, run `gn help` on the command line or read the
118 [quick start guide](../tools/gn/docs/quick_start.md).
119
amoylana960fa52016-12-09 22:47:28120### <a name="faster-builds"></a>Faster builds
dpranke0ae7cad2016-11-30 07:47:58121
dpranke2989a782016-12-02 02:57:12122This section contains some things you can change to speed up your builds,
123sorted so that the things that make the biggest difference are first.
124
125#### Disable NaCl
126
127By default, the build includes support for
128[Native Client (NaCl)](https://developer.chrome.com/native-client), but
129most of the time you won't need it. You can set the GN argument
130`enable_nacl=false` and it won't be built.
131
132#### Include fewer debug symbols
133
134By default GN produces a build with all of the debug assertions enabled
135(`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
136`symbol_level=1` will produce enough information for stack traces, but not
137line-by-line debugging. Setting `symbol_level=0` will include no debug
138symbols at all. Either will speed up the build compared to full symbols.
139
dpranke2989a782016-12-02 02:57:12140#### Disable debug symbols for Blink
141
142Due to its extensive use of templates, the Blink code produces about half
143of our debug symbols. If you don't ever need to debug Blink, you can set
144the GN arg `remove_webcore_debug_symbols=true`.
145
146#### Use Icecc
147
148[Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
149central scheduler to share build load. Currently, many external contributors use
150it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma).
151
152In order to use `icecc`, set the following GN args:
153
154```
155linux_use_bundled_binutils=false
156use_debug_fission=false
157is_clang=false
dpranke2989a782016-12-02 02:57:12158```
159
160See these links for more on the
161[bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92),
162the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
163
164Using the system linker may also be necessary when using glibc 2.21 or newer.
165See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
166
167#### ccache
168
169You can use [ccache](https://ccache.samba.org) to speed up local builds (again,
170this is not useful if you're using a Googler using Goma).
171
172Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
173that the working directories all have in common (e.g.,
174`/home/yourusername/development`). Consider using
175`CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
176directories, header times in svn sync'ed portions of your trees will be
177different - see
178[the ccache troubleshooting section](http://ccache.samba.org/manual.html#_troubleshooting)
179for additional information). If you use symbolic links from your home directory
180to get to the local physical disk directory where you keep those working
181development directories, consider putting
182
183 alias cd="cd -P"
184
185in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
186logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
187parent).
188
189If you tune ccache correctly, a second working directory that uses a branch
190tracking trunk and is up to date with trunk and was gclient sync'ed at about the
191same time should build chrome in about 1/3 the time, and the cache misses as
192reported by `ccache -s` should barely increase.
193
194This is especially useful if you use `git-new-workdir` and keep multiple local
195working directories going at once.
196
197#### Using tmpfs
198
199You can use tmpfs for the build output to reduce the amount of disk writes
200required. I.e. mount tmpfs to the output directory where the build output goes:
201
202As root:
203
204 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
205
206*** note
207**Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
208debug build, you will need about 20 GB. Less for just building the chrome target
209or for a release build.
210***
211
212Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
213hyperthreaded, 12 GB RAM)
214
215* With tmpfs:
216 * 12m:20s
217* Without tmpfs
218 * 15m:40s
219
dpranke0ae7cad2016-11-30 07:47:58220## Build Chromium
221
222Build Chromium (the "chrome" target) with Ninja using the command:
223
sdy93387fa2016-12-01 01:03:44224```shell
225$ ninja -C out/Default chrome
226```
dpranke0ae7cad2016-11-30 07:47:58227
sdy93387fa2016-12-01 01:03:44228You can get a list of all of the other build targets from GN by running `gn ls
229out/Default` from the command line. To compile one, pass the GN label to Ninja
230with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C
231out/Default chrome/test:unit_tests`).
dpranke0ae7cad2016-11-30 07:47:58232
233## Run Chromium
234
235Once it is built, you can simply run the browser:
236
sdy93387fa2016-12-01 01:03:44237```shell
238$ out/Default/chrome
239```
dpranke0ae7cad2016-11-30 07:47:58240
241## Running test targets
242
243You can run the tests in the same way. You can also limit which tests are
244run using the `--gtest_filter` arg, e.g.:
245
sdy93387fa2016-12-01 01:03:44246```shell
dpranke1a70d0c2016-12-01 02:42:29247$ out/Default/unit_tests --gtest_filter="PushClientTest.*"
sdy93387fa2016-12-01 01:03:44248```
dpranke0ae7cad2016-11-30 07:47:58249
250You can find out more about GoogleTest at its
251[GitHub page](https://github.com/google/googletest).
252
253## Update your checkout
254
255To update an existing checkout, you can run
256
sdy93387fa2016-12-01 01:03:44257```shell
258$ git rebase-update
259$ gclient sync
260```
dpranke0ae7cad2016-11-30 07:47:58261
262The first command updates the primary Chromium source repository and rebases
sdy93387fa2016-12-01 01:03:44263any of your local branches on top of tip-of-tree (aka the Git branch
264`origin/master`). If you don't want to use this script, you can also just use
265`git pull` or other common Git commands to update the repo.
dpranke0ae7cad2016-11-30 07:47:58266
sdy93387fa2016-12-01 01:03:44267The second command syncs dependencies to the appropriate versions and re-runs
268hooks as needed.
dpranke0ae7cad2016-11-30 07:47:58269
270## Tips, tricks, and troubleshooting
andybons3322f762015-08-24 21:37:09271
272### Linker Crashes
andybonsad92aa32015-08-31 02:27:44273
andybons3322f762015-08-24 21:37:09274If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44275
sdy93387fa2016-12-01 01:03:44276```
277LINK out/Debug/chrome
278```
andybonsad92aa32015-08-31 02:27:44279
andybons3322f762015-08-24 21:37:09280You get an error like:
andybons3322f762015-08-24 21:37:09281
sdy93387fa2016-12-01 01:03:44282```
283collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
284collect2: ld terminated with signal 11 [Segmentation fault], core dumped
285```
andybonsad92aa32015-08-31 02:27:44286
brettwc25693b32016-05-26 01:11:52287you are probably running out of memory when linking. You *must* use a 64-bit
288system to build. Try the following build settings (see [GN build
289configuration](https://www.chromium.org/developers/gn-build-configuration) for
sdy93387fa2016-12-01 01:03:44290other settings):
andybonsad92aa32015-08-31 02:27:44291
sdy93387fa2016-12-01 01:03:44292* Build in release mode (debugging symbols require more memory):
brettwc25693b32016-05-26 01:11:52293 `is_debug = false`
sdy93387fa2016-12-01 01:03:44294* Turn off symbols: `symbol_level = 0`
295* Build in component mode (this is for development only, it will be slower and
296 may have broken functionality): `is_component_build = true`
andybons3322f762015-08-24 21:37:09297
dpranke0ae7cad2016-11-30 07:47:58298### More links
andybons3322f762015-08-24 21:37:09299
brettwc25693b32016-05-26 01:11:52300* Information about [building with Clang](clang.md).
dpranke0ae7cad2016-11-30 07:47:58301* You may want to [use a chroot](using_a_linux_chroot.md) to
302 isolate yourself from versioning or packaging conflicts.
andybonsad92aa32015-08-31 02:27:44303* Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md).
304* Want to use Eclipse as your IDE? See
305 [LinuxEclipseDev](linux_eclipse_dev.md).
dpranke0ae7cad2016-11-30 07:47:58306* Want to use your built version as your default browser? See
andybonsad92aa32015-08-31 02:27:44307 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09308
dpranke2989a782016-12-02 02:57:12309## Next Steps
andybonsad92aa32015-08-31 02:27:44310
311If you want to contribute to the effort toward a Chromium-based browser for
312Linux, please check out the [Linux Development page](linux_development.md) for
313more information.
dpranke2989a782016-12-02 02:57:12314
315## Notes for other distros <a name="notes"></a>
316
317### Arch Linux
318
319Instead of running `install-build-deps.sh` to install build dependencies, run:
320
321```shell
322$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
323nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \
324libgnome-keyring
325```
326
327For the optional packages on Arch Linux:
328
329* `php-cgi` is provided with `pacman`
330* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
331 in AUR/`yaourt`
332* `sun-java6-fonts` do not seem to be in main repository or AUR.
333
334### Debian
335
thomasandersonb4a2bca2016-12-08 06:46:05336Some tests require the `ttf-mscorefonts-installer` package from the `contrib`
337component. `contrib` packages may have dependencies on non-free software.
dpranke2989a782016-12-02 02:57:12338
thomasandersonb4a2bca2016-12-08 06:46:05339If you need to run tests requiring MS TTF fonts, you can edit your apt
340`sources.list` by adding `contrib` to the end of each line beginning with `deb`.
341You might end up with something like this:
342
343```
344deb http://ftp.us.debian.org/debian/ jessie main contrib
345deb-src http://ftp.us.debian.org/debian/ jessie main contrib
346
347deb http://security.debian.org/ jessie/updates main contrib
348deb-src http://security.debian.org/ jessie/updates main contrib
349
350# jessie-updates, previously known as 'volatile'
351deb http://ftp.us.debian.org/debian/ jessie-updates main contrib
352deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib
353```
354
355Next, run:
356
357``` shell
358$ sudo apt-get update
359$ sudo apt-get install ttf-mscorefonts-installer
360```
361
362If you already have the `contrib` component enabled, `install-build-deps.sh`
363will install `ttf-mscorefonts-installer` for you.
dpranke2989a782016-12-02 02:57:12364
365### Fedora
366
367Instead of running `build/install-build-deps.sh`, run:
368
369```shell
370su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
371bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
372cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
373freetype-devel gcc-c++ GConf2-devel glib2-devel glibc.i686 gperf \
374glib2-devel gtk2-devel gtk3-devel java-1.*.0-openjdk-devel libatomic \
375libcap-devel libffi-devel libgcc.i686 libgnome-keyring-devel libjpeg-devel \
376libstdc++.i686 libX11-devel libXScrnSaver-devel libXtst-devel \
377libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel pam-devel \
378pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd mod_ssl \
379php php-cli python-psutil wdiff'
380```
381
382The `msttcorefonts` packages can be obtained by following [these
383instructions](http://www.fedorafaq.org/#installfonts). For the optional
384packages:
385
386* `php-cgi` is provided by the `php-cli` package.
387* `sun-java6-fonts` doesn't exist in Fedora repositories, needs investigating.
388
389### Gentoo
390
391You can just run `emerge www-client/chromium`.
392
393### Mandriva
394
395Instead of running `build/install-build-deps.sh`, run:
396
397```shell
398urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \
399lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \
400lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \
401perl bison flex subversion gperf
402```
403
404* `msttcorefonts` are not available, you will need to build your own (see
405 instructions, not hard to do, see
406 [mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use `drakfont` to
407 import the fonts from a Windows installation.
408
409### OpenSUSE
410
411Use `zypper` command to install dependencies:
412
413(openSUSE 11.1 and higher)
414
415```shell
416sudo zypper in subversion pkg-config python perl \
417 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
418 wdiff lighttpd gcc gcc-c++ gconf2-devel mozilla-nspr \
419 mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
420 libjpeg-devel libbz2-devel
421```
422
423For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
424`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need
425`gtk2-devel`.
426
427(openSUSE 11.0)
428
429```shell
430sudo zypper in subversion pkg-config python perl \
431 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
432 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
433 php5-cgi gconf2-devel alsa-devel gtk2-devel jpeg-devel
434```
435
436The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
437Since this package requires Java as a prerequisite anyway, we can do the same
438thing by just installing the equivalent openSUSE Sun Java package:
439
440```shell
441sudo zypper in java-1_6_0-sun
442```
443
444WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
445
446```shell
447sudo zypper in fetchmsttfonts pullin-msttf-fonts
448```
449
450To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
451create symlinks to the appropriate locations:
452
453```shell
454sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
455sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
456sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
457sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
458sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
459sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
460sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
461sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
462sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
463sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
464sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
465sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
466sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
467sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
468sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
469sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
470sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
471sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
472sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
473sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
474```
475
476The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
477Since this package requires Java as a prerequisite anyway, we can do the same
478thing by just installing the equivalent openSUSE Sun Java package:
479
480```shell
481sudo zypper in java-1_6_0-sun
482```
483
484WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
485
486```shell
487sudo zypper in fetchmsttfonts pullin-msttf-fonts
488```
489
490To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
491create symlinks to the appropriate locations:
492
493```shell
494sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
495sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
496sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
497sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
498sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
499sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
500sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
501sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
502sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
503sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
504sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
505sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
506sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
507sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
508sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
509sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
510sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
511sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
512sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
513sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
514```
515
516And then for the Java fonts:
517
518```shell
519sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
520sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
521 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
522```