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