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