2014-06-26 19:44:39 +00:00
|
|
|
{ stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, mariadb, libmemcached, pcre
|
2014-06-10 11:12:12 +00:00
|
|
|
, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
|
|
|
|
, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog
|
|
|
|
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
|
2014-12-12 16:05:08 +00:00
|
|
|
, libxslt, ocaml, freetype, gdb
|
2014-06-10 11:12:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hhvm-${version}";
|
2014-12-12 16:05:08 +00:00
|
|
|
version = "3.3.0";
|
2014-06-10 11:12:12 +00:00
|
|
|
|
2014-12-12 16:05:08 +00:00
|
|
|
# use git version since we need submodules
|
2014-06-10 11:12:12 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/facebook/hhvm.git";
|
2014-12-12 16:05:08 +00:00
|
|
|
rev = "e0c98e21167b425dddf1fc9efe78c9f7a36db268";
|
|
|
|
sha256 = "0s32v713xgf4iim1zb9sg08sg1r1fs49czar3jxajsi0dwc0lkj9";
|
2014-06-10 11:12:12 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2014-12-13 14:22:31 +00:00
|
|
|
patches = [
|
|
|
|
./3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch
|
|
|
|
./8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch
|
|
|
|
];
|
|
|
|
|
2014-06-10 11:12:12 +00:00
|
|
|
buildInputs =
|
2014-12-12 16:05:08 +00:00
|
|
|
[ cmake pkgconfig boost libunwind mariadb libmemcached pcre gdb
|
2014-09-19 17:56:08 +00:00
|
|
|
libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
|
|
|
|
oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
|
2014-06-10 11:12:12 +00:00
|
|
|
libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
dontUseCmakeBuildDir = true;
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
NIX_LDFLAGS = "-lpam -L${pam}/lib";
|
|
|
|
USE_HHVM=1;
|
|
|
|
MYSQL_INCLUDE_DIR="${mariadb}/include/mysql";
|
|
|
|
MYSQL_DIR=mariadb;
|
|
|
|
|
2014-06-26 19:44:39 +00:00
|
|
|
# work around broken build system
|
|
|
|
NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2";
|
|
|
|
|
2014-12-12 16:05:08 +00:00
|
|
|
prePatch = ''
|
2014-06-10 11:12:12 +00:00
|
|
|
substituteInPlace hphp/util/generate-buildinfo.sh \
|
|
|
|
--replace /bin/bash ${stdenv.shell}
|
2014-07-20 00:44:08 +00:00
|
|
|
substituteInPlace ./configure \
|
|
|
|
--replace "/usr/bin/env bash" ${stdenv.shell}
|
2014-06-10 11:12:12 +00:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib
|
|
|
|
mv hphp/hhvm/hhvm $out/bin
|
|
|
|
mv hphp/hack/bin/hh_server $out/bin
|
|
|
|
mv hphp/hack/bin/hh_client $out/bin
|
|
|
|
mv hphp/hack/hhi $out/lib/hack-hhi
|
|
|
|
|
|
|
|
cat > $out/bin/hhvm-hhi-copy <<EOF
|
|
|
|
#!${stdenv.shell}
|
|
|
|
cp -R $out/lib/hack-hhi \$1
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/hhvm-hhi-copy
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "High-performance JIT compiler for PHP/Hack";
|
|
|
|
homepage = "http://hhvm.com";
|
|
|
|
license = "PHP/Zend";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|