-
Notifications
You must be signed in to change notification settings - Fork 121
Building the ExoBrowser
The ExoBrowser is based on both Chromium (Content API) and Node.JS, two very active opensource projects. To be able to properly integrate these two projects, we have to apply a few modifications to each. To keep track of these modifications, we use a patch for the chromium
repository (as we only alter a few files) and a specific forked branch for node
.
Steps 1 and 2 are identical for all systems (Linux, Mac and Windows).
The source code of the ExoBrowser being valid only in the context of chromium
and node
, for any given version of the ExoBrowser we need to be able to know which commit to checkout in both repositories. The DEPS Directory exists for this reason. It maintains a set of revision and patches needed to build the current state of the source code:
chromium.RELEASE # the release branch used for `chromium`
chromium.patch # the patch to apply on `chromium
node_exo_browser.HEAD # the commit to use for the exo_browser branch of `node`
node.HEAD # used internally to know on which commit of `node` the `exo_browser` branch is based
Whenever working with the ExoBrowser, you must have Chromium and NodeJS checked out at the revisions specified in the DEPS directory of the ExoBrowser revision you're working on.
We need the Chromium depot_tools
to work with Chromium source code. Please refer to Chromium: Install depot_tools for more information.
- create a project directory, say
mkdir exo_browser && cd exo_browser
- git clone
https://chromium.googlesource.com/chromium/tools/depot_tools.git
- add
depot_tools
to yourPATH
:export PATH="$PATH":`pwd`/depot_tools
- you can update your
.bashrc
file to avoid adding it to thePATH
each time you need it - If you haven't already: install git, subversion and git-svn (
apt-get install git subversion git-svn
).
Please refer to Chromium: Get The Code for more information about checking out Chromium. We're using the git workflow. node.patch
mkdir chromium && cd chromium
-
gclient config http://src.chromium.org/chrome/releases/XX.X.XXXX.XX/
(replace with value ofDEPS/chromium.RELEASE
) -
svn ls https://src.chromium.org/chrome && svn ls https://sctp-refimpl.googlecode.com/svn/trunk && svn ls https://cld2.googlecode.com/svn/trunk
and accept any certificates from *.googlecode.com permanently. -
gclient sync
(this may take some time. SVN read-access not needed) gclient runhooks
A new src/
directory should have been checked out in your chromium
directory. In the following src/
refers to the chromium/src
directory.
- clone
[email protected]:breach/exo_browser.git
insrc/
- in
src/third_party/
rungit clone -b exo_browser https://github.com/breach/node.git
- in
src/third_party/node/
,git reset --hard `cat ../../exo_browser/DEPS/node_exo_browser.HEAD`
You must be at the correct revision indicated in exo_browser/DEPS/chromium.HEAD
for this to work.
- in
src/
,patch -p0 -i exo_browser/DEPS/chromium.patch
Your tree is now ready for work!
We rely on Chromium cross-platform build tools (more specifically, gyp
). The following is for Linux. For more information on OS specific information see:
- Chromium: Linux Build Instructions
- Chromium: Mac Build Instructions
- Chromium: Windows Build Instructions
Additionally we use ninja
as our build system. See Chromium: Ninja Build for more information.
- run
src/build/install-build-deps.sh
- add
export GYP_GENERATORS='ninja'
to yourPATH
- you can update your
.bashrc
file to avoid adding it to thePATH
each time you build
- in
src/
, runbuild/gyp_chromium exo_browser/exo_browser.gyp
- in
src/third_party/node
, run./configure --ninja
or./configure --ninja --dest-cpu ia32
on OSX
This generates all the files needed to build the ExoBrowser (ninja, Makefile, XCode, ...) depending on your platform and configuration.
- in
src/
, runninja -C out/Debug exo_browser -j8
(this may take some time) - cd into
src/out/Debug/shell
andnpm install
- You should now be able to run the exo_browser binary in
src/out/Debug
Much more information can be found within the project Chromium itself. One goal is to make this very simple, so please open up an issue if you run into problems.
If you get the message Running without the SUID sandbox!
try exo_browser --no-sandbox or install the sandbox. In the latter case you may need to set the CHROME_DEVEL_SANDBOX environment variable (e.g., export CHROME_DEVEL_SANDBOX=/usr/lib/chromium/chrome-sandbox).
On Arch Linux you may run into several issues when installing Chromium. Three common issues are python version mismatch, linking with the gold linker, and using tcmalloc.
Arch ships with python3 and python2.7. First, you want to make sure that python links to python2.7 (e.g., create a symlink in your home directory and add that that to your PATH: ln -s /usr/bin/python2.7 $HOME/bin/python ; export PATH=$HOME/bin:$PATH
). Second, when you run the gclient hooks you want to tell the build system that you're using 2.7 and not 2.6. So, in step 5 of the Chromium install run GYP_DEFINES=python_ver=2.7 gclient runhooks
instead.
To address the other issues, you'll want to modify your gypi file to not use the gold linker or tcmalloc:
-
'linux_use_gold_flags%': 0
, -
'linux_use_gold_binary%': 0
, 'linux_use_tcmalloc': 0
If you're still running into issues, you may want to take a look at the patches that come with the PKGBUILD. You can get the latest with: yaourt -G chromium-dev
.
If you wish to do all of the above in one go, this script will automate that process.
export GYP_GENERATORS='ninja'
if [ `uname` == 'Darwin' ]; then
export GYP_DEFINES=mac_sdk=10.8
fi
echo 'p' | svn ls https://src.chromium.org/chrome
echo 'p' | svn ls https://sctp-refimpl.googlecode.com/svn/trunk
echo 'p' | svn ls https://cld2.googlecode.com/svn/trunk
mkdir chromium && cd chromium
CHROMIUM_PATH=`pwd`
git clone https://github.com/breach/exo_browser.git
gclient config `cat exo_browser/DEPS/chromium.RELEASE`
gclient sync
gclient runhooks
cd "$CHROMIUM_PATH/src" && mv ../exo_browser .
cd "$CHROMIUM_PATH/src/third_party" && git clone -b exo_browser https://github.com/breach/node.git
cd "$CHROMIUM_PATH/src/third_party/node" && git reset --hard `cat ../../exo_browser/DEPS/node_exo_browser.HEAD`
cd "$CHROMIUM_PATH/src" && patch -p0 -i exo_browser/DEPS/chromium.patch
cd "$CHROMIUM_PATH/src" && GYP_DEFINES=mac_sdk=10.7 build/gyp_chromium exo_browser/exo_browser.gyp
if [ `uname` == 'Darwin' ]; then
# if you get compile errors with pyobjc, depending on your python installation (brew, ports, manual)
# some combination of these may be need to be run:
# defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
# sudo /usr/bin/easy_install -U pyobjc
# pip install pyobjc
cd "$CHROMIUM_PATH/src/third_party/node" && ./configure --ninja --dest-cpu ia32
elif [ `uname` == 'Linux' ]; then
cd "$CHROMIUM_PATH/src/third_party/node" && ./configure --ninja
fi
cd "$CHROMIUM_PATH/src" && ninja -C out/Debug exo_browser -j8