]>
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 |
1c0ae000 | 6 | %define githash 78394ee |
89ad59aa | 7 | %define rel 0.7 |
ed14b19f | 8 | Summary: Virtual Machine, Runtime, and JIT for PHP |
65446f6c | 9 | Name: hiphop-php |
ed14b19f | 10 | Version: 2.1.0 |
1c0ae000 | 11 | Release: 0.%{githash}.%{rel} |
3f49543c | 12 | License: PHP 3.01 |
ac2930bc | 13 | Group: Development/Languages |
1c0ae000 ER |
14 | Source0: https://github.com/facebook/hiphop-php/archive/%{githash}/HPHP-%{version}.%{githash}.tar.gz |
15 | # Source0-md5: 81742a0535a6bab906208d3756b206d1 | |
ef07ca95 ER |
16 | # need fb.changes.patch, which is available for 1.4 only |
17 | Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz | |
18 | # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c | |
be373886 | 19 | Source2: 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 |
37be4b7f | 25 | Patch6: boost-system-category.patch |
3f49543c ER |
26 | URL: http://wiki.github.com/facebook/hiphop-php/ |
27 | BuildRequires: binutils-devel | |
59f13ffd | 28 | BuildRequires: bison >= 2.3 |
ed14b19f ER |
29 | BuildRequires: boost-devel >= 1.50 |
30 | BuildRequires: cmake >= 2.8.5 | |
31 | BuildRequires: curl-devel >= 7.29.0 | |
32 | BuildRequires: elfutils-devel | |
3f49543c | 33 | BuildRequires: expat-devel |
59f13ffd | 34 | BuildRequires: flex >= 2.5.35 |
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 |
17c75ade | 60 | ExclusiveArch: %{x8664} |
65446f6c ER |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
63 | %description | |
ed14b19f ER |
64 | HipHop VM (HHVM) is a new open-source virtual machine designed for |
65 | executing programs written in PHP. HHVM uses a just-in-time | |
66 | compilation approach to achieve superior performance while maintaining | |
67 | the flexibility that PHP developers are accustomed to. HipHop VM (and | |
68 | before it HPHPc) has realized > 5x increase in throughput for Facebook | |
69 | compared with Zend PHP 5.2. | |
65446f6c | 70 | |
ed14b19f ER |
71 | HipHop is most commonly run as a standalone server, replacing both |
72 | Apache and mod_php. | |
65446f6c | 73 | |
65446f6c | 74 | %prep |
1c0ae000 ER |
75 | %setup -qc -a1 |
76 | mv %{name}-%{githash}*/* . | |
f8472382 ER |
77 | |
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 | ||
89ad59aa ER |
115 | # asm linking breaks on $CC containing spaces |
116 | if [[ "%{__cc}" = *ccache* ]]; then | |
117 | cat <<-'EOF' > $HPHP_LIB/gcc | |
118 | #!/bin/sh | |
119 | exec %{__cc} "$@" | |
120 | EOF | |
121 | chmod +x $HPHP_LIB/gcc | |
122 | CC=$HPHP_LIB/gcc | |
123 | fi | |
124 | ||
ed14b19f ER |
125 | %if 0 |
126 | export LIBEVENT_PREFIX=$HPHP_HOME/libevent | |
127 | ||
128 | -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \ | |
129 | -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \ | |
130 | -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \ | |
131 | %endif | |
132 | ||
e883c14f ER |
133 | %if 0 |
134 | # out of dir build broken (can't find it's tools) | |
ef07ca95 ER |
135 | install -d build |
136 | cd build | |
e883c14f ER |
137 | %endif |
138 | ||
ed14b19f | 139 | CPPFLAGS="%{rpmcppflags} -fno-permissive" |
ef07ca95 | 140 | %cmake \ |
ed14b19f | 141 | -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \ |
c5cd2e9b | 142 | -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \ |
ef07ca95 ER |
143 | -DCMAKE_PREFIX_PATH=%{_prefix} \ |
144 | -DSKIP_BUNDLED_XHP=ON \ | |
a0922d01 | 145 | -DUSE_JEMALLOC=OFF \ |
be373886 | 146 | -DUSE_TCMALLOC=OFF \ |
e883c14f | 147 | ./ |
c513fdf6 ER |
148 | |
149 | # setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo | |
150 | # see hphp/util/generate-buildinfo.sh | |
151 | sha=$(echo %{name}-%{githash}*) | |
152 | export COMPILER_ID=HPHP-%{version}-%{release}-${sha#%{name}-} | |
153 | export HHVM_REPO_SCHEMA=$(date +%N_%s) | |
154 | ||
ac2930bc ER |
155 | %{__make} |
156 | ||
65446f6c ER |
157 | %install |
158 | rm -rf $RPM_BUILD_ROOT | |
8d9f731f | 159 | %{__make} install \ |
05199c54 | 160 | HPHP_HOME=$(pwd) \ |
8d9f731f ER |
161 | DESTDIR=$RPM_BUILD_ROOT |
162 | ||
44fcba3e | 163 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf |
17307be4 | 164 | cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf |
44fcba3e | 165 | |
8d9f731f ER |
166 | # install our libevent for now |
167 | install -d $RPM_BUILD_ROOT%{_libdir} | |
168 | libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir} | |
169 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so} | |
65446f6c ER |
170 | |
171 | %clean | |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | ||
8d9f731f ER |
174 | %post -p /sbin/ldconfig |
175 | %postun -p /sbin/ldconfig | |
176 | ||
65446f6c ER |
177 | %files |
178 | %defattr(644,root,root,755) | |
1c0ae000 | 179 | %doc README.md hphp/NEWS |
8d9f731f ER |
180 | %attr(755,root,root) %{_bindir}/hhvm |
181 | %attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.* | |
182 | %ghost %{_libdir}/libevent-1.4.so.2 | |
44fcba3e ER |
183 | |
184 | %dir %{_datadir}/%{name} | |
185 | %dir %{_datadir}/%{name}/hdf | |
186 | %{_datadir}/%{name}/hdf/static.mime-types.hdf |