aeberhardo / phantomjs-linux-armv6l

PhantomJS compiled on a Raspberry PI (Raspbian "wheezy").
93 stars 17 forks source link

phantomjs-linux-armv6l

PhantomJS 1.9, compiled on Raspberry PI (Raspbian "wheezy").

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. (http://phantomjs.org).

Installation on Raspberry PI

Download the archive and extract the binary:

$ cd /tmp
$ wget https://github.com/aeberhardo/phantomjs-linux-armv6l/archive/master.zip
$ unzip master.zip
$ cd phantomjs-linux-armv6l-master
$ bunzip2 *.bz2 && tar xf *.tar

The binary phantomjs is located in the bin directory:

$ ./phantomjs-1.9.0-linux-armv6l/bin/phantomjs --version
1.9.0

I achieved the best screenshot results with the following font configuration.

Caution: The following steps could mess up the font configuration for other applications!

$ cd /usr/share
$ sudo mv fonts fonts.bak
$ sudo mkdir fonts

$ sudo apt-get install --reinstall ttf-mscorefonts-installer

$ sudo rm /usr/share/fonts/truetype/msttcorefonts/andalemo.ttf
$ sudo rm /usr/share/fonts/truetype/msttcorefonts/Andale_Mono.ttf

$ sudo fc-cache -rv

Build Process

PhantomJS has been built using the process described below.

1. According to http://phantomjs.org/build.html :

$ sudo apt-get update
$ sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
$ git clone git://github.com/ariya/phantomjs.git
$ cd phantomjs
$ git checkout 1.9

2. Download additional 3rdparty files:

$ mkdir src/qt/src/3rdparty/pixman && pushd src/qt/src/3rdparty/pixman && curl -O http://qt.gitorious.org/qt/qt/blobs/raw/4.8/src/3rdparty/pixman/README && curl -O http://qt.gitorious.org/qt/qt/blobs/raw/4.8/src/3rdparty/pixman/pixman-arm-neon-asm.h && curl -O http://qt.gitorious.org/qt/qt/blobs/raw/4.8/src/3rdparty/pixman/pixman-arm-neon-asm.S; popd

3. Open ./build.sh and delete lines 11-34:

.. ...
11 if [[ "$MAKEFLAGS" != "" ]]; then
12 MAKEFLAGS_JOBS=$(echo $MAKEFLAGS | egrep -o '\-j[0-9]+' | egrep -o '[0-9]+')
.. ...
34 fi
.. ...

4. Open ./src/qt/preconfig.sh and add the option ' -no-pch' to QT_CFG after ' -no-stl':

.. ...
29 QT_CFG+=' -no-exceptions'       # Don't use C++ exception
30 QT_CFG+=' -no-stl'              # No need for STL compatibility
31 QT_CFG+=' -no-pch'
.. ...

5. Start compilation:

$ nohup ./build.sh --confirm > build.sh.out 2> build.sh.err &

6. Create tarball according to http://phantomjs.org/build.html :

./deploy/package.sh

7. The tarball can be found in the ./deploy directory.