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