]> git.pld-linux.org Git - packages/hhvm.git/blame - hiphop-php.spec
Provide php extension virtuals
[packages/hhvm.git] / hiphop-php.spec
CommitLineData
89ad59aa
ER
1# NOTES:
2# - hphp/runtime/base/runtime-option.cpp evalJitDefault enables jit if /.hhvm-jit exists (yes, in filesystem root)
ac2930bc 3# TODO
11ccead6 4# - system libevent2: https://github.com/facebook/hiphop-php/pull/421
59f13ffd 5# - system libmbfl, system xhp, sqlite3
1c0ae000 6%define githash 78394ee
8dadf332 7%define rel 3
ed14b19f 8Summary: Virtual Machine, Runtime, and JIT for PHP
65446f6c 9Name: hiphop-php
ed14b19f 10Version: 2.1.0
1c0ae000 11Release: 0.%{githash}.%{rel}
3f49543c 12License: PHP 3.01
ac2930bc 13Group: Development/Languages
1c0ae000
ER
14Source0: https://github.com/facebook/hiphop-php/archive/%{githash}/HPHP-%{version}.%{githash}.tar.gz
15# Source0-md5: 81742a0535a6bab906208d3756b206d1
ef07ca95
ER
16# need fb.changes.patch, which is available for 1.4 only
17Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
18# Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c
be373886 19Source2: get-source.sh
59f13ffd 20Patch0: cmake-missing-library.patch
be373886 21Patch1: libevent14.patch
ef07ca95
ER
22Patch3: system-xhp.patch
23Patch4: system-libafdt.patch
6147aa3c 24Patch5: system-folly.patch
37be4b7f 25Patch6: boost-system-category.patch
3f49543c
ER
26URL: http://wiki.github.com/facebook/hiphop-php/
27BuildRequires: binutils-devel
59f13ffd 28BuildRequires: bison >= 2.3
ed14b19f
ER
29BuildRequires: boost-devel >= 1.50
30BuildRequires: cmake >= 2.8.5
31BuildRequires: curl-devel >= 7.29.0
32BuildRequires: elfutils-devel
3f49543c 33BuildRequires: expat-devel
59f13ffd 34BuildRequires: flex >= 2.5.35
5c61d46f 35BuildRequires: gcc >= 6:4.6.0
3f49543c 36BuildRequires: gd-devel
ed14b19f
ER
37BuildRequires: glog-devel >= 0.3.2
38BuildRequires: imap-devel >= 1:2007
a0922d01 39#BuildRequires: jemalloc-devel
ef07ca95 40BuildRequires: libafdt-devel >= 0.1.0
3f49543c 41BuildRequires: libcap-devel
ed14b19f
ER
42BuildRequires: libdwarf-devel
43#BuildRequires: libevent-devel >= 1.4.14
ac2930bc 44BuildRequires: libicu-devel >= 4.2
be373886 45#BuildRequires: libmbfl-devel
ed14b19f 46BuildRequires: libmcrypt-devel
e883c14f 47BuildRequires: libmemcached-devel >= 1.0.4
ef07ca95 48BuildRequires: libstdc++-devel >= 6:4.3
ed14b19f 49BuildRequires: libunwind-devel
ac2930bc 50BuildRequires: libxml2-devel
3f49543c 51BuildRequires: mysql-devel
ac2930bc 52BuildRequires: oniguruma-devel
3f49543c
ER
53BuildRequires: openssl-devel
54BuildRequires: pcre-devel
ed14b19f 55#BuildRequires: php-xhp-devel >= 1.3.9-6
3f49543c 56BuildRequires: re2c >= 0.13.0
ed14b19f 57BuildRequires: readline-devel
89ad59aa 58BuildRequires: rpmbuild(macros) >= 1.675
ed14b19f 59BuildRequires: tbb-devel >= 4.0.6000
3f49543c 60BuildRequires: zlib-devel
206caaaf
ER
61Provides: php(apc)
62Provides: php(bcmath)
63Provides: php(ctype)
64Provides: php(curl)
65Provides: php(date)
66Provides: php(dom)
67Provides: php(exif)
68Provides: php(fb)
69Provides: php(filter)
70Provides: php(gd)
71Provides: php(hash)
72Provides: php(hotprofiler)
73Provides: php(iconv)
74Provides: php(icu_ucsdet)
75Provides: php(icu_uspoof)
76Provides: php(idn)
77Provides: php(imap)
78Provides: php(json)
79Provides: php(ldap)
80Provides: php(mbstring)
81Provides: php(mcrypt)
82Provides: php(memcache)
83Provides: php(memcached)
84Provides: php(mysql)
85Provides: php(openssl)
86Provides: php(pcntl)
87Provides: php(pcre)
88Provides: php(pdo)
89Provides: php(pdo_mysql)
90Provides: php(pdo_sqlite)
91Provides: php(phar)
92Provides: php(posix)
93Provides: php(reflection)
94Provides: php(server)
95Provides: php(session)
96Provides: php(simplexml)
97Provides: php(soap)
98Provides: php(sockets)
99Provides: php(spl)
100Provides: php(sqlite3)
101Provides: php(sysvmsg)
102Provides: php(sysvsem)
103Provides: php(sysvshm)
104Provides: php(thread)
105Provides: php(thrift_protocol)
106Provides: php(tokenizer)
107Provides: php(xhprof)
108Provides: php(xml)
109Provides: php(xmlreader)
110Provides: php(xmlwriter)
111Provides: php(zlib)
17c75ade 112ExclusiveArch: %{x8664}
65446f6c
ER
113BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
114
115%description
ed14b19f
ER
116HipHop VM (HHVM) is a new open-source virtual machine designed for
117executing programs written in PHP. HHVM uses a just-in-time
118compilation approach to achieve superior performance while maintaining
119the flexibility that PHP developers are accustomed to. HipHop VM (and
120before it HPHPc) has realized > 5x increase in throughput for Facebook
121compared with Zend PHP 5.2.
65446f6c 122
ed14b19f
ER
123HipHop is most commonly run as a standalone server, replacing both
124Apache and mod_php.
65446f6c 125
65446f6c 126%prep
1c0ae000
ER
127%setup -qc -a1
128mv %{name}-%{githash}*/* .
f8472382
ER
129
130#%patch5 -p1
37be4b7f 131%patch6 -p1
ed14b19f
ER
132
133ln -s libevent-1.4.*-stable libevent
134%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
135
136%if 0
59f13ffd 137%patch0 -p1
be373886 138%patch1 -p1
ef07ca95
ER
139#%patch3 -p1
140%patch4 -p1
141
59f13ffd 142
be373886
ER
143#rm -rf src/third_party/libmbfl
144#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
145
ef07ca95
ER
146rm -rf src/third_party/xhp
147rm -rf src/third_party/libafdt
ed14b19f 148%endif
ac2930bc
ER
149
150%build
ef07ca95
ER
151# build libevent 1.4 with fb patches
152if [ ! -d libevent/.libs ]; then
153 cd libevent
154 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
155 %configure \
156 %{?0:--enable-static} \
157 %{?0:--disable-shared}
158 %{__make}
159 ln -s .libs lib
160 ln -s . include
161 cd ..
162fi
163
ac2930bc
ER
164export HPHP_HOME=$(pwd)
165export HPHP_LIB=$HPHP_HOME/bin
166
89ad59aa
ER
167# asm linking breaks on $CC containing spaces
168if [[ "%{__cc}" = *ccache* ]]; then
169 cat <<-'EOF' > $HPHP_LIB/gcc
170 #!/bin/sh
171 exec %{__cc} "$@"
172 EOF
173 chmod +x $HPHP_LIB/gcc
174 CC=$HPHP_LIB/gcc
175fi
176
ed14b19f
ER
177%if 0
178export LIBEVENT_PREFIX=$HPHP_HOME/libevent
179
180 -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
181 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
182 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
183%endif
184
e883c14f
ER
185%if 0
186# out of dir build broken (can't find it's tools)
ef07ca95
ER
187install -d build
188cd build
e883c14f
ER
189%endif
190
ef07ca95 191%cmake \
ed14b19f 192 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 193 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95
ER
194 -DCMAKE_PREFIX_PATH=%{_prefix} \
195 -DSKIP_BUNDLED_XHP=ON \
a0922d01 196 -DUSE_JEMALLOC=OFF \
be373886 197 -DUSE_TCMALLOC=OFF \
e883c14f 198 ./
c513fdf6
ER
199
200# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
201# see hphp/util/generate-buildinfo.sh
202sha=$(echo %{name}-%{githash}*)
203export COMPILER_ID=HPHP-%{version}-%{release}-${sha#%{name}-}
204export HHVM_REPO_SCHEMA=$(date +%N_%s)
205
ac2930bc
ER
206%{__make}
207
65446f6c
ER
208%install
209rm -rf $RPM_BUILD_ROOT
8d9f731f 210%{__make} install \
05199c54 211 HPHP_HOME=$(pwd) \
8d9f731f
ER
212 DESTDIR=$RPM_BUILD_ROOT
213
44fcba3e 214install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 215cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 216
8d9f731f
ER
217# install our libevent for now
218install -d $RPM_BUILD_ROOT%{_libdir}
219libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
220%{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
65446f6c
ER
221
222%clean
223rm -rf $RPM_BUILD_ROOT
224
8d9f731f
ER
225%post -p /sbin/ldconfig
226%postun -p /sbin/ldconfig
227
65446f6c
ER
228%files
229%defattr(644,root,root,755)
1c0ae000 230%doc README.md hphp/NEWS
8d9f731f
ER
231%attr(755,root,root) %{_bindir}/hhvm
232%attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
233%ghost %{_libdir}/libevent-1.4.so.2
44fcba3e
ER
234
235%dir %{_datadir}/%{name}
236%dir %{_datadir}/%{name}/hdf
237%{_datadir}/%{name}/hdf/static.mime-types.hdf
This page took 0.057019 seconds and 4 git commands to generate.