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