]>
Commit | Line | Data |
---|---|---|
ac2930bc | 1 | # TODO |
11ccead6 | 2 | # - system libevent2: https://github.com/facebook/hiphop-php/pull/421 |
59f13ffd | 3 | # - system libmbfl, system xhp, sqlite3 |
1c0ae000 | 4 | %define githash 78394ee |
1fc71018 | 5 | %define rel 0.4 |
ed14b19f | 6 | Summary: Virtual Machine, Runtime, and JIT for PHP |
65446f6c | 7 | Name: hiphop-php |
ed14b19f | 8 | Version: 2.1.0 |
1c0ae000 | 9 | Release: 0.%{githash}.%{rel} |
3f49543c | 10 | License: PHP 3.01 |
ac2930bc | 11 | Group: Development/Languages |
1c0ae000 ER |
12 | Source0: https://github.com/facebook/hiphop-php/archive/%{githash}/HPHP-%{version}.%{githash}.tar.gz |
13 | # Source0-md5: 81742a0535a6bab906208d3756b206d1 | |
ef07ca95 ER |
14 | # need fb.changes.patch, which is available for 1.4 only |
15 | Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz | |
16 | # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c | |
be373886 | 17 | Source2: get-source.sh |
59f13ffd | 18 | Patch0: cmake-missing-library.patch |
be373886 | 19 | Patch1: libevent14.patch |
ef07ca95 ER |
20 | Patch3: system-xhp.patch |
21 | Patch4: system-libafdt.patch | |
6147aa3c | 22 | Patch5: system-folly.patch |
37be4b7f | 23 | Patch6: boost-system-category.patch |
3f49543c ER |
24 | URL: http://wiki.github.com/facebook/hiphop-php/ |
25 | BuildRequires: binutils-devel | |
59f13ffd | 26 | BuildRequires: bison >= 2.3 |
ed14b19f ER |
27 | BuildRequires: boost-devel >= 1.50 |
28 | BuildRequires: cmake >= 2.8.5 | |
29 | BuildRequires: curl-devel >= 7.29.0 | |
30 | BuildRequires: elfutils-devel | |
3f49543c | 31 | BuildRequires: expat-devel |
59f13ffd | 32 | BuildRequires: flex >= 2.5.35 |
3f49543c | 33 | BuildRequires: gd-devel |
ed14b19f ER |
34 | BuildRequires: glog-devel >= 0.3.2 |
35 | BuildRequires: imap-devel >= 1:2007 | |
a0922d01 | 36 | #BuildRequires: jemalloc-devel |
ef07ca95 | 37 | BuildRequires: libafdt-devel >= 0.1.0 |
3f49543c | 38 | BuildRequires: libcap-devel |
ed14b19f ER |
39 | BuildRequires: libdwarf-devel |
40 | #BuildRequires: libevent-devel >= 1.4.14 | |
ac2930bc | 41 | BuildRequires: libicu-devel >= 4.2 |
be373886 | 42 | #BuildRequires: libmbfl-devel |
ed14b19f | 43 | BuildRequires: libmcrypt-devel |
e883c14f | 44 | BuildRequires: libmemcached-devel >= 1.0.4 |
ef07ca95 | 45 | BuildRequires: libstdc++-devel >= 6:4.3 |
ed14b19f | 46 | BuildRequires: libunwind-devel |
ac2930bc | 47 | BuildRequires: libxml2-devel |
3f49543c | 48 | BuildRequires: mysql-devel |
ac2930bc | 49 | BuildRequires: oniguruma-devel |
3f49543c ER |
50 | BuildRequires: openssl-devel |
51 | BuildRequires: pcre-devel | |
ed14b19f | 52 | #BuildRequires: php-xhp-devel >= 1.3.9-6 |
3f49543c | 53 | BuildRequires: re2c >= 0.13.0 |
ed14b19f | 54 | BuildRequires: readline-devel |
ef07ca95 | 55 | BuildRequires: rpmbuild(macros) >= 1.600 |
ed14b19f | 56 | BuildRequires: tbb-devel >= 4.0.6000 |
3f49543c | 57 | BuildRequires: zlib-devel |
65446f6c ER |
58 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
59 | ||
755be3cf ER |
60 | # strip would remove systemlib.php copied into binary |
61 | # see CMake/HPHPFunctions.cmake embed_systemlib function | |
62 | %define _noautostrip .*%{_bindir}/hhvm | |
63 | ||
65446f6c | 64 | %description |
ed14b19f ER |
65 | HipHop VM (HHVM) is a new open-source virtual machine designed for |
66 | executing programs written in PHP. HHVM uses a just-in-time | |
67 | compilation approach to achieve superior performance while maintaining | |
68 | the flexibility that PHP developers are accustomed to. HipHop VM (and | |
69 | before it HPHPc) has realized > 5x increase in throughput for Facebook | |
70 | compared with Zend PHP 5.2. | |
65446f6c | 71 | |
ed14b19f ER |
72 | HipHop is most commonly run as a standalone server, replacing both |
73 | Apache and mod_php. | |
65446f6c | 74 | |
65446f6c | 75 | %prep |
1c0ae000 ER |
76 | %setup -qc -a1 |
77 | mv %{name}-%{githash}*/* . | |
6147aa3c | 78 | %patch5 -p1 |
37be4b7f | 79 | %patch6 -p1 |
ed14b19f ER |
80 | |
81 | ln -s libevent-1.4.*-stable libevent | |
82 | %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff | |
83 | ||
84 | %if 0 | |
59f13ffd | 85 | %patch0 -p1 |
be373886 | 86 | %patch1 -p1 |
ef07ca95 ER |
87 | #%patch3 -p1 |
88 | %patch4 -p1 | |
89 | ||
59f13ffd | 90 | |
be373886 ER |
91 | #rm -rf src/third_party/libmbfl |
92 | #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt | |
93 | ||
ef07ca95 ER |
94 | rm -rf src/third_party/xhp |
95 | rm -rf src/third_party/libafdt | |
ed14b19f | 96 | %endif |
ac2930bc ER |
97 | |
98 | %build | |
ef07ca95 ER |
99 | # build libevent 1.4 with fb patches |
100 | if [ ! -d libevent/.libs ]; then | |
101 | cd libevent | |
102 | # TODO: should use static linking, but then it fails to detect libraries due missing -lrt | |
103 | %configure \ | |
104 | %{?0:--enable-static} \ | |
105 | %{?0:--disable-shared} | |
106 | %{__make} | |
107 | ln -s .libs lib | |
108 | ln -s . include | |
109 | cd .. | |
110 | fi | |
111 | ||
ac2930bc ER |
112 | export HPHP_HOME=$(pwd) |
113 | export HPHP_LIB=$HPHP_HOME/bin | |
114 | ||
ed14b19f ER |
115 | %if 0 |
116 | export LIBEVENT_PREFIX=$HPHP_HOME/libevent | |
117 | ||
118 | -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \ | |
119 | -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \ | |
120 | -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \ | |
121 | %endif | |
122 | ||
e883c14f ER |
123 | %if 0 |
124 | # out of dir build broken (can't find it's tools) | |
ef07ca95 ER |
125 | install -d build |
126 | cd build | |
e883c14f ER |
127 | %endif |
128 | ||
ed14b19f | 129 | CPPFLAGS="%{rpmcppflags} -fno-permissive" |
ef07ca95 | 130 | %cmake \ |
ed14b19f | 131 | -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \ |
c5cd2e9b | 132 | -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \ |
ef07ca95 ER |
133 | -DCMAKE_PREFIX_PATH=%{_prefix} \ |
134 | -DSKIP_BUNDLED_XHP=ON \ | |
a0922d01 | 135 | -DUSE_JEMALLOC=OFF \ |
be373886 | 136 | -DUSE_TCMALLOC=OFF \ |
e883c14f | 137 | ./ |
ac2930bc ER |
138 | %{__make} |
139 | ||
65446f6c ER |
140 | %install |
141 | rm -rf $RPM_BUILD_ROOT | |
8d9f731f ER |
142 | %{__make} install \ |
143 | DESTDIR=$RPM_BUILD_ROOT | |
144 | ||
44fcba3e | 145 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf |
17307be4 | 146 | cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf |
44fcba3e | 147 | |
8d9f731f ER |
148 | # install our libevent for now |
149 | install -d $RPM_BUILD_ROOT%{_libdir} | |
150 | libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir} | |
151 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so} | |
65446f6c ER |
152 | |
153 | %clean | |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
8d9f731f ER |
156 | %post -p /sbin/ldconfig |
157 | %postun -p /sbin/ldconfig | |
158 | ||
65446f6c ER |
159 | %files |
160 | %defattr(644,root,root,755) | |
1c0ae000 | 161 | %doc README.md hphp/NEWS |
8d9f731f ER |
162 | %attr(755,root,root) %{_bindir}/hhvm |
163 | %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.* | |
164 | %ghost %{_libdir}/libevent-1.4.so.2 | |
44fcba3e ER |
165 | |
166 | %dir %{_datadir}/%{name} | |
167 | %dir %{_datadir}/%{name}/hdf | |
168 | %{_datadir}/%{name}/hdf/static.mime-types.hdf |