Skip to content

Instantly share code, notes, and snippets.

@arjenschol
Created June 4, 2014 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjenschol/6b4bb06486e2ea77a20a to your computer and use it in GitHub Desktop.
Save arjenschol/6b4bb06486e2ea77a20a to your computer and use it in GitHub Desktop.
HHVM 3.1.0 PKGBUILD
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Spider.007 <aur.archlinux.org@spider007.net>
# Contributor: James Miller <james@pocketrent.com>
pkgname=hhvm
pkgver=3.1.0
pkgrel=1
pkgdesc="Virtual Machine, Runtime, and JIT for PHP"
arch=('x86_64')
url="http://hhvm.com"
license=('PHP')
depends=('boost-libs' 'google-glog' 'libmysqlclient' 'libmemcached' 'pcre' 'gd'
'libxml2' 'libxslt' 'intel-tbb' 'libmcrypt' 'oniguruma' 'jemalloc' 'curl' 'imap'
'libdwarf' 'libunwind' 'imagemagick' 'libedit')
makedepends=('git' 'cmake' 'gcc' 'chrpath' 'boost' 'double-conversion' 'google-gflags' 'python2')
source=("https://github.com/facebook/hhvm/archive/HHVM-$pkgver.tar.gz"
'git+https://github.com/hhvm/hhvm-third-party.git#commit=5baba1bca65cb10531fa959bd997b3715698902d'
'git+https://github.com/facebook/folly'
'git+https://github.com/libevent/libevent.git#tag=release-1.4.14b-stable'
'hhvm.tmpfile'
'hhvm@.service'
'static.mime-types.hdf'
'default.hdf'
'server.hdf')
install=hhvm.install
backup=(etc/hhvm/{conf.d/default,conf.d/static.mime-types,server}.hdf)
prepare() {
cd "$srcdir"/hhvm-third-party/
git submodule init
git config submodule.folly $srcdir/folly
git submodule update
cd "$srcdir"/$pkgname-HHVM-$pkgver/
rmdir third-party ; ln -s $srcdir/hhvm-third-party ./third-party
# fix freetype includes path
sed 's|#include <freetype/config/ftheader.h>|#include <freetype2/config/ftheader.h>|' \
-i hphp/runtime/ext/gd/libgd/gdft.cpp
cd "$srcdir/libevent"
patch -p1 -i "$srcdir"/$pkgname-HHVM-$pkgver/third-party/libevent-1.4.14.fb-changes.diff
# replace hashbang 'python' with 'python2'
sed '1 s/\bpython\b/python2/' -i event_rpcgen.py
# git fix
cd "$srcdir"
mkdir -p bin
[ ! -f bin/git ] && ln -s /usr/bin/false bin/git || true
}
build() {
cd "$srcdir/libevent"
msg2 "Building Custom Libevent"
./autogen.sh
./configure --prefix="$srcdir" --disable-shared
make
make install
cd "$srcdir"/$pkgname-HHVM-$pkgver/
msg2 "Building hhvm"
export PATH="$srcdir/bin:$PATH" # git fix
export HPHP_HOME="$PWD"
# comment for tests
HPHP_NOTEST=1 \
INCLUDE=/usr/include/libdwarf \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH="$srcdir" \
-DFREETYPE_INCLUDE_DIRS:PATH=/usr/include/freetype2 \
-DLIBDWARF_HAVE_ENCODE_LEB128:INTERNAL=1 \
.
make
# needs pfff
# for hacktool in hackificator remove_soft_types; do
# cd "$srcdir"/$pkgname-HHVM-$pkgver/hphp/hack/tools/$hacktool
# make depend
# make
# done
}
package() {
#cd "$srcdir"/$pkgname
cd "$srcdir"/$pkgname-HHVM-$pkgver/
make DESTDIR="$pkgdir/" install
rm -rf "$pkgdir"/usr/{lib,include}
# cd hphp/hack/bin
# for bin in hh_*; do
# install -Dm755 $bin "$pkgdir"/usr/bin/$bin
# done
cd "$srcdir"
install -Dm644 hhvm.tmpfile "$pkgdir"/usr/lib/tmpfiles.d/hhvm.conf
install -Dm644 hhvm@.service "$pkgdir"/usr/lib/systemd/system/hhvm@.service
install -Dm644 static.mime-types.hdf "$pkgdir"/etc/hhvm/conf.d/static.mime-types.hdf
install -Dm644 default.hdf "$pkgdir"/etc/hhvm/conf.d/default.hdf
install -Dm644 server.hdf "$pkgdir"/etc/hhvm/server.hdf
install -dm755 -o http "$pkgdir"/var/log/hhvm
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment