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