]>
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) () | |
11 | %define snap cf9b612 | |
12 | %define rel 0.2 | |
65446f6c ER |
13 | Summary: HipHop for PHP transforms PHP source code into highly optimized C++ |
14 | Name: hiphop-php | |
ef07ca95 | 15 | Version: 1.000 |
be373886 | 16 | Release: %{rel}.%{snap} |
3f49543c | 17 | License: PHP 3.01 |
ac2930bc | 18 | Group: Development/Languages |
be373886 | 19 | Source0: %{name}-%{version}_%{snap}.tar.bz2 |
ef07ca95 ER |
20 | # Source0-md5: 16b7928995a91001657b015fe7f8a06d |
21 | # need fb.changes.patch, which is available for 1.4 only | |
22 | Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz | |
23 | # Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c | |
be373886 | 24 | Source2: get-source.sh |
59f13ffd | 25 | Patch0: cmake-missing-library.patch |
be373886 | 26 | Patch1: libevent14.patch |
ef07ca95 ER |
27 | Patch3: system-xhp.patch |
28 | Patch4: system-libafdt.patch | |
3f49543c ER |
29 | URL: http://wiki.github.com/facebook/hiphop-php/ |
30 | BuildRequires: binutils-devel | |
59f13ffd | 31 | BuildRequires: bison >= 2.3 |
ef07ca95 | 32 | BuildRequires: boost-devel >= 1.39 |
3f49543c | 33 | BuildRequires: cmake >= 2.6.4 |
ac2930bc | 34 | BuildRequires: curl-devel >= 7.20.1-2 |
3f49543c | 35 | BuildRequires: expat-devel |
59f13ffd | 36 | BuildRequires: flex >= 2.5.35 |
3f49543c | 37 | BuildRequires: gd-devel |
be373886 | 38 | BuildRequires: jemalloc-devel |
ef07ca95 | 39 | BuildRequires: libafdt-devel >= 0.1.0 |
3f49543c | 40 | BuildRequires: libcap-devel |
ef07ca95 ER |
41 | #BuildRequires: libevent-devel < 2.0 |
42 | #BuildRequires: libevent-devel >= 1.4.13-2 | |
ac2930bc | 43 | BuildRequires: libicu-devel >= 4.2 |
be373886 | 44 | #BuildRequires: libmbfl-devel |
3f49543c | 45 | BuildRequires: libmcrypt |
ef07ca95 ER |
46 | BuildRequires: libmemcached-devel >= 0.39 |
47 | BuildRequires: libstdc++-devel >= 6:4.3 | |
ac2930bc | 48 | BuildRequires: libxml2-devel |
3f49543c | 49 | BuildRequires: mysql-devel |
ac2930bc | 50 | BuildRequires: oniguruma-devel |
3f49543c ER |
51 | BuildRequires: openssl-devel |
52 | BuildRequires: pcre-devel | |
ef07ca95 | 53 | BuildRequires: php-xhp-devel >= 1.3.9-6 |
3f49543c | 54 | BuildRequires: re2c >= 0.13.0 |
ef07ca95 | 55 | BuildRequires: rpmbuild(macros) >= 1.600 |
ac2930bc | 56 | BuildRequires: tbb-devel >= 2.2 |
3f49543c | 57 | BuildRequires: zlib-devel |
ac2930bc | 58 | ExclusiveArch: %{x8664} |
65446f6c ER |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
60 | ||
61 | %description | |
62 | HipHop transforms your PHP source code into highly optimized C++ and | |
63 | then compiles it with g++ to build binary files. You keep coding in | |
64 | simpler PHP, then HipHop executes your source code in a semantically | |
65 | equivalent manner and sacrifices some rarely used features - such as | |
66 | eval() - in exchange for improved performance. | |
67 | ||
68 | Facebook sees about a 50% reduction in CPU usage when serving equal | |
69 | amounts of Web traffic when compared to Apache and PHP. Facebook's API | |
70 | tier can serve twice the traffic using 30% less CPU. | |
71 | ||
65446f6c | 72 | %prep |
be373886 | 73 | %setup -qn %{name}-%{version}_%{snap} -a1 |
59f13ffd | 74 | %patch0 -p1 |
be373886 | 75 | %patch1 -p1 |
ef07ca95 ER |
76 | #%patch3 -p1 |
77 | %patch4 -p1 | |
78 | ||
79 | ln -s libevent-1.4.*-stable libevent | |
80 | %{__patch} -d libevent -p1 < src/third_party/libevent-1.4.14.fb-changes.diff | |
59f13ffd | 81 | |
be373886 ER |
82 | #rm -rf src/third_party/libmbfl |
83 | #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt | |
84 | ||
ef07ca95 ER |
85 | rm -rf src/third_party/xhp |
86 | rm -rf src/third_party/libafdt | |
ac2930bc ER |
87 | |
88 | %build | |
ef07ca95 ER |
89 | # build libevent 1.4 with fb patches |
90 | if [ ! -d libevent/.libs ]; then | |
91 | cd libevent | |
92 | # TODO: should use static linking, but then it fails to detect libraries due missing -lrt | |
93 | %configure \ | |
94 | %{?0:--enable-static} \ | |
95 | %{?0:--disable-shared} | |
96 | %{__make} | |
97 | ln -s .libs lib | |
98 | ln -s . include | |
99 | cd .. | |
100 | fi | |
101 | ||
ac2930bc ER |
102 | export HPHP_HOME=$(pwd) |
103 | export HPHP_LIB=$HPHP_HOME/bin | |
104 | ||
ef07ca95 ER |
105 | install -d build |
106 | cd build | |
107 | %cmake \ | |
be373886 ER |
108 | -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \ |
109 | -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \ | |
ef07ca95 ER |
110 | -DCMAKE_PREFIX_PATH=%{_prefix} \ |
111 | -DSKIP_BUNDLED_XHP=ON \ | |
be373886 ER |
112 | -DUSE_JEMALLOC=ON \ |
113 | -DUSE_TCMALLOC=OFF \ | |
ef07ca95 | 114 | ../ |
ac2930bc ER |
115 | %{__make} |
116 | ||
65446f6c ER |
117 | %install |
118 | rm -rf $RPM_BUILD_ROOT | |
be373886 ER |
119 | install -d $RPM_BUILD_ROOT%{_bindir} |
120 | install -p build/src/hphp/hphp $RPM_BUILD_ROOT%{_bindir} | |
65446f6c ER |
121 | |
122 | %clean | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
125 | %files | |
126 | %defattr(644,root,root,755) | |
be373886 | 127 | %attr(755,root,root) %{_bindir}/hphp |