2015-11-26 23:18:21 +03:00
# The Servo Parallel Browser Engine Project
2012-02-08 23:29:12 +04:00
2014-09-09 22:33:47 +04:00
Servo is a prototype web browser engine written in the
2015-04-09 06:10:42 +03:00
[Rust ](https://github.com/rust-lang/rust ) language. It is currently developed on
2015-04-06 19:46:22 +03:00
64bit OS X, 64bit Linux, Android, and Gonk (Firefox OS).
2012-08-18 06:41:22 +04:00
2013-10-14 19:28:11 +04:00
Servo welcomes contribution from everyone. See
2015-10-26 08:33:41 +03:00
[`CONTRIBUTING.md` ](CONTRIBUTING.md ) and [`HACKING_QUICKSTART.md` ](HACKING_QUICKSTART.md )
for help getting started.
2013-10-14 19:28:11 +04:00
2015-12-04 06:06:17 +03:00
Visit the [Servo Project page ](https://servo.org/ ) for news and guides.
2015-11-17 13:45:38 +03:00
2012-10-18 10:24:02 +04:00
## Prerequisites
2012-08-22 22:50:10 +04:00
On OS X (homebrew):
2012-05-11 02:20:26 +04:00
2013-04-04 20:49:08 +04:00
``` sh
servo: Merge #3991 - Update README for Homebrew (from Hoverbear:patch-1); r=jdm
glfw3 is in the `homebrew/versions` keg.
```bash
➜ ~ brew install glfw3
Error: No available formula for glfw3
Searching formulae...
Searching taps...
homebrew/versions/glfw3
```
Simplest fix:
```bash
➜ ~ brew install homebrew/versions/glfw3
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-versions'...
remote: Counting objects: 2495, done.
remote: Total 2495 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2495/2495), 820.05 KiB | 462.00 KiB/s, done.
Resolving deltas: 100% (1433/1433), done.
Checking connectivity... done.
Tapped 161 formulae
==> Installing glfw3 from homebrew/homebrew-versions
==> Downloading https://downloads.sourceforge.net/project/glfw/glfw/3.0.4/glfw-3.0.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/glfw3-3.0.4.tar.bz2
==> Patching
patching file CMakeLists.txt
Hunk #1 succeeded at 370 with fuzz 1 (offset 13 lines).
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/glfw3/3.0.4 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DGLFW_USE_CHDIR=TRUE -DGLFW_USE_MENUBAR=TRUE -DBUIL
==> make install
🍺 /usr/local/Cellar/glfw3/3.0.4: 11 files, 220K, built in 9 seconds
```
Users who have `homebrew/versions` already tapped won't notice this, since after tapping `homebrew/versions` keg shouldn't notice, since after tapping, the library is available using just ` brew install glfw3`.
```bash
➜ ~ brew tap
homebrew/versions
➜ ~ brew install glfw3
==> Installing glfw3 from homebrew/homebrew-versions
==> Downloading https://downloads.sourceforge.net/project/glfw/glfw/3.0.4/glfw-3.0.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/glfw3-3.0.4.tar.bz2
==> Patching
patching file CMakeLists.txt
Hunk #1 succeeded at 370 with fuzz 1 (offset 13 lines).
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/glfw3/3.0.4 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DGLFW_USE_CHDIR=TRUE -DGLFW_USE_MENUBAR=TRUE -DBUIL
==> make install
🍺 /usr/local/Cellar/glfw3/3.0.4: 11 files, 220K, built in 9 seconds
```
Source-Repo: https://github.com/servo/servo
Source-Revision: b9dcaa34c32333ae16da7a5f11835c7d905da4d3
2014-11-17 17:21:29 +03:00
brew install automake pkg-config python cmake
2014-08-05 17:31:21 +04:00
pip install virtualenv
2013-04-04 20:49:08 +04:00
```
2012-05-11 02:20:26 +04:00
2012-08-22 22:50:10 +04:00
On OS X (MacPorts):
2013-04-04 20:49:08 +04:00
``` sh
2014-10-22 03:05:51 +04:00
sudo port install python27 py27-virtualenv cmake
2013-04-04 20:49:08 +04:00
```
2014-08-05 17:31:21 +04:00
2012-05-11 02:20:26 +04:00
On Debian-based Linuxes:
2013-04-04 20:49:08 +04:00
``` sh
2014-09-09 22:33:47 +04:00
sudo apt-get install curl freeglut3-dev \
2014-03-01 04:40:38 +04:00
libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \
2015-09-16 18:39:10 +03:00
gperf g++ cmake python-virtualenv python-pip \
2015-07-30 05:42:22 +03:00
libssl-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev libglu1-mesa-dev
2013-04-04 20:49:08 +04:00
```
2015-09-02 08:31:34 +03:00
If you are on **Ubuntu 14.04** and encountered errors on installing these dependencies involving `libcheese` , see [#6158 ](https://github.com/servo/servo/issues/6158 ) for a workaround.
2012-05-11 02:20:26 +04:00
2014-07-07 23:09:01 +04:00
On Fedora:
2014-04-17 05:31:08 +04:00
``` sh
2015-05-22 23:33:08 +03:00
sudo dnf install curl freeglut-devel libtool gcc-c++ libXi-devel \
2014-08-27 00:12:42 +04:00
freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \
2015-09-16 18:39:10 +03:00
fontconfig-devel cabextract ttmkfdir python python-virtualenv python-pip expat-devel \
2015-05-04 01:29:05 +03:00
rpm-build openssl-devel cmake bzip2-devel libXcursor-devel libXmu-devel mesa-libOSMesa-devel
2014-04-17 05:31:08 +04:00
```
2014-09-06 13:17:27 +04:00
On Arch Linux:
``` sh
2015-09-16 18:39:10 +03:00
sudo pacman -S --needed base-devel git python2 python2-virtualenv python2-pip mesa cmake bzip2 libxmu
2014-09-06 13:17:27 +04:00
```
2015-10-03 00:56:31 +03:00
On Gentoo Linux:
```sh
sudo emerge net-misc/curl media-libs/freeglut \
media-libs/freetype media-libs/mesa dev-util/gperf \
dev-python/virtualenv dev-python/pip dev-libs/openssl \
x11-libs/libXmu media-libs/glu x11-base/xorg-server
```
2014-05-09 06:55:10 +04:00
Cross-compilation for Android:
2013-08-28 06:21:34 +04:00
2014-09-09 22:33:47 +04:00
Pre-installed Android tools are needed. See wiki for
2015-12-04 06:06:17 +03:00
[details ](https://github.com/servo/servo/wiki/Building-for-Android )
2013-08-28 06:21:34 +04:00
2015-04-12 22:31:02 +03:00
Using Virtualbox:
If you're running servo on a guest machine, make sure 3D Acceleration is switched off ([#5643](https://github.com/servo/servo/issues/5643))
2014-08-23 00:34:52 +04:00
## The Rust compiler
2015-05-19 18:45:31 +03:00
Servo's build system automatically downloads a snapshot Rust compiler to build itself.
This is normally a specific revision of Rust upstream, but sometimes has a
backported patch or two.
If you'd like to know the snapshot revision of Rust which we use, see
2015-07-22 21:25:57 +03:00
`rust-snapshot-hash` .
2013-01-10 06:52:17 +04:00
2012-10-18 10:24:02 +04:00
## Building
2012-05-06 03:51:26 +04:00
2014-09-09 22:33:47 +04:00
Servo is built with Cargo, the Rust package manager. We also use Mozilla's
Mach tools to orchestrate the build and other tasks.
### Normal build
2013-07-10 21:12:46 +04:00
2015-05-14 19:26:18 +03:00
To build Servo in development mode. This is useful for development, but
the resulting binary is very slow.
2013-04-04 20:49:08 +04:00
``` sh
2014-09-09 22:33:47 +04:00
git clone https://github.com/servo/servo
2013-04-04 20:49:08 +04:00
cd servo
2015-05-14 19:26:18 +03:00
./mach build --dev
2014-09-09 18:18:18 +04:00
./mach run tests/html/about-mozilla.html
2013-04-04 20:49:08 +04:00
```
2013-03-13 19:36:44 +04:00
2015-05-14 19:26:18 +03:00
For benchmarking, performance testing, or
2015-05-04 20:57:06 +03:00
real-world use, add the `--release` flag to create an optimized build:
``` sh
./mach build --release
./mach run --release tests/html/about-mozilla.html
```
2014-09-09 18:18:18 +04:00
### Building for Android target
2013-08-28 06:21:34 +04:00
``` sh
2014-09-09 22:33:47 +04:00
git clone https://github.com/servo/servo
2013-08-28 06:21:34 +04:00
cd servo
2014-10-04 01:45:28 +04:00
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android
2014-09-09 18:18:18 +04:00
cd ports/android
ANDROID_SDK=/path/to/sdk make install
2013-08-28 06:21:34 +04:00
```
2014-10-04 01:45:28 +04:00
Rather than setting the `ANDROID_*` environment variables every time, you can
also create a `.servobuild` file and then edit it to contain the correct paths
to the Android SDK/NDK tools:
```
cp servobuild.example .servobuild
# edit .servobuild
```
2013-07-10 21:12:46 +04:00
## Running
2015-02-28 20:33:52 +03:00
Use `./mach run [url]` to run Servo.
2013-07-10 21:12:46 +04:00
### Commandline Arguments
- `-p INTERVAL` turns on the profiler and dumps info to the console every
`INTERVAL` seconds
2014-12-08 20:28:10 +03:00
- `-s SIZE` sets the tile size for painting; defaults to 512
2013-10-23 00:52:14 +04:00
- `-z` disables all graphical output; useful for running JS / layout tests
2013-07-10 21:12:46 +04:00
### Keyboard Shortcuts
- `Ctrl--` zooms out
- `Ctrl-=` zooms in
- `Backspace` goes backwards in the history
- `Shift-Backspace` goes forwards in the history
2013-07-17 02:01:15 +04:00
- `Esc` exits servo
2013-07-10 21:12:46 +04:00
## Developing
2014-09-09 22:33:47 +04:00
There are lots of mach commands you can use. You can list them with `./mach
--help`.
2015-08-06 10:36:22 +03:00
The generated documentation can be found on http://doc.servo.org/servo/index.html