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