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