Execute the following commands in whatever directory you want to hold the NaCl SDK directory:
wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip unzip nacl_sdk.zip rm nacl_sdk.zip nacl_sdk/naclsdk update pepper_32 export NACL_SDK_ROOT=/path/to/nacl_sdk
We use the “gclient” script (part of the depot_tools toolkit) to manage the Skia source code. Follow the instructions at http://www.chromium.org/developers/how-tos/depottools to get the gclient script from depot_tools.
Instead of checking out trunk directly you will use gclient to checkout the nacl directory, which will automatically pull the trunk directory for you. Execute the following commands in whatever directory you want to be the root for your Skia on NaCl development:
gclient config https://skia.googlesource.com/skia.git gclient sync
The nacl_make script is used to compile Skia targets for NaCl. It sets the appropriate environment variables, calls GYP to generate makefiles, and runs Make to build both 32 and 64-bit targets as required by NaCl. To build the Skia libraries, run the following from the trunk directory:
platform_tools/nacl/nacl_make skia_lib
This will result in a set of static libraries being built into the out/nacl32 and out/nacl64 directories. You can use these libraries in external NaCl apps.
It is possible to run some of Skia's console apps in the browser.
Build Skia tests from the trunk directory:
platform_tools/nacl/bin/nacl_make tests
This will build the tests executable. We include a tiny HTTP server (borrowed from the NaCl SDK) in order to run the apps:
cd platform_tools/nacl ./httpd.py
The HTTP server runs on port 5103 by default. In Chrome, navigate to http://localhost:5103/
and click on the link for “unit tests.” After the module downloads, you should see the tests begin to run.
The sample app relies on the GPU backend. Therefore, it will compile but will not yet run.
platform_tools/nacl/bin/nacl_make SampleApp
You can access the sample app at http://localhost:5103/SampleApp.
The debugger is currently in a partially-working state:
platform_tools/nacl/bin/nacl_make debugger
You can access it at http://localhost:5103/debugger.