# 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
-# git show HHVM-3.2.0
-%define githash 01228273b8cf709aacbd3df1c51b1e690ecebac8
-%define folly 09a81a9
-%define thirdparty 2234d64
+# git show HHVM-3.3.1
+%define githash e0c98e21167b425dddf1fc9efe78c9f7a36db268
+# these hashes are git submodules
+%define folly 6e46d46
+%define thirdparty fdef620
Summary: Virtual Machine, Runtime, and JIT for PHP
Name: hhvm
-Version: 3.2.0
-Release: 1
-License: PHP 3.01
+Version: 3.3.1
+Release: 0.1
+License: PHP 3.01 and BSD
Group: Development/Languages
Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
-# Source0-md5: 791ca8c56d155a71f948387de8859f98
-Source2: https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
-# Source2-md5: 17bc7ee76939cd6a26755588d80313c9
+# Source0-md5: bab9490837ff4f54f295bbcf428d7a1c
+Source2: https://github.com/facebook/folly/archive/%{folly}/folly-3.2-%{folly}.tar.gz
+# Source2-md5: c4bdbea4c0ffe0650d12d9ff370b8255
Source3: https://github.com/hhvm/hhvm-third-party/archive/%{thirdparty}/third_party-%{thirdparty}.tar.gz
-# Source3-md5: 9d40c3fbf1394bb1f03648d7046f8b9c
-Source4: %{name}-fcgi.init
-Source5: %{name}-fcgi.sysconfig
-Source6: php.ini
+# Source3-md5: 63858096c50c172d6c45ddb3d9b6d721
+Source5: %{name}-fcgi.init
+Source6: %{name}-fcgi.sysconfig
+Source7: php.ini
Source100: get-source.sh
-Patch0: ccache.patch
Patch1: no-debug.patch
+Patch2: hphpize.patch
URL: https://github.com/facebook/hhvm/wiki
BuildRequires: ImageMagick-devel
BuildRequires: a52dec-libs-devel
BuildRequires: apr-devel
BuildRequires: autoconf
BuildRequires: binutils-devel
+# CMake/HPHPFindLibs.cmake:364 - FIND_LIBRARY (BFD_LIB libbfd.a)
+BuildRequires: binutils-static
BuildRequires: boost-devel >= 1.50
BuildRequires: cmake >= 2.8.5
BuildRequires: curl-devel >= 7.29.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# must be in sync with source. extra check ensuring that it is so is done in %%build
-%define hhvm_api_version 20140702
+%define hhvm_api_version 20140829
# hphp/system/idl/constants.idl.json defines it as 5.6.99-hhvm, but use some saner value
%define php_version 5.6.0
+%define hhvm_extensiondir %{_libdir}/hhvm
+
%description
HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
machine designed for executing programs written in PHP. HHVM uses a
rmdir third-party/folly/src
mv folly-* third-party/folly/src
-%patch0 -p1
%patch1 -p1
+%patch2 -p1
# prefer ones from system
rm CMake/FindBISON.cmake
exit 1
fi
-# out of dir build broken (can't find it's tools)
-install -d build
-cd build
+# out of dir build broken (can't find it's tools, or headers)
+#install -d build
+#cd build
# handle cmake & ccache
# http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec
%cmake \
$ccache \
-DCMAKE_PREFIX_PATH=%{_prefix} \
+ -DHHVM_DYNAMIC_EXTENSION_DIR=%{hhvm_extensiondir} \
-DUSE_JEMALLOC=OFF \
-DUSE_TCMALLOC=OFF \
-DHPHP_NOTEST=ON \
- ../
+ -DENABLE_COTIRE=ON \
+ .
# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
# see hphp/util/generate-buildinfo.sh
-export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
+export COMPILER_ID=HHVM-%{version}-%{release}-g%{githash}
export HHVM_REPO_SCHEMA=$(date +%N_%s)
%{__make}
if [ ! -f installed.stamp ]; then
# begin install block
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
-cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}}
+cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
# install fastcgi initscript
install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
-cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
-cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
+cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
+cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
+
+install -p hphp/hack/bin/hh_{server,client} $RPM_BUILD_ROOT%{_bindir}
%if 0
# setup -devel
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/php.ini
%attr(755,root,root) %{_bindir}/hhvm
%attr(755,root,root) %{_bindir}/hphp
+%attr(755,root,root) %{_bindir}/hh_client
+%attr(755,root,root) %{_bindir}/hh_server
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/hdf
%{_datadir}/%{name}/hdf/static.mime-types.hdf
+# dir for extensions
+%dir %{_libdir}/%{name}
+
%files fcgi
%defattr(644,root,root,755)
%attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi