1Linux
2=====
3
4Quickstart
5----------
6
7<!--?prettify lang=sh?-->
8
9
10    # Install depot_tools (this provides ninja and git-cl).
11    git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
12    export PATH="${PWD}/depot_tools:${PATH}"
13
14    # Get Skia.
15    git clone 'https://skia.googlesource.com/skia'
16    cd skia
17
18    # Install Dependencies (may require sudo).
19    tools/install_dependencies.sh
20
21    # Sync, Config, and Build.
22    bin/sync-and-gyp
23    ninja -C out/Debug dm SampleApp
24
25    # Run DM, the Skia test app.
26    out/Debug/dm
27
28    # Run SampleApp.
29    out/Debug/SampleApp
30
31    # Run nanobench, the Skia benchmarking tool.
32    ninja -C out/Release nanobench
33    out/Release/nanobench
34
35
36<a name="prerequisites"></a>Prerequisites
37-----------------------------------------
38
39On a Ubuntu 12.04 (Precise) or Ubuntu 14.04 (Trusty) system, you can run
40`tools/install_dependencies.sh`, which will install the needed packages.  On
41Ubuntu 12.04, you will need to install the`ninja` build tool separately, which
42comes with Chromium's `depot_tools`.
43
44To contribute changes back to Skia, you will need `git-cl`, which
45comes with Chromium's `depot_tools`.
46
47(If you use another Linux distribution, please consider contributing back
48instructions for installing the required packages — we can then incorporate
49that knowledge into the `tools/install_dependencies.sh` tool.)
50
51Make sure the following have been installed:
52
53*   [Chromium depot_tools](http://www.chromium.org/developers/how-tos/depottools)
54
55*   A C++ compiler (typically GCC or Clang) **build-essential** or **clang-3.6**
56
57*   Python 2.7.x: **python2.7-dev**
58
59*   The FreeType and Fontconfig font engines: **libfreetype6-dev** and
60    **libfontconfig1-dev**
61
62*   Mesa OpenGL utility library headers: **libglu1-mesa-dev**
63
64*   Mesa headers: **mesa-common-dev**
65
66*   GL, such as **freeglut3-dev**
67
68*   QT4, used by the [Skia Debugger](/dev/tools/debugger): **libqt4-dev**
69
70Check out the source code
71-------------------------
72
73Follow the instructions [here](../download) for downloading the Skia source.
74
75Notes
76-----
77
781.  On 32-bit Linux (when `uname -m` is *not* `x86_64`), you will have to
79    explicitly specify the architecture:
80
81    <!--?prettify lang=sh?-->
82
83        GYP_DEFINES='skia_arch_type=x86' python bin/sync-and-gyp
842.  By default, many Linux systems use gcc by default.  To use clang you will
85need to [set the CC and CXX environment variables](/user/tips#gypdefines).
86
87Generate build files
88--------------------
89
90See  [this page for generating build files and run tests](desktop).
91