Skip to content

Building and installing HHVM on Gentoo

Josh Watzman edited this page Jan 29, 2015 · 16 revisions

This ebuild is community-maintained and unsupported by the HHVM team. It may be outdated or broken.

Update repositories and install git

sudo emerge --sync
sudo emerge dev-vcs/git

Download and include portage overlay

sudo mkdir -p /usr/local/portage/javer
sudo git clone https://github.com/javer/gentoo-overlay.git /usr/local/portage/javer --depth=1
sudo cat >>/etc/portage/make.conf <<EOF
PORTDIR_OVERLAY="/usr/local/portage/javer \$PORTDIR_OVERLAY"
EOF

or

sudo wget -q -O /etc/layman/overlays/javer.xml https://raw.github.com/javer/gentoo-overlay/master/overlay.xml
sudo layman -S
sudo layman -a javer

Add necessary keywords

sudo cat >>/etc/portage/package.keywords <<EOF
dev-libs/isl ~amd64
dev-libs/cloog ~amd64
dev-libs/libdwarf ~amd64
EOF

If you want to use the latest version of HHVM (dev-master), you should add the following keyword:

sudo cat >>/etc/portage/package.keywords <<EOF
dev-php/hhvm ~amd64
EOF

Add necessary USE flags

sudo cat >>/etc/portage/package.use <<EOF
net-libs/c-client kerberos
dev-libs/jemalloc stats
EOF

Update gcc to 4.8.0 or newer

sudo cat >>/etc/portage/package.keywords <<EOF
sys-devel/gcc:4.8 ~amd64
EOF
sudo emerge gcc:4.8
sudo gcc-config x86_64-pc-linux-gnu-4.8.0
source /etc/profile

Build and install HHVM with all dependencies

Hint: Having enough memory can prevent some errors (RAM + swap >= 8 GiB)

sudo emerge hhvm

Adding HHVM server to default runlevel

sudo rc-update add hhvm default

Starting HHVM server

sudo /etc/init.d/hhvm start

Running HHVM in CLI mode

The hhvm run wrapper script can be found in /usr/bin/hhvm.

Clone this wiki locally