]>
Commit | Line | Data |
---|---|---|
ac2930bc | 1 | # TODO |
59f13ffd ER |
2 | # - system libmbfl, system xhp, sqlite3 |
3 | # - there should be a bit more packaged into files | |
be373886 ER |
4 | # - linking segfaults |
5 | # using bfd and gcc-6:4.6.2-2.x86_64 binutils-3:2.22.51.0.1-1.x86_64 | |
6 | # 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 | |
7 | # Segmentation fault | |
8 | # make[2]: *** [src/hphp/hphp] Error 139 | |
9 | # relinking succeeds, but resulting binary segfaults as well: | |
10 | # 0x0000000000b9cc0b in HPHP::Extension::LoadModules(HPHP::Hdf) () | |
ed14b19f | 11 | Summary: Virtual Machine, Runtime, and JIT for PHP |
65446f6c | 12 | Name: hiphop-php |
ed14b19f ER |
13 | Version: 2.1.0 |
14 | Release: 0.1 | |
3f49543c | 15 | License: PHP 3.01 |
ac2930bc | 16 | Group: Development/Languages |
ed14b19f ER |
17 | Source0: https://github.com/facebook/hiphop-php/archive/HPHP-%{version}.tar.gz |
18 | # Source0-md5: edd3d8b4371d38286c7c5f0c2582f5e1 | |
ef07ca95 ER |
19 | # need fb.changes.patch, which is available for 1.4 only |
20 | Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz | |
21 | # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c | |
be373886 | 22 | Source2: get-source.sh |
59f13ffd | 23 | Patch0: cmake-missing-library.patch |
be373886 | 24 | Patch1: libevent14.patch |
ef07ca95 ER |
25 | Patch3: system-xhp.patch |
26 | Patch4: system-libafdt.patch | |
3f49543c ER |
27 | URL: http://wiki.github.com/facebook/hiphop-php/ |
28 | BuildRequires: binutils-devel | |
59f13ffd | 29 | BuildRequires: bison >= 2.3 |
ed14b19f ER |
30 | BuildRequires: boost-devel >= 1.50 |
31 | BuildRequires: cmake >= 2.8.5 | |
32 | BuildRequires: curl-devel >= 7.29.0 | |
33 | BuildRequires: elfutils-devel | |
3f49543c | 34 | BuildRequires: expat-devel |
59f13ffd | 35 | BuildRequires: flex >= 2.5.35 |
3f49543c | 36 | BuildRequires: gd-devel |
ed14b19f ER |
37 | BuildRequires: glog-devel >= 0.3.2 |
38 | BuildRequires: imap-devel >= 1:2007 | |
be373886 | 39 | BuildRequires: jemalloc-devel |
ef07ca95 | 40 | BuildRequires: libafdt-devel >= 0.1.0 |
3f49543c | 41 | BuildRequires: libcap-devel |
ed14b19f ER |
42 | BuildRequires: libdwarf-devel |
43 | #BuildRequires: libevent-devel >= 1.4.14 | |
ac2930bc | 44 | BuildRequires: libicu-devel >= 4.2 |
be373886 | 45 | #BuildRequires: libmbfl-devel |
ed14b19f ER |
46 | BuildRequires: libmcrypt-devel |
47 | BuildRequires: libmemcached-devel >= 1.0.9 | |
ef07ca95 | 48 | BuildRequires: libstdc++-devel >= 6:4.3 |
ed14b19f | 49 | BuildRequires: libunwind-devel |
ac2930bc | 50 | BuildRequires: libxml2-devel |
3f49543c | 51 | BuildRequires: mysql-devel |
ac2930bc | 52 | BuildRequires: oniguruma-devel |
3f49543c ER |
53 | BuildRequires: openssl-devel |
54 | BuildRequires: pcre-devel | |
ed14b19f | 55 | #BuildRequires: php-xhp-devel >= 1.3.9-6 |
3f49543c | 56 | BuildRequires: re2c >= 0.13.0 |
ed14b19f | 57 | BuildRequires: readline-devel |
ef07ca95 | 58 | BuildRequires: rpmbuild(macros) >= 1.600 |
ed14b19f | 59 | BuildRequires: tbb-devel >= 4.0.6000 |
3f49543c | 60 | BuildRequires: zlib-devel |
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 |
ed14b19f ER |
75 | %setup -q -n %{name}-HPHP-%{version} -a1 |
76 | ||
77 | ln -s libevent-1.4.*-stable libevent | |
78 | %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff | |
79 | ||
80 | %if 0 | |
59f13ffd | 81 | %patch0 -p1 |
be373886 | 82 | %patch1 -p1 |
ef07ca95 ER |
83 | #%patch3 -p1 |
84 | %patch4 -p1 | |
85 | ||
59f13ffd | 86 | |
be373886 ER |
87 | #rm -rf src/third_party/libmbfl |
88 | #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt | |
89 | ||
ef07ca95 ER |
90 | rm -rf src/third_party/xhp |
91 | rm -rf src/third_party/libafdt | |
ed14b19f | 92 | %endif |
ac2930bc ER |
93 | |
94 | %build | |
ef07ca95 ER |
95 | # build libevent 1.4 with fb patches |
96 | if [ ! -d libevent/.libs ]; then | |
97 | cd libevent | |
98 | # TODO: should use static linking, but then it fails to detect libraries due missing -lrt | |
99 | %configure \ | |
100 | %{?0:--enable-static} \ | |
101 | %{?0:--disable-shared} | |
102 | %{__make} | |
103 | ln -s .libs lib | |
104 | ln -s . include | |
105 | cd .. | |
106 | fi | |
107 | ||
ed14b19f | 108 | export USE_HHVM=1 |
ac2930bc ER |
109 | export HPHP_HOME=$(pwd) |
110 | export HPHP_LIB=$HPHP_HOME/bin | |
111 | ||
ed14b19f ER |
112 | %if 0 |
113 | export LIBEVENT_PREFIX=$HPHP_HOME/libevent | |
114 | ||
115 | -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \ | |
116 | -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \ | |
117 | -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \ | |
118 | %endif | |
119 | ||
ef07ca95 ER |
120 | install -d build |
121 | cd build | |
ed14b19f | 122 | CPPFLAGS="%{rpmcppflags} -fno-permissive" |
ef07ca95 | 123 | %cmake \ |
ed14b19f | 124 | -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \ |
ef07ca95 ER |
125 | -DCMAKE_PREFIX_PATH=%{_prefix} \ |
126 | -DSKIP_BUNDLED_XHP=ON \ | |
be373886 ER |
127 | -DUSE_JEMALLOC=ON \ |
128 | -DUSE_TCMALLOC=OFF \ | |
ef07ca95 | 129 | ../ |
ac2930bc ER |
130 | %{__make} |
131 | ||
65446f6c ER |
132 | %install |
133 | rm -rf $RPM_BUILD_ROOT | |
be373886 ER |
134 | install -d $RPM_BUILD_ROOT%{_bindir} |
135 | install -p build/src/hphp/hphp $RPM_BUILD_ROOT%{_bindir} | |
65446f6c ER |
136 | |
137 | %clean | |
138 | rm -rf $RPM_BUILD_ROOT | |
139 | ||
140 | %files | |
141 | %defattr(644,root,root,755) | |
be373886 | 142 | %attr(755,root,root) %{_bindir}/hphp |