2015-03-18 01:32:10 +01:00
|
|
|
{ stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, libmemcached, pcre
|
2016-08-26 01:21:49 +02:00
|
|
|
, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php
|
2015-06-27 02:19:12 +02:00
|
|
|
, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
|
2014-06-10 13:12:12 +02:00
|
|
|
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
|
2015-03-18 01:32:10 +01:00
|
|
|
, libxslt, ocaml, freetype, gdb, git, perl, mariadb, gmp, libyaml, libedit
|
2017-08-30 19:40:20 +02:00
|
|
|
, libvpx, imagemagick, fribidi, gperf, which
|
2014-06-10 13:12:12 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hhvm-${version}";
|
2017-08-30 19:40:20 +02:00
|
|
|
version = "3.21";
|
2014-06-10 13:12:12 +02:00
|
|
|
|
2014-12-12 17:05:08 +01:00
|
|
|
# use git version since we need submodules
|
2014-06-10 13:12:12 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/facebook/hhvm.git";
|
2017-08-30 19:40:20 +02:00
|
|
|
rev = "56483773e2edd9e61782f1901ce40e47959e71b8";
|
|
|
|
sha256 = "0dmdk98nv04m0fv6909gfbsxqlkckn369yi7kadhir0r7vxsj7wa";
|
2014-06-10 13:12:12 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
2016-08-01 17:46:30 +02:00
|
|
|
[ cmake pkgconfig boost libunwind mariadb.client libmemcached pcre gdb git perl
|
2014-09-19 19:56:08 +02:00
|
|
|
libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
|
|
|
|
oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
|
2015-06-27 02:19:12 +02:00
|
|
|
libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml libkrb5
|
2017-08-30 19:40:20 +02:00
|
|
|
gmp libyaml libedit libvpx imagemagick fribidi gperf which
|
2014-06-10 13:12:12 +02:00
|
|
|
];
|
|
|
|
|
2017-08-29 17:13:32 +02:00
|
|
|
patches = [
|
|
|
|
./flexible-array-members-gcc6.patch
|
|
|
|
];
|
|
|
|
|
2016-03-30 22:17:59 +02:00
|
|
|
enableParallelBuilding = false; # occasional build problems;
|
2014-06-10 13:12:12 +02:00
|
|
|
dontUseCmakeBuildDir = true;
|
|
|
|
NIX_LDFLAGS = "-lpam -L${pam}/lib";
|
|
|
|
|
2014-06-26 21:44:39 +02:00
|
|
|
# work around broken build system
|
2016-04-16 18:52:29 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2";
|
2014-06-26 21:44:39 +02:00
|
|
|
|
2017-03-06 12:25:43 +01:00
|
|
|
# the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
|
|
|
|
# (setting it to an absolute path causes include files to go to $out/$out/include,
|
|
|
|
# because the absolute path is interpreted with root at $out).
|
|
|
|
cmakeFlags = "-DCMAKE_INSTALL_INCLUDEDIR=include";
|
|
|
|
|
2014-12-12 17:05:08 +01:00
|
|
|
prePatch = ''
|
2014-07-20 02:44:08 +02:00
|
|
|
substituteInPlace ./configure \
|
|
|
|
--replace "/usr/bin/env bash" ${stdenv.shell}
|
2017-08-30 19:40:20 +02:00
|
|
|
substituteInPlace ./third-party/ocaml/CMakeLists.txt \
|
|
|
|
--replace "/bin/bash" ${stdenv.shell}
|
2016-03-20 21:06:28 +01:00
|
|
|
perl -pi -e 's/([ \t(])(isnan|isinf)\(/$1std::$2(/g' \
|
|
|
|
hphp/runtime/base/*.cpp \
|
|
|
|
hphp/runtime/ext/std/*.cpp \
|
|
|
|
hphp/runtime/ext_zend_compat/php-src/main/*.cpp \
|
|
|
|
hphp/runtime/ext_zend_compat/php-src/main/*.h
|
|
|
|
patchShebangs .
|
2014-06-10 13:12:12 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|