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