]> git.pld-linux.org Git - packages/hhvm.git/blame - hiphop-php.spec
hack for ccache and cmake asm linking
[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
89ad59aa 7%define rel 0.7
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
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
17c75ade 60ExclusiveArch: %{x8664}
65446f6c
ER
61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63%description
ed14b19f
ER
64HipHop VM (HHVM) is a new open-source virtual machine designed for
65executing programs written in PHP. HHVM uses a just-in-time
66compilation approach to achieve superior performance while maintaining
67the flexibility that PHP developers are accustomed to. HipHop VM (and
68before it HPHPc) has realized > 5x increase in throughput for Facebook
69compared with Zend PHP 5.2.
65446f6c 70
ed14b19f
ER
71HipHop is most commonly run as a standalone server, replacing both
72Apache and mod_php.
65446f6c 73
65446f6c 74%prep
1c0ae000
ER
75%setup -qc -a1
76mv %{name}-%{githash}*/* .
f8472382
ER
77
78#%patch5 -p1
37be4b7f 79%patch6 -p1
ed14b19f
ER
80
81ln -s libevent-1.4.*-stable libevent
82%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
83
84%if 0
59f13ffd 85%patch0 -p1
be373886 86%patch1 -p1
ef07ca95
ER
87#%patch3 -p1
88%patch4 -p1
89
59f13ffd 90
be373886
ER
91#rm -rf src/third_party/libmbfl
92#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
93
ef07ca95
ER
94rm -rf src/third_party/xhp
95rm -rf src/third_party/libafdt
ed14b19f 96%endif
ac2930bc
ER
97
98%build
ef07ca95
ER
99# build libevent 1.4 with fb patches
100if [ ! -d libevent/.libs ]; then
101 cd libevent
102 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
103 %configure \
104 %{?0:--enable-static} \
105 %{?0:--disable-shared}
106 %{__make}
107 ln -s .libs lib
108 ln -s . include
109 cd ..
110fi
111
ac2930bc
ER
112export HPHP_HOME=$(pwd)
113export HPHP_LIB=$HPHP_HOME/bin
114
89ad59aa
ER
115# asm linking breaks on $CC containing spaces
116if [[ "%{__cc}" = *ccache* ]]; then
117 cat <<-'EOF' > $HPHP_LIB/gcc
118 #!/bin/sh
119 exec %{__cc} "$@"
120 EOF
121 chmod +x $HPHP_LIB/gcc
122 CC=$HPHP_LIB/gcc
123fi
124
ed14b19f
ER
125%if 0
126export LIBEVENT_PREFIX=$HPHP_HOME/libevent
127
128 -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
129 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
130 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
131%endif
132
e883c14f
ER
133%if 0
134# out of dir build broken (can't find it's tools)
ef07ca95
ER
135install -d build
136cd build
e883c14f
ER
137%endif
138
ed14b19f 139CPPFLAGS="%{rpmcppflags} -fno-permissive"
ef07ca95 140%cmake \
ed14b19f 141 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 142 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95
ER
143 -DCMAKE_PREFIX_PATH=%{_prefix} \
144 -DSKIP_BUNDLED_XHP=ON \
a0922d01 145 -DUSE_JEMALLOC=OFF \
be373886 146 -DUSE_TCMALLOC=OFF \
e883c14f 147 ./
c513fdf6
ER
148
149# setup COMPILER_ID/HHVM_REPO_SCHEMA so it doesn't look it up from our package git repo
150# see hphp/util/generate-buildinfo.sh
151sha=$(echo %{name}-%{githash}*)
152export COMPILER_ID=HPHP-%{version}-%{release}-${sha#%{name}-}
153export HHVM_REPO_SCHEMA=$(date +%N_%s)
154
ac2930bc
ER
155%{__make}
156
65446f6c
ER
157%install
158rm -rf $RPM_BUILD_ROOT
8d9f731f 159%{__make} install \
05199c54 160 HPHP_HOME=$(pwd) \
8d9f731f
ER
161 DESTDIR=$RPM_BUILD_ROOT
162
44fcba3e 163install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf
17307be4 164cp -p hphp/doc/mime.hdf $RPM_BUILD_ROOT%{_datadir}/%{name}/hdf/static.mime-types.hdf
44fcba3e 165
8d9f731f
ER
166# install our libevent for now
167install -d $RPM_BUILD_ROOT%{_libdir}
168libtool --mode=install install -p libevent/libevent.la $RPM_BUILD_ROOT%{_libdir}
169%{__rm} $RPM_BUILD_ROOT%{_libdir}/libevent.{a,la,so}
65446f6c
ER
170
171%clean
172rm -rf $RPM_BUILD_ROOT
173
8d9f731f
ER
174%post -p /sbin/ldconfig
175%postun -p /sbin/ldconfig
176
65446f6c
ER
177%files
178%defattr(644,root,root,755)
1c0ae000 179%doc README.md hphp/NEWS
8d9f731f
ER
180%attr(755,root,root) %{_bindir}/hhvm
181%attr(755,root,root) %{_libdir}/libevent-1.4.so.*.*.*
182%ghost %{_libdir}/libevent-1.4.so.2
44fcba3e
ER
183
184%dir %{_datadir}/%{name}
185%dir %{_datadir}/%{name}/hdf
186%{_datadir}/%{name}/hdf/static.mime-types.hdf
This page took 0.05157 seconds and 4 git commands to generate.