blob: cdbcc1fd69c043bcef768006410cea52d2066b5e [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.
Thiemo Nageldbae05f32018-07-31 14:43:2718* You must have Git and Python v2 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
Aaron Gable3bc93682019-01-11 02:16:0787```shell
88$ ./build/install-build-deps.sh
89```
90
dpranke2989a782016-12-02 02:57:1291You may need to adjust the build dependencies for other distros. There are
92some [notes](#notes) at the end of this document, but we make no guarantees
93for their accuracy.
andybonsad92aa32015-08-31 02:27:4494
dpranke0ae7cad2016-11-30 07:47:5895### Run the hooks
andybons3322f762015-08-24 21:37:0996
dpranke0ae7cad2016-11-30 07:47:5897Once you've run `install-build-deps` at least once, you can now run the
sdy93387fa2016-12-01 01:03:4498Chromium-specific hooks, which will download additional binaries and other
dpranke0ae7cad2016-11-30 07:47:5899things you might need:
andybonsad92aa32015-08-31 02:27:44100
sdy93387fa2016-12-01 01:03:44101```shell
102$ gclient runhooks
103```
andybonsad92aa32015-08-31 02:27:44104
sdy93387fa2016-12-01 01:03:44105*Optional*: You can also [install API
106keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your
107build to talk to some Google services, but this is not necessary for most
108development and testing purposes.
andybons3322f762015-08-24 21:37:09109
dpranke1a70d0c2016-12-01 02:42:29110## Setting up the build
andybonsad92aa32015-08-31 02:27:44111
Tom Bridgwatereef401542018-08-17 00:54:43112Chromium uses [Ninja](https://ninja-build.org) as its main build tool along with
113a tool called [GN](https://gn.googlesource.com/gn/+/master/docs/quick_start.md)
114to generate `.ninja` files. You can create any number of *build directories*
115with different configurations. To create a build directory, run:
andybons8c02a1f2015-09-04 17:02:32116
sdy93387fa2016-12-01 01:03:44117```shell
118$ gn gen out/Default
119```
dpranke0ae7cad2016-11-30 07:47:58120
sdy93387fa2016-12-01 01:03:44121* You only have to run this once for each new build directory, Ninja will
122 update the build files as needed.
123* You can replace `Default` with another name, but
124 it should be a subdirectory of `out`.
125* For other build arguments, including release settings, see [GN build
126 configuration](https://www.chromium.org/developers/gn-build-configuration).
dpranke0ae7cad2016-11-30 07:47:58127 The default will be a debug component build matching the current host
128 operating system and CPU.
129* For more info on GN, run `gn help` on the command line or read the
130 [quick start guide](../tools/gn/docs/quick_start.md).
131
amoylana960fa52016-12-09 22:47:28132### <a name="faster-builds"></a>Faster builds
dpranke0ae7cad2016-11-30 07:47:58133
dpranke2989a782016-12-02 02:57:12134This section contains some things you can change to speed up your builds,
135sorted so that the things that make the biggest difference are first.
136
Philip Rogerseb841682017-10-09 16:08:50137#### Jumbo/Unity builds
138
139Jumbo builds merge many translation units ("source files") and compile them
140together. Since a large portion of Chromium's code is in shared header files,
141this dramatically reduces the total amount of work needed. Check out the
142[Jumbo / Unity builds](jumbo.md) for more information.
143
144Enable jumbo builds by setting the GN arg `use_jumbo_build=true`.
145
dpranke2989a782016-12-02 02:57:12146#### Disable NaCl
147
148By default, the build includes support for
149[Native Client (NaCl)](https://developer.chrome.com/native-client), but
Victor Costan44af72b2017-11-13 20:01:30150most of the time you won't need it. You can set the GN argument
dpranke2989a782016-12-02 02:57:12151`enable_nacl=false` and it won't be built.
152
153#### Include fewer debug symbols
154
155By default GN produces a build with all of the debug assertions enabled
156(`is_debug=true`) and including full debug info (`symbol_level=2`). Setting
157`symbol_level=1` will produce enough information for stack traces, but not
158line-by-line debugging. Setting `symbol_level=0` will include no debug
159symbols at all. Either will speed up the build compared to full symbols.
160
dpranke2989a782016-12-02 02:57:12161#### Disable debug symbols for Blink
162
163Due to its extensive use of templates, the Blink code produces about half
164of our debug symbols. If you don't ever need to debug Blink, you can set
James Cook26699a92019-03-12 22:23:10165the GN arg `blink_symbol_level=0`.
dpranke2989a782016-12-02 02:57:12166
167#### Use Icecc
168
169[Icecc](https://github.com/icecc/icecream) is the distributed compiler with a
170central scheduler to share build load. Currently, many external contributors use
171it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma).
172
173In order to use `icecc`, set the following GN args:
174
175```
176linux_use_bundled_binutils=false
177use_debug_fission=false
178is_clang=false
dpranke2989a782016-12-02 02:57:12179```
180
Victor Costan44af72b2017-11-13 20:01:30181See these links for more on the
dpranke2989a782016-12-02 02:57:12182[bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92),
183the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission).
184
185Using the system linker may also be necessary when using glibc 2.21 or newer.
186See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181).
187
188#### ccache
189
190You can use [ccache](https://ccache.samba.org) to speed up local builds (again,
Kush Sinhae6aa1d182017-11-20 13:56:53191this is not useful if you're a Googler using Goma).
dpranke2989a782016-12-02 02:57:12192
193Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory
194that the working directories all have in common (e.g.,
195`/home/yourusername/development`). Consider using
196`CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working
197directories, header times in svn sync'ed portions of your trees will be
198different - see
199[the ccache troubleshooting section](http://ccache.samba.org/manual.html#_troubleshooting)
200for additional information). If you use symbolic links from your home directory
201to get to the local physical disk directory where you keep those working
202development directories, consider putting
203
204 alias cd="cd -P"
205
206in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not
207logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical
208parent).
209
210If you tune ccache correctly, a second working directory that uses a branch
211tracking trunk and is up to date with trunk and was gclient sync'ed at about the
212same time should build chrome in about 1/3 the time, and the cache misses as
213reported by `ccache -s` should barely increase.
214
215This is especially useful if you use `git-new-workdir` and keep multiple local
216working directories going at once.
217
218#### Using tmpfs
219
220You can use tmpfs for the build output to reduce the amount of disk writes
221required. I.e. mount tmpfs to the output directory where the build output goes:
222
223As root:
224
225 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out
226
227*** note
228**Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full
229debug build, you will need about 20 GB. Less for just building the chrome target
230or for a release build.
231***
232
233Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores
234hyperthreaded, 12 GB RAM)
235
236* With tmpfs:
237 * 12m:20s
238* Without tmpfs
239 * 15m:40s
240
dpranke0ae7cad2016-11-30 07:47:58241## Build Chromium
242
243Build Chromium (the "chrome" target) with Ninja using the command:
244
sdy93387fa2016-12-01 01:03:44245```shell
Max Morozf5b31fcd2018-08-10 21:55:48246$ autoninja -C out/Default chrome
sdy93387fa2016-12-01 01:03:44247```
dpranke0ae7cad2016-11-30 07:47:58248
Dirk Pranke8bd55f22018-10-24 21:22:10249(`autoninja` is a wrapper that automatically provides optimal values for the
250arguments passed to `ninja`.)
Max Morozf5b31fcd2018-08-10 21:55:48251
sdy93387fa2016-12-01 01:03:44252You can get a list of all of the other build targets from GN by running `gn ls
253out/Default` from the command line. To compile one, pass the GN label to Ninja
Max Morozf5b31fcd2018-08-10 21:55:48254with no preceding "//" (so, for `//chrome/test:unit_tests` use `autoninja -C
sdy93387fa2016-12-01 01:03:44255out/Default chrome/test:unit_tests`).
dpranke0ae7cad2016-11-30 07:47:58256
257## Run Chromium
258
259Once it is built, you can simply run the browser:
260
sdy93387fa2016-12-01 01:03:44261```shell
262$ out/Default/chrome
263```
dpranke0ae7cad2016-11-30 07:47:58264
265## Running test targets
266
267You can run the tests in the same way. You can also limit which tests are
268run using the `--gtest_filter` arg, e.g.:
269
sdy93387fa2016-12-01 01:03:44270```shell
dpranke1a70d0c2016-12-01 02:42:29271$ out/Default/unit_tests --gtest_filter="PushClientTest.*"
sdy93387fa2016-12-01 01:03:44272```
dpranke0ae7cad2016-11-30 07:47:58273
274You can find out more about GoogleTest at its
275[GitHub page](https://github.com/google/googletest).
276
277## Update your checkout
278
279To update an existing checkout, you can run
280
sdy93387fa2016-12-01 01:03:44281```shell
282$ git rebase-update
283$ gclient sync
284```
dpranke0ae7cad2016-11-30 07:47:58285
286The first command updates the primary Chromium source repository and rebases
sdy93387fa2016-12-01 01:03:44287any of your local branches on top of tip-of-tree (aka the Git branch
288`origin/master`). If you don't want to use this script, you can also just use
289`git pull` or other common Git commands to update the repo.
dpranke0ae7cad2016-11-30 07:47:58290
sdy93387fa2016-12-01 01:03:44291The second command syncs dependencies to the appropriate versions and re-runs
292hooks as needed.
dpranke0ae7cad2016-11-30 07:47:58293
294## Tips, tricks, and troubleshooting
andybons3322f762015-08-24 21:37:09295
296### Linker Crashes
andybonsad92aa32015-08-31 02:27:44297
andybons3322f762015-08-24 21:37:09298If, during the final link stage:
andybonsad92aa32015-08-31 02:27:44299
sdy93387fa2016-12-01 01:03:44300```
301LINK out/Debug/chrome
302```
andybonsad92aa32015-08-31 02:27:44303
andybons3322f762015-08-24 21:37:09304You get an error like:
andybons3322f762015-08-24 21:37:09305
sdy93387fa2016-12-01 01:03:44306```
307collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc'
308collect2: ld terminated with signal 11 [Segmentation fault], core dumped
309```
andybonsad92aa32015-08-31 02:27:44310
brettwc25693b32016-05-26 01:11:52311you are probably running out of memory when linking. You *must* use a 64-bit
312system to build. Try the following build settings (see [GN build
313configuration](https://www.chromium.org/developers/gn-build-configuration) for
sdy93387fa2016-12-01 01:03:44314other settings):
andybonsad92aa32015-08-31 02:27:44315
sdy93387fa2016-12-01 01:03:44316* Build in release mode (debugging symbols require more memory):
brettwc25693b32016-05-26 01:11:52317 `is_debug = false`
sdy93387fa2016-12-01 01:03:44318* Turn off symbols: `symbol_level = 0`
319* Build in component mode (this is for development only, it will be slower and
320 may have broken functionality): `is_component_build = true`
andybons3322f762015-08-24 21:37:09321
dpranke0ae7cad2016-11-30 07:47:58322### More links
andybons3322f762015-08-24 21:37:09323
brettwc25693b32016-05-26 01:11:52324* Information about [building with Clang](clang.md).
dpranke0ae7cad2016-11-30 07:47:58325* You may want to [use a chroot](using_a_linux_chroot.md) to
326 isolate yourself from versioning or packaging conflicts.
andybonsad92aa32015-08-31 02:27:44327* Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md).
328* Want to use Eclipse as your IDE? See
329 [LinuxEclipseDev](linux_eclipse_dev.md).
dpranke0ae7cad2016-11-30 07:47:58330* Want to use your built version as your default browser? See
andybonsad92aa32015-08-31 02:27:44331 [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md).
andybons3322f762015-08-24 21:37:09332
dpranke2989a782016-12-02 02:57:12333## Next Steps
andybonsad92aa32015-08-31 02:27:44334
335If you want to contribute to the effort toward a Chromium-based browser for
336Linux, please check out the [Linux Development page](linux_development.md) for
337more information.
dpranke2989a782016-12-02 02:57:12338
339## Notes for other distros <a name="notes"></a>
340
341### Arch Linux
342
343Instead of running `install-build-deps.sh` to install build dependencies, run:
344
345```shell
346$ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \
Tom Anderson287339e2018-08-22 21:52:02347nss alsa-lib glib2 gtk3 nspr ttf-ms-fonts freetype2 cairo dbus libgnome-keyring
dpranke2989a782016-12-02 02:57:12348```
349
350For the optional packages on Arch Linux:
351
352* `php-cgi` is provided with `pacman`
353* `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff`
354 in AUR/`yaourt`
355* `sun-java6-fonts` do not seem to be in main repository or AUR.
356
Kenneth Russell56293772018-09-21 01:46:15357### Crostini (Debian based)
358
359First install the `file` command for the script to run properly:
360
361```shell
362$ sudo apt-get install file
363```
364
365Then invoke install-build-deps.sh with the `--no-arm` argument,
366because the ARM toolchain doesn't exist for this configuration:
367
368```shell
369$ sudo install-build-deps.sh --no-arm
370```
371
dpranke2989a782016-12-02 02:57:12372### Fedora
373
374Instead of running `build/install-build-deps.sh`, run:
375
376```shell
377su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \
378bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \
379cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \
Tom Anderson287339e2018-08-22 21:52:02380freetype-devel gcc-c++ glib2-devel glibc.i686 gperf glib2-devel \
Tim Brown36312fc2017-12-15 22:56:20381gtk3-devel java-1.*.0-openjdk-devel libatomic libcap-devel libffi-devel \
382libgcc.i686 libgnome-keyring-devel libjpeg-devel libstdc++.i686 libX11-devel \
383libXScrnSaver-devel libXtst-devel libxkbcommon-x11-devel ncurses-compat-libs \
384nspr-devel nss-devel pam-devel pango-devel pciutils-devel \
385pulseaudio-libs-devel zlib.i686 httpd mod_ssl php php-cli python-psutil wdiff \
386xorg-x11-server-Xvfb'
dpranke2989a782016-12-02 02:57:12387```
388
Kent Tamura59ffb022018-11-27 05:30:56389The fonts needed by Blink's web tests can be obtained by following [these
Victor Costan44af72b2017-11-13 20:01:30390instructions](https://gist.github.com/pwnall/32a3b11c2b10f6ae5c6a6de66c1e12ae).
391For the optional packages:
dpranke2989a782016-12-02 02:57:12392
393* `php-cgi` is provided by the `php-cli` package.
Victor Costan44af72b2017-11-13 20:01:30394* `sun-java6-fonts` is covered by the instructions linked above.
dpranke2989a782016-12-02 02:57:12395
396### Gentoo
397
398You can just run `emerge www-client/chromium`.
399
dpranke2989a782016-12-02 02:57:12400### OpenSUSE
401
402Use `zypper` command to install dependencies:
403
404(openSUSE 11.1 and higher)
405
406```shell
Tim Brown36312fc2017-12-15 22:56:20407sudo zypper in subversion pkg-config python perl bison flex gperf \
408 mozilla-nss-devel glib2-devel gtk-devel wdiff lighttpd gcc gcc-c++ \
409 mozilla-nspr mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \
dpranke2989a782016-12-02 02:57:12410 libjpeg-devel libbz2-devel
411```
412
413For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and
Tom Anderson287339e2018-08-22 21:52:02414`mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`.
dpranke2989a782016-12-02 02:57:12415
416(openSUSE 11.0)
417
418```shell
419sudo zypper in subversion pkg-config python perl \
420 bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \
421 libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \
Tom Anderson287339e2018-08-22 21:52:02422 php5-cgi alsa-devel gtk3-devel jpeg-devel
dpranke2989a782016-12-02 02:57:12423```
424
425The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
426Since this package requires Java as a prerequisite anyway, we can do the same
427thing by just installing the equivalent openSUSE Sun Java package:
428
429```shell
430sudo zypper in java-1_6_0-sun
431```
432
433WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
434
435```shell
436sudo zypper in fetchmsttfonts pullin-msttf-fonts
437```
438
439To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
440create symlinks to the appropriate locations:
441
442```shell
443sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
444sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
445sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
446sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
447sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
448sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
449sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
450sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
451sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
452sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
453sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
454sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
455sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
456sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
457sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
458sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
459sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
460sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
461sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
462sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
463```
464
465The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used.
466Since this package requires Java as a prerequisite anyway, we can do the same
467thing by just installing the equivalent openSUSE Sun Java package:
468
469```shell
470sudo zypper in java-1_6_0-sun
471```
472
473WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper`
474
475```shell
476sudo zypper in fetchmsttfonts pullin-msttf-fonts
477```
478
479To make the fonts installed above work, as the paths are hardcoded for Ubuntu,
480create symlinks to the appropriate locations:
481
482```shell
483sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts
484sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
485sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf
486sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf
487sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf
488sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf
489sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf
490sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf
491sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf
492sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf
493sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf
494sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf
495sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
496sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf
497sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf
498sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf
499sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf
500sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf
501sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf
502sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf
503```
504
505And then for the Java fonts:
506
507```shell
508sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida
509sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \
510 -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \;
511```