X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=hhvm.spec;h=5126c9ff07ff246728953c3d4449798845b95da0;hb=45805ee;hp=f5ce698fd470d2a79b97d1c7770feaf7dea272af;hpb=fd4a736fea5210111a9e7b9a6487a6de73edcab0;p=packages%2Fhhvm.git diff --git a/hhvm.spec b/hhvm.spec index f5ce698..5126c9f 100644 --- a/hhvm.spec +++ b/hhvm.spec @@ -3,29 +3,46 @@ %bcond_without system_dconv # system double-conversion %bcond_without system_sqlite # system sqlite3 %bcond_without system_lz4 # system lz4 +%bcond_without system_fastlz # system fastlz +%bcond_with system_libafdt # system libafdt +%bcond_without system_libzip # system libzip +# cotire breaks sqlite3 on builders: https://github.com/facebook/hhvm/issues/4524 +%bcond_with cotire # cotire (compile time reducer): Speed up the build by precompiling headers + +# TODO +# - system xhp +# - system proxygen +# - system thrift # 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 -# git show HHVM-3.3.1 -%define githash e0c98e21167b425dddf1fc9efe78c9f7a36db268 -# these hashes are git submodules + +# must be in sync with source. extra check ensuring that it is so is done in %%build +%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 + +# git show HHVM-3.3.7 +%define githash e0344cb6ab126e50e611332f03f447f586cc763a +# these hashes are git submodules (be sure to check them on proper branch) +# GIT_DIR=third-party/.git git log -1 +%define thirdparty bf581f8 +# GIT_DIR=third-party/folly/src/.git git log -1 %define folly 6e46d46 -%define thirdparty fdef620 Summary: Virtual Machine, Runtime, and JIT for PHP Name: hhvm -Version: 3.3.1 -Release: 0.4 +# we prefer LTS versions +# see http://hhvm.com/blog/6083/hhvm-long-term-support +Version: 3.3.7 +Release: 13 License: PHP 3.01 and BSD Group: Development/Languages Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz -# Source0-md5: bab9490837ff4f54f295bbcf428d7a1c +# Source0-md5: 8df12eef8702515498d6a6caab6e4b7d 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: 63858096c50c172d6c45ddb3d9b6d721 +# Source3-md5: 17210db0b2211c63d911076e02aab487 Source5: %{name}-fcgi.init Source6: %{name}-fcgi.sysconfig Source7: php.ini @@ -34,6 +51,13 @@ Patch1: no-debug.patch Patch2: hphpize.patch Patch3: MAX.patch Patch4: system-thirdparty.patch +Patch5: cmake.patch +Patch6: libvpx2.patch +Patch7: gcc5.patch +Patch8: cxx.patch +Patch9: gcc6.patch +Patch10: libevent-2.1.patch +Patch11: icu59.patch URL: https://github.com/facebook/hhvm/wiki BuildRequires: ImageMagick-devel BuildRequires: a52dec-libs-devel @@ -48,11 +72,13 @@ BuildRequires: curl-devel >= 7.29.0 %{?with_system_dconv:BuildRequires: double-conversion-devel >= 1.1.1} BuildRequires: elfutils-devel BuildRequires: expat-devel +%{?with_system_fastlz:BuildRequires: fastlz-devel >= 0.1.0-0.r12} BuildRequires: gcc >= 6:4.6.0 BuildRequires: gd-devel BuildRequires: glog-devel >= 0.3.2 BuildRequires: imap-devel >= 1:2007 #BuildRequires: jemalloc-devel >= 3.0.0 +%{?with_system_libafdt:BuildRequires: libafdt-devel >= 0.1.0} BuildRequires: libcap-devel BuildRequires: libdwarf-devel >= 20130729 BuildRequires: libicu-devel >= 4.2 @@ -63,6 +89,7 @@ BuildRequires: libstdc++-devel >= 6:4.8 BuildRequires: libunwind-devel BuildRequires: libxml2-devel BuildRequires: libxslt-devel +%{?with_system_libzip:BuildRequires: libzip-devel >= 0.11.2} %{?with_system_lz4:BuildRequires: lz4-devel >= 0.0-1.r119} BuildRequires: mysql-devel BuildRequires: ocaml-findlib @@ -78,8 +105,9 @@ BuildRequires: zlib-devel # check later, seem unused #BuildRequires: bison >= 2.3 #BuildRequires: flex >= 2.5.35 -#BuildRequires: libafdt-devel >= 0.1.0 +BuildRequires: libafdt-devel >= 0.1.0 #BuildRequires: re2c >= 0.13.0 +BuildConflicts: ImageMagick6-devel Provides: %{name}(api) = %{hhvm_api_version} Provides: php(core) = %{php_version} # foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext)); @@ -165,10 +193,6 @@ Obsoletes: hiphop-php < 2.3.2-0.2 ExclusiveArch: %{x8664} 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 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 @@ -240,12 +264,30 @@ mv folly-* third-party/folly/src %patch2 -p1 %patch3 -p1 %patch4 -p1 +#%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 # prefer ones from system rm CMake/FindBISON.cmake rm CMake/FindFLEX.cmake rm CMake/FindFreetype.cmake +# ensure system libs get used +cd third-party +rm -r pcre \ + %{?with_system_sqlite:libsqlite3} \ + %{?with_system_lz4:lz4} \ + %{?with_system_dconv:double-conversion} \ + %{?with_system_fastlz:fastlz} \ + %{?with_system_libafdt:libafdt} \ + %{?with_system_libzip:libzip} \ + %{nil} + %build # also in: hphp/tools/hphpize/hphpize.cmake API=$(awk '/#define HHVM_API_VERSION/{v=$3; sub(/L$/, "", v); print v}' hphp/runtime/ext/extension.h) @@ -255,6 +297,8 @@ if [ $API != %{hhvm_api_version} ]; then exit 1 fi +export CXXFLAGS="%{rpmcxxflags} -fpermissive -I/usr/include/lz4" + # out of dir build broken (can't find it's tools, or headers) #install -d build #cd build @@ -278,12 +322,8 @@ fi -DHHVM_DYNAMIC_EXTENSION_DIR=%{hhvm_extensiondir} \ -DUSE_JEMALLOC=OFF \ -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 \ + -DTEST_BIN=OFF \ + -DENABLE_COTIRE=%{!?with_cotire:OFF}%{?with_cotire:ON} \ . # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo @@ -310,6 +350,13 @@ rm -rf $RPM_BUILD_ROOT%{_docdir} if [ ! -f installed.stamp ]; then # begin install block +# fix broken cmake rules +# TODO: fix cmake rules +if [ -d $RPM_BUILD_ROOT%{_prefix}/usr ]; then + cp -a $RPM_BUILD_ROOT%{_prefix}/usr/* $RPM_BUILD_ROOT%{_prefix} + rm -rf $RPM_BUILD_ROOT%{_prefix}/usr +fi + install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}} cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name} @@ -326,44 +373,6 @@ 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 -install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules -cp -p CMake/*.cmake $RPM_BUILD_ROOT%{_datadir}/cmake/Modules - -HPHP_HOME=$(pwd) -sed -e " - /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g -" hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake - -oIFS=$IFS -IFS=";" -set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake) -IFS=$oIFS -set -- $( - for dir in "$@"; do - [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir - done -) - -set +x -for dir in "$@" \ - $HPHP_HOME/hphp/runtime \ - $HPHP_HOME/hphp/util \ - $HPHP_HOME/hphp/neo \ - $HPHP_HOME/hphp/system \ - $HPHP_HOME/hphp/parser \ -; do - echo "D %{_includedir}${dir#$HPHP_HOME}" - find $dir -name '*.h' | while read path; do - file=%{_includedir}${path#$HPHP_HOME} - echo "F $file" - install -Dp $path $RPM_BUILD_ROOT$file - done -done -set -x -%endif - # end of install block touch installed.stamp; fi