dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 1 | # Checking out and building Chromium on Linux |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 2 | |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 3 | There are instructions for other platforms linked from the |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 4 | [get the code](get_the_code.md) page. |
| 5 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 6 | ## Instructions for Google Employees |
| 7 | |
| 8 | Are you a Google employee? See |
| 9 | [go/building-chrome](https://goto.google.com/building-chrome) instead. |
andybons | 8c02a1f | 2015-09-04 17:02:32 | [diff] [blame] | 10 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 11 | [TOC] |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 12 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 13 | ## System requirements |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 14 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 15 | * 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. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 19 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 20 | Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 21 | some instructions for other distros below, but they are mostly unsupported. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 22 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 23 | ## Install `depot_tools` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 24 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 25 | Clone the `depot_tools` repository: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 26 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 27 | ```shell |
| 28 | $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 29 | ``` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 30 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 31 | Add `depot_tools` to the end of your PATH (you will probably want to put this |
| 32 | in your `~/.bashrc` or `~/.zshrc`). Assuming you cloned `depot_tools` to |
| 33 | `/path/to/depot_tools`: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 34 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 35 | ```shell |
| 36 | $ export PATH="$PATH:/path/to/depot_tools" |
| 37 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 38 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 39 | ## Get the code |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 40 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 41 | Create a `chromium` directory for the checkout and change to it (you can call |
| 42 | this whatever you like and put it wherever you like, as long as the full path |
| 43 | has no spaces): |
| 44 | |
| 45 | ```shell |
| 46 | $ mkdir ~/chromium && cd ~/chromium |
| 47 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 48 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 49 | Run the `fetch` tool from depot_tools to check out the code and its |
| 50 | dependencies. |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 51 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 52 | ```shell |
| 53 | $ fetch --nohooks chromium |
| 54 | ``` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 55 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 56 | If you don't want the full repo history, you can save a lot of time by |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 57 | adding the `--no-history` flag to `fetch`. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 58 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 59 | Expect the command to take 30 minutes on even a fast connection, and many |
| 60 | hours on slower ones. |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 61 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 62 | If you've already installed the build dependencies on the machine (from another |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 63 | checkout, for example), you can omit the `--nohooks` flag and `fetch` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 64 | will automatically execute `gclient runhooks` at the end. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 65 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 66 | When `fetch` completes, it will have created a hidden `.gclient` file and a |
| 67 | directory called `src` in the working directory. The remaining instructions |
| 68 | assume you have switched to the `src` directory: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 69 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 70 | ```shell |
| 71 | $ cd src |
| 72 | ``` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 73 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 74 | ### Install additional build dependencies |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 75 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 76 | Once you have checked out the code, and assuming you're using Ubuntu, run |
| 77 | [build/install-build-deps.sh](/build/install-build-deps.sh) |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 78 | |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 79 | You may need to adjust the build dependencies for other distros. There are |
| 80 | some [notes](#notes) at the end of this document, but we make no guarantees |
| 81 | for their accuracy. |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 82 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 83 | ### Run the hooks |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 84 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 85 | Once you've run `install-build-deps` at least once, you can now run the |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 86 | Chromium-specific hooks, which will download additional binaries and other |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 87 | things you might need: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 88 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 89 | ```shell |
| 90 | $ gclient runhooks |
| 91 | ``` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 92 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 93 | *Optional*: You can also [install API |
| 94 | keys](https://www.chromium.org/developers/how-tos/api-keys) if you want your |
| 95 | build to talk to some Google services, but this is not necessary for most |
| 96 | development and testing purposes. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 97 | |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 98 | ## Setting up the build |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 99 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 100 | Chromium uses [Ninja](https://ninja-build.org) as its main build tool along |
| 101 | with a tool called [GN](../tools/gn/docs/quick_start.md) to generate `.ninja` |
| 102 | files. You can create any number of *build directories* with different |
| 103 | configurations. To create a build directory, run: |
andybons | 8c02a1f | 2015-09-04 17:02:32 | [diff] [blame] | 104 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 105 | ```shell |
| 106 | $ gn gen out/Default |
| 107 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 108 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 109 | * 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). |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 115 | 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 | |
amoylan | a960fa5 | 2016-12-09 22:47:28 | [diff] [blame] | 120 | ### <a name="faster-builds"></a>Faster builds |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 121 | |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 122 | This section contains some things you can change to speed up your builds, |
| 123 | sorted so that the things that make the biggest difference are first. |
| 124 | |
Philip Rogers | eb84168 | 2017-10-09 16:08:50 | [diff] [blame] | 125 | #### Jumbo/Unity builds |
| 126 | |
| 127 | Jumbo builds merge many translation units ("source files") and compile them |
| 128 | together. Since a large portion of Chromium's code is in shared header files, |
| 129 | this dramatically reduces the total amount of work needed. Check out the |
| 130 | [Jumbo / Unity builds](jumbo.md) for more information. |
| 131 | |
| 132 | Enable jumbo builds by setting the GN arg `use_jumbo_build=true`. |
| 133 | |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 134 | #### Disable NaCl |
| 135 | |
| 136 | By default, the build includes support for |
| 137 | [Native Client (NaCl)](https://developer.chrome.com/native-client), but |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 138 | most of the time you won't need it. You can set the GN argument |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 139 | `enable_nacl=false` and it won't be built. |
| 140 | |
| 141 | #### Include fewer debug symbols |
| 142 | |
| 143 | By default GN produces a build with all of the debug assertions enabled |
| 144 | (`is_debug=true`) and including full debug info (`symbol_level=2`). Setting |
| 145 | `symbol_level=1` will produce enough information for stack traces, but not |
| 146 | line-by-line debugging. Setting `symbol_level=0` will include no debug |
| 147 | symbols at all. Either will speed up the build compared to full symbols. |
| 148 | |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 149 | #### Disable debug symbols for Blink |
| 150 | |
| 151 | Due to its extensive use of templates, the Blink code produces about half |
| 152 | of our debug symbols. If you don't ever need to debug Blink, you can set |
| 153 | the GN arg `remove_webcore_debug_symbols=true`. |
| 154 | |
| 155 | #### Use Icecc |
| 156 | |
| 157 | [Icecc](https://github.com/icecc/icecream) is the distributed compiler with a |
| 158 | central scheduler to share build load. Currently, many external contributors use |
| 159 | it. e.g. Intel, Opera, Samsung (Googlers use an internal system called Goma). |
| 160 | |
| 161 | In order to use `icecc`, set the following GN args: |
| 162 | |
| 163 | ``` |
| 164 | linux_use_bundled_binutils=false |
| 165 | use_debug_fission=false |
| 166 | is_clang=false |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 167 | ``` |
| 168 | |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 169 | See these links for more on the |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 170 | [bundled_binutils limitation](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3684214e409fa81e7a92), |
| 171 | the [debug fission limitation](http://gcc.gnu.org/wiki/DebugFission). |
| 172 | |
| 173 | Using the system linker may also be necessary when using glibc 2.21 or newer. |
| 174 | See [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181). |
| 175 | |
| 176 | #### ccache |
| 177 | |
| 178 | You can use [ccache](https://ccache.samba.org) to speed up local builds (again, |
Kush Sinha | e6aa1d18 | 2017-11-20 13:56:53 | [diff] [blame^] | 179 | this is not useful if you're a Googler using Goma). |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 180 | |
| 181 | Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory |
| 182 | that the working directories all have in common (e.g., |
| 183 | `/home/yourusername/development`). Consider using |
| 184 | `CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working |
| 185 | directories, header times in svn sync'ed portions of your trees will be |
| 186 | different - see |
| 187 | [the ccache troubleshooting section](http://ccache.samba.org/manual.html#_troubleshooting) |
| 188 | for additional information). If you use symbolic links from your home directory |
| 189 | to get to the local physical disk directory where you keep those working |
| 190 | development directories, consider putting |
| 191 | |
| 192 | alias cd="cd -P" |
| 193 | |
| 194 | in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not |
| 195 | logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical |
| 196 | parent). |
| 197 | |
| 198 | If you tune ccache correctly, a second working directory that uses a branch |
| 199 | tracking trunk and is up to date with trunk and was gclient sync'ed at about the |
| 200 | same time should build chrome in about 1/3 the time, and the cache misses as |
| 201 | reported by `ccache -s` should barely increase. |
| 202 | |
| 203 | This is especially useful if you use `git-new-workdir` and keep multiple local |
| 204 | working directories going at once. |
| 205 | |
| 206 | #### Using tmpfs |
| 207 | |
| 208 | You can use tmpfs for the build output to reduce the amount of disk writes |
| 209 | required. I.e. mount tmpfs to the output directory where the build output goes: |
| 210 | |
| 211 | As root: |
| 212 | |
| 213 | mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out |
| 214 | |
| 215 | *** note |
| 216 | **Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full |
| 217 | debug build, you will need about 20 GB. Less for just building the chrome target |
| 218 | or for a release build. |
| 219 | *** |
| 220 | |
| 221 | Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores |
| 222 | hyperthreaded, 12 GB RAM) |
| 223 | |
| 224 | * With tmpfs: |
| 225 | * 12m:20s |
| 226 | * Without tmpfs |
| 227 | * 15m:40s |
| 228 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 229 | ## Build Chromium |
| 230 | |
| 231 | Build Chromium (the "chrome" target) with Ninja using the command: |
| 232 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 233 | ```shell |
| 234 | $ ninja -C out/Default chrome |
| 235 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 236 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 237 | You can get a list of all of the other build targets from GN by running `gn ls |
| 238 | out/Default` from the command line. To compile one, pass the GN label to Ninja |
| 239 | with no preceding "//" (so, for `//chrome/test:unit_tests` use `ninja -C |
| 240 | out/Default chrome/test:unit_tests`). |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 241 | |
| 242 | ## Run Chromium |
| 243 | |
| 244 | Once it is built, you can simply run the browser: |
| 245 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 246 | ```shell |
| 247 | $ out/Default/chrome |
| 248 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 249 | |
| 250 | ## Running test targets |
| 251 | |
| 252 | You can run the tests in the same way. You can also limit which tests are |
| 253 | run using the `--gtest_filter` arg, e.g.: |
| 254 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 255 | ```shell |
dpranke | 1a70d0c | 2016-12-01 02:42:29 | [diff] [blame] | 256 | $ out/Default/unit_tests --gtest_filter="PushClientTest.*" |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 257 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 258 | |
| 259 | You can find out more about GoogleTest at its |
| 260 | [GitHub page](https://github.com/google/googletest). |
| 261 | |
| 262 | ## Update your checkout |
| 263 | |
| 264 | To update an existing checkout, you can run |
| 265 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 266 | ```shell |
| 267 | $ git rebase-update |
| 268 | $ gclient sync |
| 269 | ``` |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 270 | |
| 271 | The first command updates the primary Chromium source repository and rebases |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 272 | any of your local branches on top of tip-of-tree (aka the Git branch |
| 273 | `origin/master`). If you don't want to use this script, you can also just use |
| 274 | `git pull` or other common Git commands to update the repo. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 275 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 276 | The second command syncs dependencies to the appropriate versions and re-runs |
| 277 | hooks as needed. |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 278 | |
| 279 | ## Tips, tricks, and troubleshooting |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 280 | |
| 281 | ### Linker Crashes |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 282 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 283 | If, during the final link stage: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 284 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 285 | ``` |
| 286 | LINK out/Debug/chrome |
| 287 | ``` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 288 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 289 | You get an error like: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 290 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 291 | ``` |
| 292 | collect2: ld terminated with signal 6 Aborted terminate called after throwing an instance of 'std::bad_alloc' |
| 293 | collect2: ld terminated with signal 11 [Segmentation fault], core dumped |
| 294 | ``` |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 295 | |
brettw | c25693b3 | 2016-05-26 01:11:52 | [diff] [blame] | 296 | you are probably running out of memory when linking. You *must* use a 64-bit |
| 297 | system to build. Try the following build settings (see [GN build |
| 298 | configuration](https://www.chromium.org/developers/gn-build-configuration) for |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 299 | other settings): |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 300 | |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 301 | * Build in release mode (debugging symbols require more memory): |
brettw | c25693b3 | 2016-05-26 01:11:52 | [diff] [blame] | 302 | `is_debug = false` |
sdy | 93387fa | 2016-12-01 01:03:44 | [diff] [blame] | 303 | * Turn off symbols: `symbol_level = 0` |
| 304 | * Build in component mode (this is for development only, it will be slower and |
| 305 | may have broken functionality): `is_component_build = true` |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 306 | |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 307 | ### More links |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 308 | |
brettw | c25693b3 | 2016-05-26 01:11:52 | [diff] [blame] | 309 | * Information about [building with Clang](clang.md). |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 310 | * You may want to [use a chroot](using_a_linux_chroot.md) to |
| 311 | isolate yourself from versioning or packaging conflicts. |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 312 | * Cross-compiling for ARM? See [LinuxChromiumArm](linux_chromium_arm.md). |
| 313 | * Want to use Eclipse as your IDE? See |
| 314 | [LinuxEclipseDev](linux_eclipse_dev.md). |
dpranke | 0ae7cad | 2016-11-30 07:47:58 | [diff] [blame] | 315 | * Want to use your built version as your default browser? See |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 316 | [LinuxDevBuildAsDefaultBrowser](linux_dev_build_as_default_browser.md). |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 317 | |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 318 | ## Next Steps |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 319 | |
| 320 | If you want to contribute to the effort toward a Chromium-based browser for |
| 321 | Linux, please check out the [Linux Development page](linux_development.md) for |
| 322 | more information. |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 323 | |
| 324 | ## Notes for other distros <a name="notes"></a> |
| 325 | |
| 326 | ### Arch Linux |
| 327 | |
| 328 | Instead of running `install-build-deps.sh` to install build dependencies, run: |
| 329 | |
| 330 | ```shell |
| 331 | $ sudo pacman -S --needed python perl gcc gcc-libs bison flex gperf pkgconfig \ |
| 332 | nss alsa-lib gconf glib2 gtk2 nspr ttf-ms-fonts freetype2 cairo dbus \ |
| 333 | libgnome-keyring |
| 334 | ``` |
| 335 | |
| 336 | For the optional packages on Arch Linux: |
| 337 | |
| 338 | * `php-cgi` is provided with `pacman` |
| 339 | * `wdiff` is not in the main repository but `dwdiff` is. You can get `wdiff` |
| 340 | in AUR/`yaourt` |
| 341 | * `sun-java6-fonts` do not seem to be in main repository or AUR. |
| 342 | |
| 343 | ### Debian |
| 344 | |
thomasanderson | b4a2bca | 2016-12-08 06:46:05 | [diff] [blame] | 345 | Some tests require the `ttf-mscorefonts-installer` package from the `contrib` |
| 346 | component. `contrib` packages may have dependencies on non-free software. |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 347 | |
thomasanderson | b4a2bca | 2016-12-08 06:46:05 | [diff] [blame] | 348 | If you need to run tests requiring MS TTF fonts, you can edit your apt |
| 349 | `sources.list` by adding `contrib` to the end of each line beginning with `deb`. |
| 350 | You might end up with something like this: |
| 351 | |
| 352 | ``` |
| 353 | deb http://ftp.us.debian.org/debian/ jessie main contrib |
| 354 | deb-src http://ftp.us.debian.org/debian/ jessie main contrib |
| 355 | |
| 356 | deb http://security.debian.org/ jessie/updates main contrib |
| 357 | deb-src http://security.debian.org/ jessie/updates main contrib |
| 358 | |
| 359 | # jessie-updates, previously known as 'volatile' |
| 360 | deb http://ftp.us.debian.org/debian/ jessie-updates main contrib |
| 361 | deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib |
| 362 | ``` |
| 363 | |
| 364 | Next, run: |
| 365 | |
| 366 | ``` shell |
| 367 | $ sudo apt-get update |
| 368 | $ sudo apt-get install ttf-mscorefonts-installer |
| 369 | ``` |
| 370 | |
| 371 | If you already have the `contrib` component enabled, `install-build-deps.sh` |
| 372 | will install `ttf-mscorefonts-installer` for you. |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 373 | |
| 374 | ### Fedora |
| 375 | |
| 376 | Instead of running `build/install-build-deps.sh`, run: |
| 377 | |
| 378 | ```shell |
| 379 | su -c 'yum install git python bzip2 tar pkgconfig atk-devel alsa-lib-devel \ |
| 380 | bison binutils brlapi-devel bluez-libs-devel bzip2-devel cairo-devel \ |
| 381 | cups-devel dbus-devel dbus-glib-devel expat-devel fontconfig-devel \ |
| 382 | freetype-devel gcc-c++ GConf2-devel glib2-devel glibc.i686 gperf \ |
| 383 | glib2-devel gtk2-devel gtk3-devel java-1.*.0-openjdk-devel libatomic \ |
| 384 | libcap-devel libffi-devel libgcc.i686 libgnome-keyring-devel libjpeg-devel \ |
| 385 | libstdc++.i686 libX11-devel libXScrnSaver-devel libXtst-devel \ |
| 386 | libxkbcommon-x11-devel ncurses-compat-libs nspr-devel nss-devel pam-devel \ |
| 387 | pango-devel pciutils-devel pulseaudio-libs-devel zlib.i686 httpd mod_ssl \ |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 388 | php php-cli python-psutil wdiff xorg-x11-server-Xvfb' |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 389 | ``` |
| 390 | |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 391 | The fonts needed by Blink's LayoutTests can be obtained by following [these |
| 392 | instructions](https://gist.github.com/pwnall/32a3b11c2b10f6ae5c6a6de66c1e12ae). |
| 393 | For the optional packages: |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 394 | |
| 395 | * `php-cgi` is provided by the `php-cli` package. |
Victor Costan | 44af72b | 2017-11-13 20:01:30 | [diff] [blame] | 396 | * `sun-java6-fonts` is covered by the instructions linked above. |
dpranke | 2989a78 | 2016-12-02 02:57:12 | [diff] [blame] | 397 | |
| 398 | ### Gentoo |
| 399 | |
| 400 | You can just run `emerge www-client/chromium`. |
| 401 | |
| 402 | ### Mandriva |
| 403 | |
| 404 | Instead of running `build/install-build-deps.sh`, run: |
| 405 | |
| 406 | ```shell |
| 407 | urpmi lib64fontconfig-devel lib64alsa2-devel lib64dbus-1-devel \ |
| 408 | lib64GConf2-devel lib64freetype6-devel lib64atk1.0-devel lib64gtk+2.0_0-devel \ |
| 409 | lib64pango1.0-devel lib64cairo-devel lib64nss-devel lib64nspr-devel g++ python \ |
| 410 | perl bison flex subversion gperf |
| 411 | ``` |
| 412 | |
| 413 | * `msttcorefonts` are not available, you will need to build your own (see |
| 414 | instructions, not hard to do, see |
| 415 | [mandriva_msttcorefonts.md](mandriva_msttcorefonts.md)) or use `drakfont` to |
| 416 | import the fonts from a Windows installation. |
| 417 | |
| 418 | ### OpenSUSE |
| 419 | |
| 420 | Use `zypper` command to install dependencies: |
| 421 | |
| 422 | (openSUSE 11.1 and higher) |
| 423 | |
| 424 | ```shell |
| 425 | sudo zypper in subversion pkg-config python perl \ |
| 426 | bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \ |
| 427 | wdiff lighttpd gcc gcc-c++ gconf2-devel mozilla-nspr \ |
| 428 | mozilla-nspr-devel php5-fastcgi alsa-devel libexpat-devel \ |
| 429 | libjpeg-devel libbz2-devel |
| 430 | ``` |
| 431 | |
| 432 | For 11.0, use `libnspr4-0d` and `libnspr4-dev` instead of `mozilla-nspr` and |
| 433 | `mozilla-nspr-devel`, and use `php5-cgi` instead of `php5-fastcgi`. And need |
| 434 | `gtk2-devel`. |
| 435 | |
| 436 | (openSUSE 11.0) |
| 437 | |
| 438 | ```shell |
| 439 | sudo zypper in subversion pkg-config python perl \ |
| 440 | bison flex gperf mozilla-nss-devel glib2-devel gtk-devel \ |
| 441 | libnspr4-0d libnspr4-dev wdiff lighttpd gcc gcc-c++ libexpat-devel \ |
| 442 | php5-cgi gconf2-devel alsa-devel gtk2-devel jpeg-devel |
| 443 | ``` |
| 444 | |
| 445 | The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used. |
| 446 | Since this package requires Java as a prerequisite anyway, we can do the same |
| 447 | thing by just installing the equivalent openSUSE Sun Java package: |
| 448 | |
| 449 | ```shell |
| 450 | sudo zypper in java-1_6_0-sun |
| 451 | ``` |
| 452 | |
| 453 | WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper` |
| 454 | |
| 455 | ```shell |
| 456 | sudo zypper in fetchmsttfonts pullin-msttf-fonts |
| 457 | ``` |
| 458 | |
| 459 | To make the fonts installed above work, as the paths are hardcoded for Ubuntu, |
| 460 | create symlinks to the appropriate locations: |
| 461 | |
| 462 | ```shell |
| 463 | sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts |
| 464 | sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf |
| 465 | sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf |
| 466 | sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf |
| 467 | sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf |
| 468 | sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf |
| 469 | sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf |
| 470 | sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf |
| 471 | sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf |
| 472 | sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf |
| 473 | sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf |
| 474 | sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf |
| 475 | sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf |
| 476 | sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf |
| 477 | sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf |
| 478 | sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf |
| 479 | sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf |
| 480 | sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf |
| 481 | sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf |
| 482 | sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf |
| 483 | ``` |
| 484 | |
| 485 | The Ubuntu package `sun-java6-fonts` contains a subset of Java of the fonts used. |
| 486 | Since this package requires Java as a prerequisite anyway, we can do the same |
| 487 | thing by just installing the equivalent openSUSE Sun Java package: |
| 488 | |
| 489 | ```shell |
| 490 | sudo zypper in java-1_6_0-sun |
| 491 | ``` |
| 492 | |
| 493 | WebKit is currently hard-linked to the Microsoft fonts. To install these using `zypper` |
| 494 | |
| 495 | ```shell |
| 496 | sudo zypper in fetchmsttfonts pullin-msttf-fonts |
| 497 | ``` |
| 498 | |
| 499 | To make the fonts installed above work, as the paths are hardcoded for Ubuntu, |
| 500 | create symlinks to the appropriate locations: |
| 501 | |
| 502 | ```shell |
| 503 | sudo mkdir -p /usr/share/fonts/truetype/msttcorefonts |
| 504 | sudo ln -s /usr/share/fonts/truetype/arial.ttf /usr/share/fonts/truetype/msttcorefonts/Arial.ttf |
| 505 | sudo ln -s /usr/share/fonts/truetype/arialbd.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf |
| 506 | sudo ln -s /usr/share/fonts/truetype/arialbi.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf |
| 507 | sudo ln -s /usr/share/fonts/truetype/ariali.ttf /usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf |
| 508 | sudo ln -s /usr/share/fonts/truetype/comic.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf |
| 509 | sudo ln -s /usr/share/fonts/truetype/comicbd.ttf /usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf |
| 510 | sudo ln -s /usr/share/fonts/truetype/cour.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf |
| 511 | sudo ln -s /usr/share/fonts/truetype/courbd.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf |
| 512 | sudo ln -s /usr/share/fonts/truetype/courbi.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf |
| 513 | sudo ln -s /usr/share/fonts/truetype/couri.ttf /usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf |
| 514 | sudo ln -s /usr/share/fonts/truetype/impact.ttf /usr/share/fonts/truetype/msttcorefonts/Impact.ttf |
| 515 | sudo ln -s /usr/share/fonts/truetype/times.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf |
| 516 | sudo ln -s /usr/share/fonts/truetype/timesbd.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf |
| 517 | sudo ln -s /usr/share/fonts/truetype/timesbi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf |
| 518 | sudo ln -s /usr/share/fonts/truetype/timesi.ttf /usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf |
| 519 | sudo ln -s /usr/share/fonts/truetype/verdana.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana.ttf |
| 520 | sudo ln -s /usr/share/fonts/truetype/verdanab.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf |
| 521 | sudo ln -s /usr/share/fonts/truetype/verdanai.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf |
| 522 | sudo ln -s /usr/share/fonts/truetype/verdanaz.ttf /usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf |
| 523 | ``` |
| 524 | |
| 525 | And then for the Java fonts: |
| 526 | |
| 527 | ```shell |
| 528 | sudo mkdir -p /usr/share/fonts/truetype/ttf-lucida |
| 529 | sudo find /usr/lib*/jvm/java-1.6.*-sun-*/jre/lib -iname '*.ttf' -print \ |
| 530 | -exec ln -s {} /usr/share/fonts/truetype/ttf-lucida \; |
| 531 | ``` |