73 # TODO(https://github.com/NixOS/nixpkgs/pull/193086): Use stdenv.cc.libcxx once it is available
75 builtins.match ".*-stdlib=\+\+.*" (builtins.readFile "${stdenv.cc}/nix-support/libcxx-ldflags") == null;
80 #[[:blank:]]*define[[:blank:]]+HHVM_VERSION_MAJOR[[:blank:]]+([[:digit:]]+)
81 #[[:blank:]]*define[[:blank:]]+HHVM_VERSION_MINOR[[:blank:]]+([[:digit:]]+)
82 #[[:blank:]]*define[[:blank:]]+HHVM_VERSION_PATCH[[:blank:]]+([[:digit:]]+)
83 #[[:blank:]]*define[[:blank:]]+HHVM_VERSION_SUFFIX[[:blank:]]+"([^"]*)"
86 (builtins.readFile ./hphp/runtime/version.h);
87 makeVersion = major: minor: patch: suffix:
88 if suffix == "-dev" then "${major}.${minor}.${patch}-dev${lastModifiedDate}" else "${major}.${minor}.${patch}";
90 rustChannel = rustChannelOf {
92 # When the date attribute changes, sha256 should be updated accordingly.
94 # 1. Export your diff to GitHub;
95 # 2. Wait for an error message about sha256 mismatch from the GitHub
97 # 3. Copy the new sha256 from the error message and paste it here;
98 # 4. Submit the diff and export the diff to GitHub, again.
99 # 5. Ensure no error message about sha256 mismatch from the GitHub Actions.
100 sha256 = "wVnIzrnpYGqiCBtc3k55tw4VW8YLA3WZY0mSac+2yl0=";
106 stdenv.mkDerivation rec {
107 rust = rustChannel.rust;
109 version = builtins.foldl' lib.trivial.id makeVersion versionParts;
121 ] ++ lib.optionals hostPlatform.isMacOS [
122 # `system_cmds` provides `sysctl`, which is used in hphp/test/run.php on macOS
127 (if isDefaultStdlib then boost else boost.override { inherit stdenv; })
130 (curl.override { openssl = openssl_1_1; })
132 if isDefaultStdlib then
135 double-conversion.override { inherit stdenv; }
139 (if isDefaultStdlib then fmt_8 else fmt_8.override { inherit stdenv; })
142 # Workaround for https://github.com/NixOS/nixpkgs/issues/192665
149 if isDefaultStdlib then
154 gflags = gflags.override { inherit stdenv; };
156 (finalAttrs: previousAttrs: {
157 # Workaround for https://github.com/google/glog/issues/709
158 doCheck = !stdenv.cc.isClang;
162 (if isDefaultStdlib then gperf else gperf.override { inherit stdenv; })
164 if isDefaultStdlib then
167 gperftools.override { inherit stdenv; }
169 (if isDefaultStdlib then icu else icu.override { inherit stdenv; })
195 (if isDefaultStdlib then tbb else tbb.override { inherit stdenv; })
201 ++ lib.optionals hostPlatform.isLinux [
207 ++ lib.optionals hostPlatform.isMacOS [
208 darwin.apple_sdk.frameworks.CoreFoundation
209 darwin.apple_sdk.frameworks.CoreServices
213 lib.optionals stdenv.cc.isClang [
214 # Workaround for dtoa.0.3.2
215 "-Wno-error=unused-command-line-argument"
218 CMAKE_TOOLCHAIN_FILE = writeTextFile {
219 name = "toolchain.cmake";
221 set(ENABLE_SYSTEM_LOCALE_ARCHIVE ON CACHE BOOL "Use system locale archive as the default LOCALE_ARCHIVE for nix patched glibc" FORCE)
222 set(CAN_USE_SYSTEM_ZSTD ON CACHE BOOL "Use system zstd" FORCE)
223 set(HAVE_SYSTEM_TZDATA_PREFIX "${tzdata}/share/zoneinfo" CACHE PATH "The zoneinfo directory" FORCE)
224 set(HAVE_SYSTEM_TZDATA ON CACHE BOOL "Use system zoneinfo" FORCE)
225 set(MYSQL_UNIX_SOCK_ADDR "/run/mysqld/mysqld.sock" CACHE FILEPATH "The MySQL unix socket" FORCE)
226 set(CARGO_EXECUTABLE "${rust}/bin/cargo" CACHE FILEPATH "The nightly cargo" FORCE)
227 set(RUSTC_EXECUTABLE "${rust}/bin/rustc" CACHE FILEPATH "The nightly rustc" FORCE)
228 set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose output from Makefile builds" FORCE)
230 lib.optionalString hostPlatform.isMacOS ''
231 set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Targeting macOS version" FORCE)
245 -f third-party/proxygen/CMakeFiles/bundled_proxygen.dir/build.make \
246 third-party/proxygen/bundled_proxygen-prefix/src/bundled_proxygen-stamp/bundled_proxygen-patch
248 third-party/proxygen/bundled_proxygen-prefix/src/bundled_proxygen
257 export HHVM_BIN="$PWD/hphp/hhvm/hhvm"
258 (cd ${./.} && "$HHVM_BIN" hphp/test/run.php quick)
263 description = "High-performance JIT compiler for PHP/Hack";
268 homepage = "https://hhvm.com";
273 fullName = "Zend License v2.0";
274 url = "https://www.zend.com/sites/zend/files/pdfs/2_00.txt";
278 email = "hhvm-oss@fb.com";
281 name = "HHVM/Hack Open Source";