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