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