]>
Commit | Line | Data |
---|---|---|
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 | 7 | Summary: Virtual Machine, Runtime, and JIT for PHP |
aa7908cc ER |
8 | Name: hhvm |
9 | Version: 2.3.2 | |
991b3017 | 10 | Release: 0.2 |
3f49543c | 11 | License: PHP 3.01 |
ac2930bc | 12 | Group: Development/Languages |
aa7908cc ER |
13 | Source0: 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 |
16 | Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz | |
17 | # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c | |
991b3017 ER |
18 | Source2: https://github.com/facebook/folly/archive/4d6d659/folly-%{version}-4d6d659.tar.gz |
19 | Source100: get-source.sh | |
59f13ffd | 20 | Patch0: cmake-missing-library.patch |
be373886 | 21 | Patch1: libevent14.patch |
ef07ca95 ER |
22 | Patch3: system-xhp.patch |
23 | Patch4: system-libafdt.patch | |
6147aa3c | 24 | Patch5: system-folly.patch |
3f49543c ER |
25 | URL: http://wiki.github.com/facebook/hiphop-php/ |
26 | BuildRequires: binutils-devel | |
59f13ffd | 27 | BuildRequires: bison >= 2.3 |
ed14b19f | 28 | BuildRequires: boost-devel >= 1.50 |
991b3017 | 29 | BuildRequires: cmake >= 2.8.7 |
ed14b19f ER |
30 | BuildRequires: curl-devel >= 7.29.0 |
31 | BuildRequires: elfutils-devel | |
3f49543c | 32 | BuildRequires: expat-devel |
59f13ffd | 33 | BuildRequires: flex >= 2.5.35 |
5c61d46f | 34 | BuildRequires: gcc >= 6:4.6.0 |
3f49543c | 35 | BuildRequires: gd-devel |
ed14b19f ER |
36 | BuildRequires: glog-devel >= 0.3.2 |
37 | BuildRequires: imap-devel >= 1:2007 | |
991b3017 | 38 | #BuildRequires: jemalloc-devel >= 3.0.0 |
ef07ca95 | 39 | BuildRequires: libafdt-devel >= 0.1.0 |
3f49543c | 40 | BuildRequires: libcap-devel |
ed14b19f ER |
41 | BuildRequires: libdwarf-devel |
42 | #BuildRequires: libevent-devel >= 1.4.14 | |
ac2930bc | 43 | BuildRequires: libicu-devel >= 4.2 |
be373886 | 44 | #BuildRequires: libmbfl-devel |
ed14b19f | 45 | BuildRequires: libmcrypt-devel |
e883c14f | 46 | BuildRequires: libmemcached-devel >= 1.0.4 |
ef07ca95 | 47 | BuildRequires: libstdc++-devel >= 6:4.3 |
ed14b19f | 48 | BuildRequires: libunwind-devel |
ac2930bc | 49 | BuildRequires: libxml2-devel |
3f49543c | 50 | BuildRequires: mysql-devel |
ac2930bc | 51 | BuildRequires: oniguruma-devel |
3f49543c ER |
52 | BuildRequires: openssl-devel |
53 | BuildRequires: pcre-devel | |
ed14b19f | 54 | #BuildRequires: php-xhp-devel >= 1.3.9-6 |
3f49543c | 55 | BuildRequires: re2c >= 0.13.0 |
ed14b19f | 56 | BuildRequires: readline-devel |
89ad59aa | 57 | BuildRequires: rpmbuild(macros) >= 1.675 |
ed14b19f | 58 | BuildRequires: tbb-devel >= 4.0.6000 |
3f49543c | 59 | BuildRequires: zlib-devel |
206caaaf ER |
60 | Provides: php(apc) |
61 | Provides: php(bcmath) | |
991b3017 | 62 | Provides: php(bz2) |
206caaaf ER |
63 | Provides: php(ctype) |
64 | Provides: php(curl) | |
65 | Provides: php(date) | |
66 | Provides: php(dom) | |
67 | Provides: php(exif) | |
68 | Provides: php(fb) | |
991b3017 | 69 | Provides: php(fileinfo) |
206caaaf ER |
70 | Provides: php(filter) |
71 | Provides: php(gd) | |
72 | Provides: php(hash) | |
73 | Provides: php(hotprofiler) | |
74 | Provides: php(iconv) | |
991b3017 | 75 | Provides: php(icu_num_fmt) |
206caaaf ER |
76 | Provides: php(icu_ucsdet) |
77 | Provides: php(icu_uspoof) | |
78 | Provides: php(idn) | |
79 | Provides: php(imap) | |
80 | Provides: php(json) | |
81 | Provides: php(ldap) | |
82 | Provides: php(mbstring) | |
83 | Provides: php(mcrypt) | |
84 | Provides: php(memcache) | |
85 | Provides: php(memcached) | |
86 | Provides: php(mysql) | |
87 | Provides: php(openssl) | |
88 | Provides: php(pcntl) | |
89 | Provides: php(pcre) | |
90 | Provides: php(pdo) | |
91 | Provides: php(pdo_mysql) | |
92 | Provides: php(pdo_sqlite) | |
93 | Provides: php(phar) | |
94 | Provides: php(posix) | |
95 | Provides: php(reflection) | |
96 | Provides: php(server) | |
97 | Provides: php(session) | |
98 | Provides: php(simplexml) | |
99 | Provides: php(soap) | |
100 | Provides: php(sockets) | |
101 | Provides: php(spl) | |
102 | Provides: php(sqlite3) | |
103 | Provides: php(sysvmsg) | |
104 | Provides: php(sysvsem) | |
105 | Provides: php(sysvshm) | |
106 | Provides: php(thread) | |
107 | Provides: php(thrift_protocol) | |
108 | Provides: php(tokenizer) | |
109 | Provides: php(xhprof) | |
110 | Provides: php(xml) | |
111 | Provides: php(xmlreader) | |
112 | Provides: php(xmlwriter) | |
991b3017 | 113 | Provides: php(zip) |
206caaaf | 114 | Provides: php(zlib) |
991b3017 | 115 | Obsoletes: hiphop-php < 2.3.2-0.2 |
17c75ade | 116 | ExclusiveArch: %{x8664} |
65446f6c ER |
117 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
118 | ||
119 | %description | |
aa7908cc ER |
120 | HHVM (aka the HipHop Virtual Machine) is a new open-source virtual |
121 | machine designed for executing programs written in PHP. HHVM uses a | |
122 | just-in-time compilation approach to achieve superior performance | |
123 | while maintaining the flexibility that PHP developers are accustomed | |
124 | to. To date, HHVM (and its predecessor HPHPc before it) has realized | |
125 | over a 9x increase in web request throughput and over a 5x reduction | |
126 | in memory consumption for Facebook compared with the Zend PHP 5.2 | |
127 | engine + APC. | |
128 | ||
129 | HHVM can be run as a standalone webserver (i.e. without the Apache | |
130 | webserver and the "mod_php" extension). HHVM can also be used together | |
131 | with a FastCGI-based webserver, and work is in progress to make HHVM | |
132 | work smoothly with Apache. | |
65446f6c | 133 | |
65446f6c | 134 | %prep |
991b3017 ER |
135 | %setup -q -a1 -a2 -n %{name}-HHVM-%{version} |
136 | ||
137 | mv folly-*/* hphp/submodules/folly | |
f8472382 ER |
138 | |
139 | #%patch5 -p1 | |
ed14b19f ER |
140 | |
141 | ln -s libevent-1.4.*-stable libevent | |
142 | %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff | |
143 | ||
144 | %if 0 | |
59f13ffd | 145 | %patch0 -p1 |
be373886 | 146 | %patch1 -p1 |
ef07ca95 ER |
147 | #%patch3 -p1 |
148 | %patch4 -p1 | |
149 | ||
59f13ffd | 150 | |
be373886 ER |
151 | #rm -rf src/third_party/libmbfl |
152 | #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt | |
153 | ||
ef07ca95 ER |
154 | rm -rf src/third_party/xhp |
155 | rm -rf src/third_party/libafdt | |
ed14b19f | 156 | %endif |
ac2930bc ER |
157 | |
158 | %build | |
ef07ca95 ER |
159 | # build libevent 1.4 with fb patches |
160 | if [ ! -d libevent/.libs ]; then | |
161 | cd libevent | |
162 | # TODO: should use static linking, but then it fails to detect libraries due missing -lrt | |
163 | %configure \ | |
164 | %{?0:--enable-static} \ | |
165 | %{?0:--disable-shared} | |
166 | %{__make} | |
167 | ln -s .libs lib | |
168 | ln -s . include | |
169 | cd .. | |
170 | fi | |
171 | ||
ac2930bc ER |
172 | export HPHP_HOME=$(pwd) |
173 | export HPHP_LIB=$HPHP_HOME/bin | |
991b3017 | 174 | install -d $HPHP_LIB |
ac2930bc | 175 | |
89ad59aa ER |
176 | # asm linking breaks on $CC containing spaces |
177 | if [[ "%{__cc}" = *ccache* ]]; then | |
178 | cat <<-'EOF' > $HPHP_LIB/gcc | |
179 | #!/bin/sh | |
180 | exec %{__cc} "$@" | |
181 | EOF | |
182 | chmod +x $HPHP_LIB/gcc | |
183 | CC=$HPHP_LIB/gcc | |
184 | fi | |
185 | ||
ed14b19f ER |
186 | %if 0 |
187 | export LIBEVENT_PREFIX=$HPHP_HOME/libevent | |
188 | ||
189 | -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \ | |
190 | -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \ | |
191 | -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \ | |
192 | %endif | |
193 | ||
e883c14f ER |
194 | %if 0 |
195 | # out of dir build broken (can't find it's tools) | |
ef07ca95 ER |
196 | install -d build |
197 | cd build | |
e883c14f ER |
198 | %endif |
199 | ||
ef07ca95 | 200 | %cmake \ |
ed14b19f | 201 | -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \ |
c5cd2e9b | 202 | -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \ |
ef07ca95 ER |
203 | -DCMAKE_PREFIX_PATH=%{_prefix} \ |
204 | -DSKIP_BUNDLED_XHP=ON \ | |
a0922d01 | 205 | -DUSE_JEMALLOC=OFF \ |
be373886 | 206 | -DUSE_TCMALLOC=OFF \ |
e883c14f | 207 | ./ |
c513fdf6 ER |
208 | |
209 | # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo | |
210 | # see hphp/util/generate-buildinfo.sh | |
991b3017 | 211 | export COMPILER_ID=HPHP-%{version}-%{release}-%{githash} |
c513fdf6 ER |
212 | export HHVM_REPO_SCHEMA=$(date +%N_%s) |
213 | ||
ac2930bc ER |
214 | %{__make} |
215 | ||
65446f6c ER |
216 | %install |
217 | rm -rf $RPM_BUILD_ROOT | |
8d9f731f | 218 | %{__make} install \ |
05199c54 | 219 | HPHP_HOME=$(pwd) \ |
8d9f731f ER |
220 | DESTDIR=$RPM_BUILD_ROOT |
221 | ||
44fcba3e | 222 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf |
17307be4 | 223 | cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf |
44fcba3e | 224 | |
8d9f731f ER |
225 | # install our libevent for now |
226 | install -d $RPM_BUILD_ROOT%{_libdir} | |
227 | libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir} | |
228 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so} | |
65446f6c ER |
229 | |
230 | %clean | |
231 | rm -rf $RPM_BUILD_ROOT | |
232 | ||
8d9f731f ER |
233 | %post -p /sbin/ldconfig |
234 | %postun -p /sbin/ldconfig | |
235 | ||
65446f6c ER |
236 | %files |
237 | %defattr(644,root,root,755) | |
1c0ae000 | 238 | %doc README.md hphp/NEWS |
8d9f731f ER |
239 | %attr(755,root,root) %{_bindir}/hhvm |
240 | %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.* | |
241 | %ghost %{_libdir}/libevent-1.4.so.2 | |
44fcba3e ER |
242 | |
243 | %dir %{_datadir}/%{name} | |
244 | %dir %{_datadir}/%{name}/hdf | |
245 | %{_datadir}/%{name}/hdf/static.mime-types.hdf |