]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
- rebuild with boost 1.63.0
[packages/hhvm.git] / hhvm.spec
CommitLineData
fd4a736f
ER
1#
2# Conditional build:
3%bcond_without system_dconv # system double-conversion
4%bcond_without system_sqlite # system sqlite3
5%bcond_without system_lz4 # system lz4
e494b5cb 6%bcond_without system_fastlz # system fastlz
934d354b 7%bcond_with system_libafdt # system libafdt
c19fc9d9 8%bcond_without system_libzip # system libzip
8041f44b
ER
9# cotire breaks sqlite3 on builders: https://github.com/facebook/hhvm/issues/4524
10%bcond_with cotire # cotire (compile time reducer): Speed up the build by precompiling headers
fd4a736f 11
b682fdb1
ER
12# TODO
13# - system xhp
14# - system proxygen
15# - system thrift
16
89ad59aa
ER
17# NOTES:
18# - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
b682fdb1 19
d9b6cc98
ER
20# must be in sync with source. extra check ensuring that it is so is done in %%build
21%define hhvm_api_version 20140829
af2b6c94
ER
22# hphp/system/idl/constants.idl.json defines it as 5.6.99-hhvm, but use some saner value
23%define php_version 5.6.0
24
ffc743bc
ER
25# git show HHVM-3.3.7
26%define githash e0344cb6ab126e50e611332f03f447f586cc763a
b682fdb1 27# these hashes are git submodules (be sure to check them on proper branch)
e7f30897
ER
28# GIT_DIR=third-party/.git git log -1
29%define thirdparty bf581f8
e7f30897 30# GIT_DIR=third-party/folly/src/.git git log -1
b682fdb1 31%define folly 6e46d46
ed14b19f 32Summary: Virtual Machine, Runtime, and JIT for PHP
aa7908cc 33Name: hhvm
d84d6344
ER
34# we prefer LTS versions
35# see http://hhvm.com/blog/6083/hhvm-long-term-support
ffc743bc 36Version: 3.3.7
a4aabf3c 37Release: 13
6135817a 38License: PHP 3.01 and BSD
ac2930bc 39Group: Development/Languages
aa7908cc 40Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
ffc743bc 41# Source0-md5: 8df12eef8702515498d6a6caab6e4b7d
20de90ba
ER
42Source2: https://github.com/facebook/folly/archive/%{folly}/folly-3.2-%{folly}.tar.gz
43# Source2-md5: c4bdbea4c0ffe0650d12d9ff370b8255
745db304 44Source3: https://github.com/hhvm/hhvm-third-party/archive/%{thirdparty}/third_party-%{thirdparty}.tar.gz
e7f30897 45# Source3-md5: 17210db0b2211c63d911076e02aab487
6135817a
ER
46Source5: %{name}-fcgi.init
47Source6: %{name}-fcgi.sysconfig
48Source7: php.ini
991b3017 49Source100: get-source.sh
449902dc 50Patch1: no-debug.patch
e66c75f6 51Patch2: hphpize.patch
3e79618f 52Patch3: MAX.patch
142dde19 53Patch4: system-thirdparty.patch
a46def0c 54Patch5: cmake.patch
c77f551c 55Patch6: libvpx2.patch
b343400f 56Patch7: gcc5.patch
83ff8dfd 57Patch8: cxx.patch
199131a5 58Patch9: gcc6.patch
aa8f72e5 59Patch10: libevent-2.1.patch
ff452300 60URL: https://github.com/facebook/hhvm/wiki
f7556a8c 61BuildRequires: ImageMagick-devel
9256e518 62BuildRequires: a52dec-libs-devel
b05f3896
ER
63BuildRequires: apr-devel
64BuildRequires: autoconf
3f49543c 65BuildRequires: binutils-devel
6135817a
ER
66# CMake/HPHPFindLibs.cmake:364 - FIND_LIBRARY (BFD_LIB libbfd.a)
67BuildRequires: binutils-static
ed14b19f 68BuildRequires: boost-devel >= 1.50
745db304 69BuildRequires: cmake >= 2.8.5
ed14b19f 70BuildRequires: curl-devel >= 7.29.0
fd4a736f 71%{?with_system_dconv:BuildRequires: double-conversion-devel >= 1.1.1}
ed14b19f 72BuildRequires: elfutils-devel
3f49543c 73BuildRequires: expat-devel
e494b5cb 74%{?with_system_fastlz:BuildRequires: fastlz-devel >= 0.1.0-0.r12}
5c61d46f 75BuildRequires: gcc >= 6:4.6.0
3f49543c 76BuildRequires: gd-devel
ed14b19f
ER
77BuildRequires: glog-devel >= 0.3.2
78BuildRequires: imap-devel >= 1:2007
991b3017 79#BuildRequires: jemalloc-devel >= 3.0.0
e494b5cb 80%{?with_system_libafdt:BuildRequires: libafdt-devel >= 0.1.0}
3f49543c 81BuildRequires: libcap-devel
04f13235 82BuildRequires: libdwarf-devel >= 20130729
ac2930bc 83BuildRequires: libicu-devel >= 4.2
be373886 84#BuildRequires: libmbfl-devel
ed14b19f 85BuildRequires: libmcrypt-devel
e883c14f 86BuildRequires: libmemcached-devel >= 1.0.4
491a5eb9 87BuildRequires: libstdc++-devel >= 6:4.8
ed14b19f 88BuildRequires: libunwind-devel
ac2930bc 89BuildRequires: libxml2-devel
9256e518 90BuildRequires: libxslt-devel
ca0d5750 91%{?with_system_libzip:BuildRequires: libzip-devel >= 0.11.2}
fd4a736f 92%{?with_system_lz4:BuildRequires: lz4-devel >= 0.0-1.r119}
3f49543c 93BuildRequires: mysql-devel
04f13235 94BuildRequires: ocaml-findlib
ac2930bc 95BuildRequires: oniguruma-devel
3f49543c 96BuildRequires: openssl-devel
fd4a736f 97BuildRequires: pcre-devel >= 8.32
ed14b19f 98#BuildRequires: php-xhp-devel >= 1.3.9-6
ed14b19f 99BuildRequires: readline-devel
89ad59aa 100BuildRequires: rpmbuild(macros) >= 1.675
fd4a736f 101%{?with_system_sqlite:BuildRequires: sqlite3-devel >= 3.7.15.2}
ed14b19f 102BuildRequires: tbb-devel >= 4.0.6000
3f49543c 103BuildRequires: zlib-devel
21df9de7
ER
104# check later, seem unused
105#BuildRequires: bison >= 2.3
106#BuildRequires: flex >= 2.5.35
ca0d5750 107BuildRequires: libafdt-devel >= 0.1.0
21df9de7 108#BuildRequires: re2c >= 0.13.0
07195164 109BuildConflicts: ImageMagick6-devel
87330af7 110Provides: %{name}(api) = %{hhvm_api_version}
c91d719c
ER
111Provides: php(core) = %{php_version}
112# foreach (get_loaded_extensions() as $ext) printf("Provides:\tphp(%s)\n", strtolower($ext));
206caaaf
ER
113Provides: php(apc)
114Provides: php(bcmath)
991b3017 115Provides: php(bz2)
745db304 116Provides: php(calendar)
206caaaf
ER
117Provides: php(ctype)
118Provides: php(curl)
119Provides: php(date)
9c2504b3 120Provides: php(debugger)
206caaaf 121Provides: php(dom)
c91d719c 122Provides: php(enum)
206caaaf
ER
123Provides: php(exif)
124Provides: php(fb)
991b3017 125Provides: php(fileinfo)
206caaaf 126Provides: php(filter)
745db304 127Provides: php(ftp)
206caaaf 128Provides: php(gd)
745db304 129Provides: php(gettext)
c91d719c 130Provides: php(gmp)
206caaaf 131Provides: php(hash)
9c2504b3
ER
132Provides: php(hh)
133Provides: php(hhvm.debugger)
134Provides: php(hhvm.ini)
206caaaf
ER
135Provides: php(hotprofiler)
136Provides: php(iconv)
206caaaf 137Provides: php(idn)
9c2504b3 138Provides: php(imagick)
206caaaf 139Provides: php(imap)
9c2504b3 140Provides: php(intl)
206caaaf
ER
141Provides: php(json)
142Provides: php(ldap)
9c2504b3 143Provides: php(libxml)
c91d719c
ER
144Provides: php(mail)
145Provides: php(mailparse)
206caaaf
ER
146Provides: php(mbstring)
147Provides: php(mcrypt)
148Provides: php(memcache)
149Provides: php(memcached)
150Provides: php(mysql)
9c2504b3 151Provides: php(mysqli)
745db304 152Provides: php(oauth)
206caaaf
ER
153Provides: php(openssl)
154Provides: php(pcntl)
155Provides: php(pcre)
745db304 156Provides: php(pcre_zend_compat)
206caaaf
ER
157Provides: php(pdo)
158Provides: php(pdo_mysql)
159Provides: php(pdo_sqlite)
160Provides: php(phar)
161Provides: php(posix)
9c2504b3 162Provides: php(redis)
206caaaf
ER
163Provides: php(reflection)
164Provides: php(server)
165Provides: php(session)
166Provides: php(simplexml)
167Provides: php(soap)
168Provides: php(sockets)
169Provides: php(spl)
170Provides: php(sqlite3)
745db304
ER
171Provides: php(standard)
172Provides: php(standard_zend_compat)
9c2504b3 173Provides: php(stream)
206caaaf
ER
174Provides: php(sysvmsg)
175Provides: php(sysvsem)
176Provides: php(sysvshm)
177Provides: php(thread)
178Provides: php(thrift_protocol)
179Provides: php(tokenizer)
9c2504b3 180Provides: php(url)
745db304
ER
181Provides: php(wddx)
182Provides: php(xenon)
206caaaf
ER
183Provides: php(xhprof)
184Provides: php(xml)
185Provides: php(xmlreader)
186Provides: php(xmlwriter)
9c2504b3 187Provides: php(xsl)
745db304 188Provides: php(yaml)
991b3017 189Provides: php(zip)
206caaaf 190Provides: php(zlib)
991b3017 191Obsoletes: hiphop-php < 2.3.2-0.2
17c75ade 192ExclusiveArch: %{x8664}
65446f6c
ER
193BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
194
c171e0ff 195
6135817a
ER
196%define hhvm_extensiondir %{_libdir}/hhvm
197
65446f6c 198%description
aa7908cc
ER
199HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
200machine designed for executing programs written in PHP. HHVM uses a
201just-in-time compilation approach to achieve superior performance
202while maintaining the flexibility that PHP developers are accustomed
203to. To date, HHVM (and its predecessor HPHPc before it) has realized
204over a 9x increase in web request throughput and over a 5x reduction
205in memory consumption for Facebook compared with the Zend PHP 5.2
206engine + APC.
207
208HHVM can be run as a standalone webserver (i.e. without the Apache
209webserver and the "mod_php" extension). HHVM can also be used together
210with a FastCGI-based webserver, and work is in progress to make HHVM
211work smoothly with Apache.
65446f6c 212
2347c3ae
ER
213%package fcgi
214Summary: Init script to start HHVM as FastCGI daemon
215Group: Development/Languages/PHP
216Requires: %{name} = %{version}-%{release}
217Provides: php(fcgi)
218Requires(post,preun): /sbin/chkconfig
219Requires: rc-scripts
220
221%description fcgi
222Init script to start HHVM as FastCGI daemon
223
3234b364
ER
224%package program
225Summary: /usr/bin/php symlink
226Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
227Group: Development/Languages/PHP
228Requires: %{name} = %{version}-%{release}
229Obsoletes: /usr/bin/php
230
231%description program
232Package providing /usr/bin/php symlink to PHP CLI.
233
234%description program -l pl.UTF-8
235Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
236
c6264399
ER
237%package devel
238Summary: Files for HHVM modules development
239Group: Development/Languages/PHP
240URL: https://github.com/facebook/hhvm/wiki/Extension-API
f6ea7eef 241Requires: boost-devel >= 1.50
c6264399 242Requires: cmake >= 2.8.5
f6ea7eef 243Requires: glog-devel >= 0.3.2
e7779ee6 244Requires: libstdc++-devel >= 6:4.3
f6ea7eef
ER
245Requires: tbb-devel >= 4.0.6000
246Requires: zlib-devel
c6264399
ER
247
248%description devel
249HHVM provides a set of APIs for adding built-in functionality to the
250runtime either by way of pure PHP code, or a combination of PHP and
251C++.
252
65446f6c 253%prep
20de90ba 254%setup -q -n %{name}-HHVM-%{version} -a2 -a3
991b3017 255
745db304
ER
256# handle git submodules
257rmdir third-party
258mv hhvm-third-party-* third-party
259rmdir third-party/folly/src
260mv folly-* third-party/folly/src
f8472382 261
449902dc 262%patch1 -p1
e66c75f6 263%patch2 -p1
3e79618f 264%patch3 -p1
142dde19 265%patch4 -p1
52bf161a 266#%patch5 -p1
c77f551c 267%patch6 -p1
b343400f 268%patch7 -p1
83ff8dfd 269%patch8 -p1
199131a5 270%patch9 -p1
aa8f72e5 271%patch10 -p1
ed14b19f 272
c6264399 273# prefer ones from system
20e9b450 274rm CMake/FindBISON.cmake
20e9b450 275rm CMake/FindFLEX.cmake
b17fa9dd 276rm CMake/FindFreetype.cmake
ed14b19f 277
40280c0c
ER
278# ensure system libs get used
279cd third-party
280rm -r pcre \
3889faa2 281 %{?with_system_sqlite:libsqlite3} \
40280c0c
ER
282 %{?with_system_lz4:lz4} \
283 %{?with_system_dconv:double-conversion} \
284 %{?with_system_fastlz:fastlz} \
285 %{?with_system_libafdt:libafdt} \
c19fc9d9 286 %{?with_system_libzip:libzip} \
40280c0c
ER
287 %{nil}
288
ac2930bc 289%build
c171e0ff
ER
290# also in: hphp/tools/hphpize/hphpize.cmake
291API=$(awk '/#define HHVM_API_VERSION/{v=$3; sub(/L$/, "", v); print v}' hphp/runtime/ext/extension.h)
292
293if [ $API != %{hhvm_api_version} ]; then
294 echo "Set %%define hhvm_api_version to $API and re-run."
295 exit 1
296fi
297
dd925321 298export CXXFLAGS="%{rpmcxxflags} -fpermissive -I/usr/include/lz4"
32057e92 299
20de90ba
ER
300# out of dir build broken (can't find it's tools, or headers)
301#install -d build
302#cd build
449902dc
ER
303
304# handle cmake & ccache
8dff2648 305# http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmake
449902dc
ER
306# ASM fix: http://lists.busybox.net/pipermail/buildroot/2013-March/069436.html
307if [[ "%{__cc}" = *ccache* ]]; then
308 cc="%{__cc}"
309 cxx="%{__cxx}"
310 ccache="
311 -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \
312 -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \
313 -DCMAKE_ASM_COMPILER="${cc#ccache }" \
314 "
315fi
e883c14f 316
ef07ca95 317%cmake \
449902dc 318 $ccache \
ef07ca95 319 -DCMAKE_PREFIX_PATH=%{_prefix} \
6135817a 320 -DHHVM_DYNAMIC_EXTENSION_DIR=%{hhvm_extensiondir} \
a0922d01 321 -DUSE_JEMALLOC=OFF \
be373886 322 -DUSE_TCMALLOC=OFF \
97e4fa4e 323 -DTEST_BIN=OFF \
2e505d70 324 -DENABLE_COTIRE=%{!?with_cotire:OFF}%{?with_cotire:ON} \
20de90ba 325 .
ac3c6624 326
c513fdf6
ER
327# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
328# see hphp/util/generate-buildinfo.sh
ac3c6624 329export COMPILER_ID=HHVM-%{version}-%{release}-g%{githash}
c513fdf6
ER
330export HHVM_REPO_SCHEMA=$(date +%N_%s)
331
ac2930bc
ER
332%{__make}
333
65446f6c 334%install
745db304
ER
335# make install relinks all outputs which is very slow,
336# so to speedup rebuild, use timestamps to record states
337#test %{_specdir}/%{name}.spec -nt makeinstall.stamp && %{__rm} -f makeinstall.stamp
338if [ ! -f makeinstall.stamp -o ! -d $RPM_BUILD_ROOT ]; then
339 rm -rf makeinstall.stamp installed.stamp $RPM_BUILD_ROOT
8d9f731f 340
8dff2648 341 %{__make} install \
745db304
ER
342 DESTDIR=$RPM_BUILD_ROOT
343
344 touch makeinstall.stamp
345fi
346
347rm -rf $RPM_BUILD_ROOT%{_docdir}
348if [ ! -f installed.stamp ]; then
745db304 349# begin install block
9c2504b3 350
883526f7
ER
351# fix broken cmake rules
352# TODO: fix cmake rules
353if [ -d $RPM_BUILD_ROOT%{_prefix}/usr ]; then
354 cp -a $RPM_BUILD_ROOT%{_prefix}/usr/* $RPM_BUILD_ROOT%{_prefix}
355 rm -rf $RPM_BUILD_ROOT%{_prefix}/usr
356fi
357
073742e0 358install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_libdir}/%{name}}
6135817a 359cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
c3ecb766 360
3234b364
ER
361ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
362ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
363
44fcba3e 364install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 365cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 366
2347c3ae
ER
367# install fastcgi initscript
368install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
6135817a
ER
369cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
370cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
2347c3ae 371
ac3c6624
ER
372install -p hphp/hack/bin/hh_{server,client} $RPM_BUILD_ROOT%{_bindir}
373
745db304
ER
374# end of install block
375touch installed.stamp; fi
f6ea7eef 376
65446f6c
ER
377%clean
378rm -rf $RPM_BUILD_ROOT
379
8d9f731f
ER
380%post -p /sbin/ldconfig
381%postun -p /sbin/ldconfig
382
2347c3ae
ER
383%post fcgi
384/sbin/chkconfig --add %{name}-fcgi
385%service %{name}-fcgi restart
386
387%preun fcgi
388if [ "$1" = "0" ]; then
389 %service -q %{name}-fcgi stop
390 /sbin/chkconfig --del %{name}-fcgi
391fi
392
65446f6c
ER
393%files
394%defattr(644,root,root,755)
1c0ae000 395%doc README.md hphp/NEWS
349ae084 396%dir %{_sysconfdir}/%{name}
c3ecb766 397%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/php.ini
8d9f731f 398%attr(755,root,root) %{_bindir}/hhvm
3234b364 399%attr(755,root,root) %{_bindir}/hphp
ac3c6624
ER
400%attr(755,root,root) %{_bindir}/hh_client
401%attr(755,root,root) %{_bindir}/hh_server
44fcba3e
ER
402
403%dir %{_datadir}/%{name}
404%dir %{_datadir}/%{name}/hdf
405%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364 406
073742e0
ER
407# dir for extensions
408%dir %{_libdir}/%{name}
409
2347c3ae
ER
410%files fcgi
411%defattr(644,root,root,755)
412%attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
413%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
414
3234b364
ER
415%files program
416%defattr(644,root,root,755)
417%attr(755,root,root) %{_bindir}/php
c6264399
ER
418
419%files devel
420%defattr(644,root,root,755)
421%attr(755,root,root) %{_bindir}/hphpize
422%{_includedir}/hphp
e35a4289
ER
423%dir %{_libdir}/hhvm
424%{_libdir}/hhvm/CMake
425%{_libdir}/hhvm/hphpize
This page took 0.156384 seconds and 4 git commands to generate.