Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit 0468303

Browse files
committed
Update the build instructions for 2.1 (issue #12970
1 parent fac9b28 commit 0468303

File tree

2 files changed

+37
-34
lines changed

2 files changed

+37
-34
lines changed

_posts/documentation/get-started/2000-01-01-download.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ Binary packages are available via pkg:
3939

4040
`$ sudo pkg install phantomjs`
4141

42-
You can also build PhantomJS yourself from the FreeBSD Ports Collection: [https://svnweb.freebsd.org/ports/head/lang/phantomjs/](https://svnweb.freebsd.org/ports/head/lang/phantomjs/)
43-
4442
## Source Code
4543

4644
Check the official git repository [github.com/ariya/phantomjs](https://github.com/ariya/phantomjs/).

_posts/documentation/get-started/2000-01-02-build.md

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,21 @@ categories: docs docs-get-started
55
permalink: build.html
66
---
77

8-
**Warning**: Compiling PhantomJS from source takes a long time, mainly due to thousands of files in the WebKit module. With 4 parallel compile jobs on a modern machine, the entire process takes roughly 30 minutes. It is highly recommended to download and install the ready-made [binary package]({{ site.url }}/download.html) if it is available.
8+
Unless it is absolutely necessary to build PhantomJS from source, it is highly recommended to download and install the ready-made [binary package]({{ site.url }}/download.html) instead.
99

10-
**System Requirements**: Approximately 4 GB of RAM and 3 GB of disk is required for the compilation process.
10+
## Requirements
1111

12-
**Note**: If the compilation process is interrupted, once started again the `build.py` script will continue where left off.
12+
### Hardware requirements
1313

14-
## Mac OS X
14+
* RAM: at least 4 GB
15+
* Disk space: at least 3 GB
16+
* CPU: 1.8 GHz, 4 cores or more
1517

16-
Install [Xcode](https://developer.apple.com/xcode/) and the necessary SDK for development (gcc, various tools, libraries, etc).
17-
You also need to install OpenSSL via [Homebrew](http://brew.sh/) or via [MacPorts](https://www.macports.org/)
18+
PhantomJS is still a web browser, albeit headless. Thus, building it from source takes a long time (mainly due to thousands of files in the WebKit module). Estimated build time for a 4-core system is 30 minutes.
1819

19-
```bash
20-
git clone --recurse-submodules git://github.com/ariya/phantomjs.git
21-
cd phantomjs
22-
./build.py --qt-config "-I /usr/local/include/ -L /usr/local/lib/"
23-
```
24-
25-
This produces a statically built `bin/phantomjs`. This is a self-contained executable, it can be moved to a different directory or another machine.
20+
### Linux requirements
2621

27-
## Linux
28-
29-
First, install the development packages of the following tools and libraries: GNU C++ compiler, bison, flex, gperf, Perl, Ruby, SQLite, FreeType, FontConfig, OpenSSL, and ICU. The actual package names may vary from one distribution to another.
22+
First, install the development packages of the following tools and libraries: GNU C++ compiler, bison, flex, gperf, Perl, Ruby, SQLite, FreeType, Fontconfig, OpenSSL, and ICU. The actual package names may vary from one distribution to another.
3023

3124
On Debian-based distro (tested on Ubuntu 14.04 and Debian 7.0), run:
3225

@@ -46,32 +39,44 @@ sudo yum -y install gcc gcc-c++ make flex bison gperf ruby \
4639
libpng-devel libjpeg-devel
4740
```
4841

49-
Then, launch the build:
42+
### Windows requirements
5043

51-
```bash
52-
git clone --recurse-submodules git://github.com/ariya/phantomjs.git
53-
cd phantomjs
54-
./build.py
55-
```
44+
Supported toolchains: `MSVC2012` and `MSVC2013`.
5645

57-
**Note**: `build.py` by default will launch parallel compile jobs depending on the available CPU cores, e.g. 4 jobs on a modern hyperthreaded dual-core processor. If necessary, e.g. when building on a virtual machine/server or other limited environment, reduce the jobs by passing a number, e.g `./build.py --jobs 1` to set only one compile job at a time.
46+
You must have Perl, Python, Ruby, and Git on PATH. Also, note that Git comes with it's own version of `perl.exe`. If you have both Git and a separate perl installation in your PATH, please make sure that you separate Perl install's `bin` folder comes before the git's `bin` folder in your PATH.
5847

59-
This produces a build `bin/phantomjs`. This is an executable; it can be moved to a different directory (e.g. /usr/local/bin) or another machine.
48+
Run the build script from Visual Studio Command Prompt.
6049

61-
## Windows
50+
**Tip**: Enabling incremental linking will make the linkage process faster.
6251

63-
**Note**: Supported toolchains: `MSVC2012` and `MSVC2013`.
52+
### OS X requirements
6453

65-
**Note**: You must have Perl, Python, Ruby, and Git on PATH. Also, note that Git comes with it's own version of perl.exe. If you have both Git and a separate perl installation in your PATH, please make sure that you separate perl install bin folder comes before the git bin folder in your PATH variable.
54+
* [Xcode](https://developer.apple.com/xcode/) and the necessary SDK for development (gcc, various tools, libraries, etc)
55+
* OpenSSL via [Homebrew](http://brew.sh/) or via [MacPorts](https://www.macports.org/)
6656

67-
Use Visual Studio Command Prompt, run in the top directory. The results will go into `bin`:
57+
### FreeBSD requirements
58+
59+
Build PhantomJS from the FreeBSD Ports Collection: [svnweb.freebsd.org/ports/head/lang/phantomjs/](https://svnweb.freebsd.org/ports/head/lang/phantomjs/)
60+
61+
## Getting the Code
62+
63+
To obtain the code using [Git](http://git-scm.com/) from the official repository [github.com/ariya/phantomjs](https://github.com/ariya/phantomjs/):
6864

6965
```bash
70-
git clone --recurse-submodules git://github.com/ariya/phantomjs.git
66+
git clone git://github.com/ariya/phantomjs.git
7167
cd phantomjs
72-
build.py
68+
git checkout 2.1.1
69+
git submodule init
70+
git submodule update
71+
```
72+
## Compile and Link
73+
74+
From the code checkout:
75+
76+
```bash
77+
python build.py
7378
```
7479

75-
**Note**: Enabling incremental linking will make the linkage process faster.
80+
This will take some time. Once it is completed, the executable will be available under the `bin` subdirectory.
7681

77-
This produces a static build `bin/phantomjs.exe`. This is a self-contained executable, it can be moved to a different directory or another machine.
82+
**Tip**: If the compilation process is interrupted, once started again the `build.py` script will continue where left off.

0 commit comments

Comments
 (0)