描述
这篇文档详细介绍了在标准linux环境(ubuntu 16.04 LTS)下怎么编译运行cobalt浏览器的源码
基本步骤
-
获取depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
获取depot_tools工具,用于编译浏览器;并把所在路径添加到PATH环境变量 -
下载安装一些必要的包用于编译运行源码
包括:
$ sudo apt-get install build-essential coreutils git gperf
libasound2-dev libavformat-dev libavresample-dev
libdirectfb-dev libdirectfb-extra libpulse-dev
libgl1-mesa-dev libgles2-mesa-dev libx11-dev
libxcomposite-dev libxcomposite1 libxrender-dev libxrender1
libxpm-dev m4 ruby tar xserver-xephyr xz-utils yasm -
安装标准C++头文件库
$ sudo apt-get install libstdc+±4.8-dev -
安装bison 3.0
$ sudo apt-get remove bison
$ cd /tmp
$ wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
$ tar zxf bison-3.0.tar.gz
$ cd bison-3.0
$ sh configure && make && sudo make install
$ which bison
/usr/local/bin/bison
$ bison --version
bison (GNU Bison) 3.0 -
到官网下载源码
$ git clone https://cobalt.googlesource.com/cobalt -
将下载Clang的目录放到环境变量
$ PATH="/path/to/cobalt/src/third_party/llvm-build/Release+Asserts/bin:$
{PATH}" -
编译部分:(在linux标准环境下建议使用x64x11平台)
$ cobalt/build/gyp_cobalt -C debug linux-x64x11
$ ninja -C out/linux-arm64wl_debug/ cobalt/ -
最后运行浏览器
$ out/linux-x64x11_debug/cobalt –url=https://qual-e.appspot.com/