<commit_before>{ stdenv, fetchurl, fetchgit, cmake, boost, libunwind, mysql, libmemcached, pcre
, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
, expat, libcap, oniguruma, libdwarf, libmcrypt, inteltbb, google_perftools
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam
}:

assert stdenv.system == "x86_64-linux";
let
  src = fetchgit {
    url = "git://github.com/facebook/hiphop-php.git";
    rev = "73f1c0ebd9b313f6b3baecd8c8046e0b595b1157";
    sha256 = "104133c6054bc9ab0288eaa0cea168b6699e537b3ea76ecdc38ee833d93dca09";
  };

  libxml2_280 = stdenv.lib.overrideDerivation libxml2 (args: rec { 
    name = "libxml2-2.8.0";

    src = fetchurl {
      url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
      sha256 = "0ak2mjwvanz91nwxf1kkgbhrkm85vhhkpj7ymz8r6lb84bix1qpj";
    };

    patches = [];
  });
 
  curlFB = stdenv.lib.overrideDerivation curl (args: { patches = [ "${src}/src/third_party/libcurl-7.22.1.fb-changes.diff" ]; });

  fbPatch = "${src}/src/third_party/libevent-1.4.14.fb-changes.diff";
  libeventFB = stdenv.lib.overrideDerivation libevent (args: { patches = [fbPatch]; });
in
stdenv.mkDerivation {
  name = "hiphop-php-73f1c0ebd9";
  inherit src;
  dontUseCmakeBuildDir = true;
  dontUseCmakeConfigure = true;
  USE_HHVM=1;
  preConfigure = ''
    export HPHP_HOME=$PWD
    export HPHP_LIB=$PWD/bin
    export TBB_INSTALL_DIR=${inteltbb}
    export TBB_ARCH_PLATFORM="intel64/cc4.1.0_libc2.4_kernel2.6.16.21"
    sed -i 's| DEPRECATED | DEPRECATED_ |' src/runtime/base/runtime_error.h
  '';
  NIX_LDFLAGS = "-lpam -L${pam}/lib";
  MYSQL_DIR=mysql;
  buildInputs = [ 
    cmake boost libunwind mysql libmemcached pcre libeventFB gd curlFB
    libxml2_280 icu flex bison openssl zlib php expat libcap oniguruma
    libdwarf libmcrypt inteltbb google_perftools bzip2 openldap readline
    libelf uwimap binutils cyrus_sasl pam
  ];
  installPhase = ''
    mkdir -p $out/bin
    cp src/hhvm/hhvm $out/bin
    cp bin/systemlib.php $out/bin
  '';
  patches = [./tbb.patch];

  meta = {
    description = "HipHop is a high performance PHP toolchain.";
    homepage = https://github.com/facebook/hiphop-php;
    platforms = stdenv.lib.platforms.linux;
  };
}<commit_msg>Only build hiphopvm on x86_64-linux.<commit_after>{ stdenv, fetchurl, fetchgit, cmake, boost, libunwind, mysql, libmemcached, pcre
, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
, expat, libcap, oniguruma, libdwarf, libmcrypt, inteltbb, google_perftools
, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam
}:
assert stdenv.system == "x86_64-linux";
let
  src = fetchgit {
    url = "git://github.com/facebook/hiphop-php.git";
    rev = "73f1c0ebd9b313f6b3baecd8c8046e0b595b1157";
    sha256 = "104133c6054bc9ab0288eaa0cea168b6699e537b3ea76ecdc38ee833d93dca09";
  };

  libxml2_280 = stdenv.lib.overrideDerivation libxml2 (args: rec { 
    name = "libxml2-2.8.0";

    src = fetchurl {
      url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
      sha256 = "0ak2mjwvanz91nwxf1kkgbhrkm85vhhkpj7ymz8r6lb84bix1qpj";
    };

    patches = [];
  });
 
  curlFB = stdenv.lib.overrideDerivation curl (args: { patches = [ "${src}/src/third_party/libcurl-7.22.1.fb-changes.diff" ]; });

  fbPatch = "${src}/src/third_party/libevent-1.4.14.fb-changes.diff";
  libeventFB = stdenv.lib.overrideDerivation libevent (args: { patches = [fbPatch]; });
in
stdenv.mkDerivation {
  name = "hiphop-php-73f1c0ebd9";
  inherit src;
  dontUseCmakeBuildDir = true;
  dontUseCmakeConfigure = true;
  USE_HHVM=1;
  preConfigure = ''
    export HPHP_HOME=$PWD
    export HPHP_LIB=$PWD/bin
    export TBB_INSTALL_DIR=${inteltbb}
    export TBB_ARCH_PLATFORM="intel64/cc4.1.0_libc2.4_kernel2.6.16.21"
    sed -i 's| DEPRECATED | DEPRECATED_ |' src/runtime/base/runtime_error.h
  '';
  NIX_LDFLAGS = "-lpam -L${pam}/lib";
  MYSQL_DIR=mysql;
  buildInputs = [ 
    cmake boost libunwind mysql libmemcached pcre libeventFB gd curlFB
    libxml2_280 icu flex bison openssl zlib php expat libcap oniguruma
    libdwarf libmcrypt inteltbb google_perftools bzip2 openldap readline
    libelf uwimap binutils cyrus_sasl pam
  ];
  installPhase = ''
    mkdir -p $out/bin
    cp src/hhvm/hhvm $out/bin
    cp bin/systemlib.php $out/bin
  '';
  patches = [./tbb.patch];

  meta = {
    description = "HipHop is a high performance PHP toolchain.";
    homepage = https://github.com/facebook/hiphop-php;
    platforms = ["x86_64-linux"];
  };
}
{'fraction_non_alphanumeric': 0.12756467439785907, 'fraction_numerical': 0.059322033898305086, 'mean_word_length': 3.875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2396721', 'n_tokens_mistral': 1956, 'n_tokens_neox': 1828, 'n_words': 330}