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