]> git.pld-linux.org Git - packages/hhvm.git/blob - hiphop-php.spec
add link to PR for libevent2 patch
[packages/hhvm.git] / hiphop-php.spec
1 # TODO
2 # - system libevent2: https://github.com/facebook/hiphop-php/pull/421
3 # - system libmbfl, system xhp, sqlite3
4 # - there should be a bit more packaged into files
5 # - linking segfaults
6 #   using bfd and gcc-6:4.6.2-2.x86_64 binutils-3:2.22.51.0.1-1.x86_64
7 #   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 #   Segmentation fault
9 #   make[2]: *** [src/hphp/hphp] Error 139
10 #   relinking succeeds, but resulting binary segfaults as well:
11 #   0x0000000000b9cc0b in HPHP::Extension::LoadModules(HPHP::Hdf) ()
12 Summary:        Virtual Machine, Runtime, and JIT for PHP
13 Name:           hiphop-php
14 Version:        2.1.0
15 Release:        0.1
16 License:        PHP 3.01
17 Group:          Development/Languages
18 Source0:        https://github.com/facebook/hiphop-php/archive/HPHP-%{version}.tar.gz
19 # Source0-md5:  edd3d8b4371d38286c7c5f0c2582f5e1
20 # need fb.changes.patch, which is available for 1.4 only
21 Source1:        http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
22 # Source1-md5:  a00e037e4d3f9e4fe9893e8a2d27918c
23 Source2:        get-source.sh
24 Patch0:         cmake-missing-library.patch
25 Patch1:         libevent14.patch
26 Patch3:         system-xhp.patch
27 Patch4:         system-libafdt.patch
28 Patch5:         system-folly.patch
29 Patch6:         boost-system-category.patch
30 Patch7:         gcc4.8.patch
31 URL:            http://wiki.github.com/facebook/hiphop-php/
32 BuildRequires:  binutils-devel
33 BuildRequires:  bison >= 2.3
34 BuildRequires:  boost-devel >= 1.50
35 BuildRequires:  cmake >= 2.8.5
36 BuildRequires:  curl-devel >= 7.29.0
37 BuildRequires:  elfutils-devel
38 BuildRequires:  expat-devel
39 BuildRequires:  flex >= 2.5.35
40 BuildRequires:  gd-devel
41 BuildRequires:  glog-devel >= 0.3.2
42 BuildRequires:  imap-devel >= 1:2007
43 #BuildRequires: jemalloc-devel
44 BuildRequires:  libafdt-devel >= 0.1.0
45 BuildRequires:  libcap-devel
46 BuildRequires:  libdwarf-devel
47 #BuildRequires: libevent-devel >= 1.4.14
48 BuildRequires:  libicu-devel >= 4.2
49 #BuildRequires: libmbfl-devel
50 BuildRequires:  libmcrypt-devel
51 BuildRequires:  libmemcached-devel >= 1.0.4
52 BuildRequires:  libstdc++-devel >= 6:4.3
53 BuildRequires:  libunwind-devel
54 BuildRequires:  libxml2-devel
55 BuildRequires:  mysql-devel
56 BuildRequires:  oniguruma-devel
57 BuildRequires:  openssl-devel
58 BuildRequires:  pcre-devel
59 #BuildRequires: php-xhp-devel >= 1.3.9-6
60 BuildRequires:  re2c >= 0.13.0
61 BuildRequires:  readline-devel
62 BuildRequires:  rpmbuild(macros) >= 1.600
63 BuildRequires:  tbb-devel >= 4.0.6000
64 BuildRequires:  zlib-devel
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %description
68 HipHop VM (HHVM) is a new open-source virtual machine designed for
69 executing programs written in PHP. HHVM uses a just-in-time
70 compilation approach to achieve superior performance while maintaining
71 the flexibility that PHP developers are accustomed to. HipHop VM (and
72 before it HPHPc) has realized > 5x increase in throughput for Facebook
73 compared with Zend PHP 5.2.
74
75 HipHop is most commonly run as a standalone server, replacing both
76 Apache and mod_php.
77
78 %prep
79 %setup -q -n %{name}-HPHP-%{version} -a1
80 %patch5 -p1
81 %patch6 -p1
82 %patch7 -p1
83
84 ln -s libevent-1.4.*-stable libevent
85 %{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
86
87 %if 0
88 %patch0 -p1
89 %patch1 -p1
90 #%patch3 -p1
91 %patch4 -p1
92
93
94 #rm -rf src/third_party/libmbfl
95 #sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
96
97 rm -rf src/third_party/xhp
98 rm -rf src/third_party/libafdt
99 %endif
100
101 %build
102 # build libevent 1.4 with fb patches
103 if [ ! -d libevent/.libs ]; then
104         cd libevent
105         # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
106         %configure \
107                 %{?0:--enable-static} \
108                 %{?0:--disable-shared}
109         %{__make}
110         ln -s .libs lib
111         ln -s . include
112         cd ..
113 fi
114
115 export HPHP_HOME=$(pwd)
116 export HPHP_LIB=$HPHP_HOME/bin
117
118 %if 0
119 export LIBEVENT_PREFIX=$HPHP_HOME/libevent
120
121         -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
122         -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
123         -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
124 %endif
125
126 %if 0
127 # out of dir build broken (can't find it's tools)
128 install -d build
129 cd build
130 %endif
131
132 CPPFLAGS="%{rpmcppflags} -fno-permissive"
133 %cmake \
134         -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
135         -DCMAKE_PREFIX_PATH=%{_prefix} \
136         -DSKIP_BUNDLED_XHP=ON \
137         -DUSE_JEMALLOC=OFF \
138         -DUSE_TCMALLOC=OFF \
139         ./
140 %{__make}
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144 install -d $RPM_BUILD_ROOT%{_bindir}
145 install -p build/src/hphp/hphp $RPM_BUILD_ROOT%{_bindir}
146
147 %clean
148 rm -rf $RPM_BUILD_ROOT
149
150 %files
151 %defattr(644,root,root,755)
152 %attr(755,root,root) %{_bindir}/hphp
This page took 0.037822 seconds and 4 git commands to generate.