+#
+# Conditional build:
+%bcond_without system_dconv # system double-conversion
+%bcond_without system_sqlite # system sqlite3
+%bcond_without system_lz4 # system lz4
+
# NOTES:
# - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
# - patch /usr/lib/hphp/CMake/HPHPIZEFunctions.cmake for %{_libdir}/hhvm as extension dir
# TODO
-# - system libmbfl, system xhp, sqlite3
-# - use system pcre
+# - system libmbfl, system xhp
# git show HHVM-3.3.1
%define githash e0c98e21167b425dddf1fc9efe78c9f7a36db268
# these hashes are git submodules
Summary: Virtual Machine, Runtime, and JIT for PHP
Name: hhvm
Version: 3.3.1
-Release: 0.1
+Release: 0.4
License: PHP 3.01 and BSD
Group: Development/Languages
Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
BuildRequires: boost-devel >= 1.50
BuildRequires: cmake >= 2.8.5
BuildRequires: curl-devel >= 7.29.0
+%{?with_system_dconv:BuildRequires: double-conversion-devel >= 1.1.1}
BuildRequires: elfutils-devel
BuildRequires: expat-devel
BuildRequires: gcc >= 6:4.6.0
BuildRequires: libunwind-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
+%{?with_system_lz4:BuildRequires: lz4-devel >= 0.0-1.r119}
BuildRequires: mysql-devel
BuildRequires: ocaml-findlib
BuildRequires: oniguruma-devel
BuildRequires: openssl-devel
-BuildRequires: pcre-devel
+BuildRequires: pcre-devel >= 8.32
#BuildRequires: php-xhp-devel >= 1.3.9-6
BuildRequires: readline-devel
BuildRequires: rpmbuild(macros) >= 1.675
+%{?with_system_sqlite:BuildRequires: sqlite3-devel >= 3.7.15.2}
BuildRequires: tbb-devel >= 4.0.6000
BuildRequires: zlib-devel
# check later, seem unused
-DUSE_TCMALLOC=OFF \
-DHPHP_NOTEST=ON \
-DSYSTEM_PCRE=ON \
+ %{?with_system_sqlite:-DSYSTEM_SQLITE3=ON} \
+ %{?with_system_lz4:-DSYSTEM_LZ4=ON} \
+ %{?with_system_dconv:-DSYSTEM_DOUBLE_CONVERSION=ON} \
-DENABLE_COTIRE=ON \
.
--- hhvm-HHVM-3.3.1/./third-party/CMakeLists.txt~ 2014-09-19 00:27:19.000000000 +0300
-+++ hhvm-HHVM-3.3.1/./third-party/CMakeLists.txt 2014-11-17 16:47:31.381478001 +0200
-@@ -24,7 +24,6 @@
++++ hhvm-HHVM-3.3.1/./third-party/CMakeLists.txt 2014-11-17 22:39:00.515744741 +0200
+@@ -24,16 +24,33 @@
set(THIRD_PARTY_HEADERS)
list(APPEND THIRD_PARTY_MODULES
fastlz
libafdt
libmbfl
-@@ -34,6 +33,11 @@
- double-conversion
+- libsqlite3
+ timelib
+- lz4
+- double-conversion
folly
- libzip)
+- libzip)
++)
+
+if(NOT SYSTEM_PCRE)
+ list(APPEND THIRD_PARTY_MODULES pcre)
+endif()
++
++if(NOT SYSTEM_SQLITE3)
++ list(APPEND THIRD_PARTY_MODULES libsqlite3)
++endif()
++
++if(NOT SYSTEM_LZ4)
++ list(APPEND THIRD_PARTY_MODULES lz4)
++endif()
++
++if(NOT SYSTEM_DOUBLE_CONVERSION)
++ list(APPEND THIRD_PARTY_MODULES double-conversion)
++endif()
++
++if(NOT SYSTEM_LIBZIP)
++ list(APPEND THIRD_PARTY_MODULES libzip)
++endif()
+
if(ENABLE_FASTCGI)
list(APPEND THIRD_PARTY_MODULES proxygen)