Skip to content
Dongseong Hwang edited this page Aug 2, 2013 · 42 revisions

Environment

Please setup the build environment by following the instructions in Chromium's wiki:

Additionally, make sure you have properly transferred your public SSH key(s) to GitHub. See this help page for more information.

Get the code

Before starting: Android

If you are building Crosswalk for Android, you should first set the XWALK_OS_ANDROID environment variable:

export XWALK_OS_ANDROID=1

Run gclient

Crosswalk uses gclient to manage the code and dependencies. To get gclient tool, you should install depot_tools.

Execute the following command to gclient auto-generate .gclient file.

gclient config --name=src/xwalk \
               ssh://[email protected]/otcshare/crosswalk.git@origin/master

At the same level of .gclient file, execute

gclient sync

to fetch all codes.

Build Instructions

We recommend to use ninja as build tool. Please refer to Ninja Build to setup the environment.

We use gyp to generate Crosswalk projects, go to src directory, execute

export GYP_GENERATORS='ninja'
python xwalk/gyp_xwalk

NOTE: We also enable aura for Tizen 3.0 build, instead execute:

python xwalk/gyp_xwalk -Duse_aura=1 -Duse_gconf=0 -Duse_xi2_mt=2

To build the launcher, execute:

ninja -C out/Release xwalk

To build the tests, execute:

ninja -C out/Release xwalk_unittest
ninja -C out/Release xwalk_browsertest

Build Instructions for Android

Setup enviroment for Android build

. xwalk/build/android/envsetup.sh --target-arch=x86

Generate Crosswalk projects, execute

 export GYP_GENERATORS='ninja'
 xwalk_android_gyp

To build xwalk shell, execute:

ninja -C out/Release xwalk_core_shell_apk

Building an RPM package for Tizen

Creating an RPM involves some additional work due to the way gbs works: it expects a single git repository with all files for it to run git archive. Crosswalk, on the other hand, contains several independent git and Subversion repositories in the same directory tree.

First of all, you need to create a separate, flat directory tree with all the files used by the project.

export XWALK_PREFIX=/root/of/xwalk/tree
cd $XWALK_PREFIX

gclient recurse --no-progress -j 1 \
                --gclientfile .gclient \
                $PWD/src/xwalk/packaging/generate-flat-tree.sh
gclient recurse --no-progress -j 1 \
                --gclientfile .gclient-xwalk \
                $PWD/src/xwalk/packaging/generate-flat-tree.sh

XWALK_PREFIX should point to the directory that contains the src/ directory. The calls to gclient recurse create a tarball called flat-xwalk-tree.tar in your top-level $XWALK_PREFIX directory.

After that, you should create a new git repository using the contents of the generated tarball.

mkdir tizen-package-root
cd tizen-package-root

tar -xf $XWALK_PREFIX/flat-xwalk-tree.tar
cp -R $XWALK_PREFIX/src/xwalk/packaging .

git init
git add .
git commit

What the commands above do are create a new git tree containing all the source files used by Crosswalk, put the packaging/ directory in it and commit.

After that, gbs can be run as usual:

gbs build -A i586 --threads=[your cpu core number + 1]

By default, the generated RPM files should be in ~/GBS-ROOT/local/repos/<repository name>/i586/RPMS.

CAUTION!

  • don't link symbolic your GBS-ROOT. It guides you hellgate.
  • the GBS root has to be on the same partition as the /
Clone this wiki locally