]> git.pld-linux.org Git - packages/hhvm.git/blame - hhvm.spec
update githash for compiler-id
[packages/hhvm.git] / hhvm.spec
CommitLineData
89ad59aa
ER
1# NOTES:
2# - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
ac2930bc 3# TODO
11ccead6 4# - system libevent2: https://github.com/facebook/hiphop-php/pull/421
59f13ffd 5# - system libmbfl, system xhp, sqlite3
500006c7 6# - libdwarf>20120410 issue: https://github.com/facebook/hhvm/issues/1337
615c3bb6
ER
7# git show HHVM-2.4.1
8%define githash 072ec429a4c42b481aabaa8bca0210b288a8d55e
500006c7 9%define folly 18bedc2
ed14b19f 10Summary: Virtual Machine, Runtime, and JIT for PHP
aa7908cc 11Name: hhvm
500006c7
ER
12Version: 2.4.1
13Release: 0.1
3f49543c 14License: PHP 3.01
ac2930bc 15Group: Development/Languages
aa7908cc 16Source0: https://github.com/facebook/hhvm/archive/HHVM-%{version}.tar.gz
500006c7 17# Source0-md5: a18dde8a30f8293963e6641ee8cb04c8
ef07ca95
ER
18# need fb.changes.patch, which is available for 1.4 only
19Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
20# Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c
500006c7
ER
21Source2: https://github.com/facebook/folly/archive/%{folly}/folly-0.1-%{folly}.tar.gz
22# Source2-md5: 5de02fa81641c66a93c2f57094c7aa72
2347c3ae
ER
23Source3: %{name}-fcgi.init
24Source4: %{name}-fcgi.sysconfig
991b3017 25Source100: get-source.sh
59f13ffd 26Patch0: cmake-missing-library.patch
be373886 27Patch1: libevent14.patch
ef07ca95
ER
28Patch3: system-xhp.patch
29Patch4: system-libafdt.patch
6147aa3c 30Patch5: system-folly.patch
c6264399 31Patch8: hphpize.patch
dc7e02ed 32Patch9: notest.patch
ff711f1f 33Patch10: no-debug.patch
3f49543c 34URL: http://wiki.github.com/facebook/hiphop-php/
b05f3896
ER
35BuildRequires: apr-devel
36BuildRequires: autoconf
3f49543c 37BuildRequires: binutils-devel
ed14b19f 38BuildRequires: boost-devel >= 1.50
991b3017 39BuildRequires: cmake >= 2.8.7
ed14b19f
ER
40BuildRequires: curl-devel >= 7.29.0
41BuildRequires: elfutils-devel
3f49543c 42BuildRequires: expat-devel
5c61d46f 43BuildRequires: gcc >= 6:4.6.0
3f49543c 44BuildRequires: gd-devel
ed14b19f
ER
45BuildRequires: glog-devel >= 0.3.2
46BuildRequires: imap-devel >= 1:2007
991b3017 47#BuildRequires: jemalloc-devel >= 3.0.0
3f49543c 48BuildRequires: libcap-devel
500006c7 49BuildRequires: libdwarf-devel <= 20120410
ed14b19f 50#BuildRequires: libevent-devel >= 1.4.14
ac2930bc 51BuildRequires: libicu-devel >= 4.2
be373886 52#BuildRequires: libmbfl-devel
ed14b19f 53BuildRequires: libmcrypt-devel
e883c14f 54BuildRequires: libmemcached-devel >= 1.0.4
ef07ca95 55BuildRequires: libstdc++-devel >= 6:4.3
ed14b19f 56BuildRequires: libunwind-devel
ac2930bc 57BuildRequires: libxml2-devel
3f49543c 58BuildRequires: mysql-devel
ac2930bc 59BuildRequires: oniguruma-devel
3f49543c
ER
60BuildRequires: openssl-devel
61BuildRequires: pcre-devel
ed14b19f 62#BuildRequires: php-xhp-devel >= 1.3.9-6
ed14b19f 63BuildRequires: readline-devel
89ad59aa 64BuildRequires: rpmbuild(macros) >= 1.675
ed14b19f 65BuildRequires: tbb-devel >= 4.0.6000
3f49543c 66BuildRequires: zlib-devel
21df9de7
ER
67# check later, seem unused
68#BuildRequires: bison >= 2.3
69#BuildRequires: flex >= 2.5.35
70#BuildRequires: libafdt-devel >= 0.1.0
71#BuildRequires: re2c >= 0.13.0
206caaaf
ER
72Provides: php(apc)
73Provides: php(bcmath)
991b3017 74Provides: php(bz2)
206caaaf
ER
75Provides: php(ctype)
76Provides: php(curl)
77Provides: php(date)
78Provides: php(dom)
79Provides: php(exif)
80Provides: php(fb)
991b3017 81Provides: php(fileinfo)
206caaaf
ER
82Provides: php(filter)
83Provides: php(gd)
84Provides: php(hash)
85Provides: php(hotprofiler)
86Provides: php(iconv)
991b3017 87Provides: php(icu_num_fmt)
206caaaf
ER
88Provides: php(icu_ucsdet)
89Provides: php(icu_uspoof)
90Provides: php(idn)
91Provides: php(imap)
92Provides: php(json)
93Provides: php(ldap)
94Provides: php(mbstring)
95Provides: php(mcrypt)
96Provides: php(memcache)
97Provides: php(memcached)
98Provides: php(mysql)
99Provides: php(openssl)
100Provides: php(pcntl)
101Provides: php(pcre)
102Provides: php(pdo)
103Provides: php(pdo_mysql)
104Provides: php(pdo_sqlite)
105Provides: php(phar)
106Provides: php(posix)
107Provides: php(reflection)
108Provides: php(server)
109Provides: php(session)
110Provides: php(simplexml)
111Provides: php(soap)
112Provides: php(sockets)
113Provides: php(spl)
114Provides: php(sqlite3)
115Provides: php(sysvmsg)
116Provides: php(sysvsem)
117Provides: php(sysvshm)
118Provides: php(thread)
119Provides: php(thrift_protocol)
120Provides: php(tokenizer)
121Provides: php(xhprof)
122Provides: php(xml)
123Provides: php(xmlreader)
124Provides: php(xmlwriter)
991b3017 125Provides: php(zip)
206caaaf 126Provides: php(zlib)
991b3017 127Obsoletes: hiphop-php < 2.3.2-0.2
17c75ade 128ExclusiveArch: %{x8664}
65446f6c
ER
129BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
130
131%description
aa7908cc
ER
132HHVM (aka the HipHop Virtual Machine) is a new open-source virtual
133machine designed for executing programs written in PHP. HHVM uses a
134just-in-time compilation approach to achieve superior performance
135while maintaining the flexibility that PHP developers are accustomed
136to. To date, HHVM (and its predecessor HPHPc before it) has realized
137over a 9x increase in web request throughput and over a 5x reduction
138in memory consumption for Facebook compared with the Zend PHP 5.2
139engine + APC.
140
141HHVM can be run as a standalone webserver (i.e. without the Apache
142webserver and the "mod_php" extension). HHVM can also be used together
143with a FastCGI-based webserver, and work is in progress to make HHVM
144work smoothly with Apache.
65446f6c 145
2347c3ae
ER
146%package fcgi
147Summary: Init script to start HHVM as FastCGI daemon
148Group: Development/Languages/PHP
149Requires: %{name} = %{version}-%{release}
150Provides: php(fcgi)
151Requires(post,preun): /sbin/chkconfig
152Requires: rc-scripts
153
154%description fcgi
155Init script to start HHVM as FastCGI daemon
156
3234b364
ER
157%package program
158Summary: /usr/bin/php symlink
159Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
160Group: Development/Languages/PHP
161Requires: %{name} = %{version}-%{release}
162Obsoletes: /usr/bin/php
163
164%description program
165Package providing /usr/bin/php symlink to PHP CLI.
166
167%description program -l pl.UTF-8
168Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
169
c6264399
ER
170%package devel
171Summary: Files for HHVM modules development
172Group: Development/Languages/PHP
173URL: https://github.com/facebook/hhvm/wiki/Extension-API
f6ea7eef 174Requires: boost-devel >= 1.50
c6264399 175Requires: cmake >= 2.8.5
f6ea7eef 176Requires: glog-devel >= 0.3.2
e7779ee6 177Requires: libstdc++-devel >= 6:4.3
f6ea7eef
ER
178Requires: tbb-devel >= 4.0.6000
179Requires: zlib-devel
c6264399
ER
180
181%description devel
182HHVM provides a set of APIs for adding built-in functionality to the
183runtime either by way of pure PHP code, or a combination of PHP and
184C++.
185
65446f6c 186%prep
991b3017
ER
187%setup -q -a1 -a2 -n %{name}-HHVM-%{version}
188
189mv folly-*/* hphp/submodules/folly
f8472382 190
c6264399 191%patch8 -p1
dc7e02ed 192%patch9 -p1
ff711f1f 193%patch10 -p1
f8472382 194#%patch5 -p1
ed14b19f 195
c6264399 196# prefer ones from system
20e9b450
ER
197rm CMake/FindBISON.cmake
198rm CMake/FindBoost.cmake
199rm CMake/FindFLEX.cmake
b17fa9dd 200rm CMake/FindFreetype.cmake
c6264399 201
ed14b19f
ER
202ln -s libevent-1.4.*-stable libevent
203%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
204
205%if 0
59f13ffd 206%patch0 -p1
be373886 207%patch1 -p1
ef07ca95
ER
208#%patch3 -p1
209%patch4 -p1
210
be373886
ER
211#rm -rf src/third_party/libmbfl
212#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
213
ef07ca95
ER
214rm -rf src/third_party/xhp
215rm -rf src/third_party/libafdt
ed14b19f 216%endif
ac2930bc
ER
217
218%build
ef07ca95
ER
219# build libevent 1.4 with fb patches
220if [ ! -d libevent/.libs ]; then
221 cd libevent
222 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
223 %configure \
224 %{?0:--enable-static} \
225 %{?0:--disable-shared}
226 %{__make}
227 ln -s .libs lib
228 ln -s . include
229 cd ..
230fi
231
ac2930bc
ER
232export HPHP_HOME=$(pwd)
233export HPHP_LIB=$HPHP_HOME/bin
991b3017 234install -d $HPHP_LIB
ac2930bc 235
89ad59aa
ER
236# asm linking breaks on $CC containing spaces
237if [[ "%{__cc}" = *ccache* ]]; then
238 cat <<-'EOF' > $HPHP_LIB/gcc
239 #!/bin/sh
240 exec %{__cc} "$@"
241 EOF
242 chmod +x $HPHP_LIB/gcc
243 CC=$HPHP_LIB/gcc
244fi
245
e883c14f
ER
246%if 0
247# out of dir build broken (can't find it's tools)
ef07ca95
ER
248install -d build
249cd build
e883c14f
ER
250%endif
251
ef07ca95 252%cmake \
ed14b19f 253 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 254 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95 255 -DCMAKE_PREFIX_PATH=%{_prefix} \
a0922d01 256 -DUSE_JEMALLOC=OFF \
be373886 257 -DUSE_TCMALLOC=OFF \
dc7e02ed 258 -DHPHP_NOTEST=ON \
e883c14f 259 ./
c513fdf6
ER
260
261# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
262# see hphp/util/generate-buildinfo.sh
df52bbfc 263export COMPILER_ID=HHVM-%{version}-%{release}-%{githash}
c513fdf6
ER
264export HHVM_REPO_SCHEMA=$(date +%N_%s)
265
ac2930bc
ER
266%{__make}
267
65446f6c
ER
268%install
269rm -rf $RPM_BUILD_ROOT
349ae084 270install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
8d9f731f 271%{__make} install \
05199c54 272 HPHP_HOME=$(pwd) \
8d9f731f
ER
273 DESTDIR=$RPM_BUILD_ROOT
274
3234b364
ER
275ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/php
276ln -s hhvm $RPM_BUILD_ROOT%{_bindir}/hphp
277
44fcba3e 278install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 279cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 280
2347c3ae
ER
281# install fastcgi initscript
282install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
283cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fcgi
284cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-fcgi
285
8d9f731f
ER
286# install our libevent for now
287install -d $RPM_BUILD_ROOT%{_libdir}
288libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
289%{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
65446f6c 290
c6264399
ER
291# setup -devel
292install -d $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
293cp -a CMake/* $RPM_BUILD_ROOT%{_datadir}/cmake/Modules
294
295HPHP_HOME=$(pwd)
296sed -e "
297 /HHVM_INCLUDE_DIRS/ s,$HPHP_HOME,%{_includedir},g
298" hphp/tools/hphpize/hphpize.cmake > $RPM_BUILD_ROOT%{_datadir}/cmake/Modules/hphpize.cmake
299
300oIFS=$IFS
301IFS=";"
302set -- $(sed -ne 's/set(HHVM_INCLUDE_DIRS "\(.*\)")/\1/p' hphp/tools/hphpize/hphpize.cmake)
c6264399 303IFS=$oIFS
2a7c159c
ER
304set -- $(
305 for dir in "$@"; do
306 [[ "$dir" = $HPHP_HOME/hphp/* ]] && echo $dir
307 done
308)
309
310set +x
311for dir in "$@" \
312 $HPHP_HOME/hphp/runtime \
313 $HPHP_HOME/hphp/util \
314 $HPHP_HOME/hphp/neo \
315 $HPHP_HOME/hphp/system \
316 $HPHP_HOME/hphp/parser \
317; do
318 echo "D %{_includedir}${dir#$HPHP_HOME}"
319 find $dir -name '*.h' | while read path; do
320 file=%{_includedir}${path#$HPHP_HOME}
321 echo "F $file"
322 install -Dp $path $RPM_BUILD_ROOT$file
323 done
324done
325set -x
f6ea7eef 326
65446f6c
ER
327%clean
328rm -rf $RPM_BUILD_ROOT
329
8d9f731f
ER
330%post -p /sbin/ldconfig
331%postun -p /sbin/ldconfig
332
2347c3ae
ER
333%post fcgi
334/sbin/chkconfig --add %{name}-fcgi
335%service %{name}-fcgi restart
336
337%preun fcgi
338if [ "$1" = "0" ]; then
339 %service -q %{name}-fcgi stop
340 /sbin/chkconfig --del %{name}-fcgi
341fi
342
65446f6c
ER
343%files
344%defattr(644,root,root,755)
1c0ae000 345%doc README.md hphp/NEWS
349ae084 346%dir %{_sysconfdir}/%{name}
8d9f731f 347%attr(755,root,root) %{_bindir}/hhvm
3234b364 348%attr(755,root,root) %{_bindir}/hphp
8d9f731f
ER
349%attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
350%ghost %{_libdir}/libevent-1.4.so.2
44fcba3e
ER
351
352%dir %{_datadir}/%{name}
353%dir %{_datadir}/%{name}/hdf
354%{_datadir}/%{name}/hdf/static.mime-types.hdf
3234b364 355
2347c3ae
ER
356%files fcgi
357%defattr(644,root,root,755)
358%attr(754,root,root) /etc/rc.d/init.d/%{name}-fcgi
359%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}-fcgi
360
3234b364
ER
361%files program
362%defattr(644,root,root,755)
363%attr(755,root,root) %{_bindir}/php
c6264399
ER
364
365%files devel
366%defattr(644,root,root,755)
367%attr(755,root,root) %{_bindir}/hphpize
368%{_includedir}/hphp
500006c7 369%{_datadir}/cmake/Modules/ExtZendCompat.cmake
c6264399
ER
370%{_datadir}/cmake/Modules/FindCClient.cmake
371%{_datadir}/cmake/Modules/FindEditline.cmake
c6264399
ER
372%{_datadir}/cmake/Modules/FindGlog.cmake
373%{_datadir}/cmake/Modules/FindICU.cmake
374%{_datadir}/cmake/Modules/FindLdap.cmake
375%{_datadir}/cmake/Modules/FindLibAfdt.cmake
376%{_datadir}/cmake/Modules/FindLibCh.cmake
377%{_datadir}/cmake/Modules/FindLibDL.cmake
378%{_datadir}/cmake/Modules/FindLibDwarf.cmake
379%{_datadir}/cmake/Modules/FindLibElf.cmake
380%{_datadir}/cmake/Modules/FindLibEvent.cmake
381%{_datadir}/cmake/Modules/FindLibEvent.cmake.bak
500006c7 382%{_datadir}/cmake/Modules/FindLibJpeg.cmake
c6264399 383%{_datadir}/cmake/Modules/FindLibNuma.cmake
500006c7
ER
384%{_datadir}/cmake/Modules/FindLibPng.cmake
385%{_datadir}/cmake/Modules/FindLibUODBC.cmake
386%{_datadir}/cmake/Modules/FindLibVpx.cmake
c6264399 387%{_datadir}/cmake/Modules/FindLibXed.cmake
500006c7 388%{_datadir}/cmake/Modules/FindLibYaml.cmake
c6264399
ER
389%{_datadir}/cmake/Modules/FindLibiconv.cmake
390%{_datadir}/cmake/Modules/FindLibinotify.cmake
391%{_datadir}/cmake/Modules/FindLibmemcached.cmake
392%{_datadir}/cmake/Modules/FindLibpam.cmake
393%{_datadir}/cmake/Modules/FindMcrypt.cmake
394%{_datadir}/cmake/Modules/FindMySQL.cmake
395%{_datadir}/cmake/Modules/FindNcurses.cmake
396%{_datadir}/cmake/Modules/FindONIGURUMA.cmake
397%{_datadir}/cmake/Modules/FindPCRE.cmake
398%{_datadir}/cmake/Modules/FindPThread.cmake
399%{_datadir}/cmake/Modules/FindReadline.cmake
400%{_datadir}/cmake/Modules/FindTBB.cmake
401%{_datadir}/cmake/Modules/FollySetup.cmake
402%{_datadir}/cmake/Modules/HPHPCompiler.cmake
403%{_datadir}/cmake/Modules/HPHPFindLibs.cmake
404%{_datadir}/cmake/Modules/HPHPFunctions.cmake
405%{_datadir}/cmake/Modules/HPHPSetup.cmake
406%{_datadir}/cmake/Modules/Options.cmake
500006c7 407%{_datadir}/cmake/Modules/hphpize.cmake
This page took 0.130442 seconds and 4 git commands to generate.