2 # - system libmbfl, system xhp, sqlite3
3 # - there should be a bit more packaged into files
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
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) ()
13 Summary: HipHop for PHP transforms PHP source code into highly optimized C++
16 Release: %{rel}.%{snap}
18 Group: Development/Languages
19 Source0: %{name}-%{version}_%{snap}.tar.bz2
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
24 Source2: get-source.sh
25 Patch0: cmake-missing-library.patch
26 Patch1: libevent14.patch
27 Patch3: system-xhp.patch
28 Patch4: system-libafdt.patch
29 URL: http://wiki.github.com/facebook/hiphop-php/
30 BuildRequires: binutils-devel
31 BuildRequires: bison >= 2.3
32 BuildRequires: boost-devel >= 1.39
33 BuildRequires: cmake >= 2.6.4
34 BuildRequires: curl-devel >= 7.20.1-2
35 BuildRequires: expat-devel
36 BuildRequires: flex >= 2.5.35
37 BuildRequires: gd-devel
38 BuildRequires: jemalloc-devel
39 BuildRequires: libafdt-devel >= 0.1.0
40 BuildRequires: libcap-devel
41 #BuildRequires: libevent-devel < 2.0
42 #BuildRequires: libevent-devel >= 1.4.13-2
43 BuildRequires: libicu-devel >= 4.2
44 #BuildRequires: libmbfl-devel
45 BuildRequires: libmcrypt
46 BuildRequires: libmemcached-devel >= 0.39
47 BuildRequires: libstdc++-devel >= 6:4.3
48 BuildRequires: libxml2-devel
49 BuildRequires: mysql-devel
50 BuildRequires: oniguruma-devel
51 BuildRequires: openssl-devel
52 BuildRequires: pcre-devel
53 BuildRequires: php-xhp-devel >= 1.3.9-6
54 BuildRequires: re2c >= 0.13.0
55 BuildRequires: rpmbuild(macros) >= 1.600
56 BuildRequires: tbb-devel >= 2.2
57 BuildRequires: zlib-devel
58 ExclusiveArch: %{x8664}
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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.
73 %setup -qn %{name}-%{version}_%{snap} -a1
79 ln -s libevent-1.4.*-stable libevent
80 %{__patch} -d libevent -p1 < src/third_party/libevent-1.4.14.fb-changes.diff
82 #rm -rf src/third_party/libmbfl
83 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
85 rm -rf src/third_party/xhp
86 rm -rf src/third_party/libafdt
89 # build libevent 1.4 with fb patches
90 if [ ! -d libevent/.libs ]; then
92 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
94 %{?0:--enable-static} \
95 %{?0:--disable-shared}
102 export HPHP_HOME=$(pwd)
103 export HPHP_LIB=$HPHP_HOME/bin
108 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
109 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
110 -DCMAKE_PREFIX_PATH=%{_prefix} \
111 -DSKIP_BUNDLED_XHP=ON \
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT%{_bindir}
120 install -p build/src/hphp/hphp $RPM_BUILD_ROOT%{_bindir}
123 rm -rf $RPM_BUILD_ROOT
126 %defattr(644,root,root,755)
127 %attr(755,root,root) %{_bindir}/hphp