]> git.pld-linux.org Git - packages/hhvm.git/blame - hiphop-php.spec
add local libevent include dir
[packages/hhvm.git] / hiphop-php.spec
CommitLineData
ac2930bc 1# TODO
11ccead6 2# - system libevent2: https://github.com/facebook/hiphop-php/pull/421
59f13ffd
ER
3# - system libmbfl, system xhp, sqlite3
4# - there should be a bit more packaged into files
be373886
ER
5# - linking segfaults
6# using bfd and gcc-6:4.6.2-2.x86_64 binutils-3:2.22.51.0.1-1.x86_64
7# cd /home/users/glen/rpm/packages/BUILD.x86_64-linux/hiphop-php-1.000_cf9b612/src/hphpi && /home/users/glen/rpm/BUILD.x86_64-linux/hiphop-php-1.000_cf9b612/build/src/hphp/hphp -t cpp -f exe --input-dir . -i hphpi.php -o gen -vEnableEval=2 --log=1
8# Segmentation fault
9# make[2]: *** [src/hphp/hphp] Error 139
10# relinking succeeds, but resulting binary segfaults as well:
11# 0x0000000000b9cc0b in HPHP::Extension::LoadModules(HPHP::Hdf) ()
ed14b19f 12Summary: Virtual Machine, Runtime, and JIT for PHP
65446f6c 13Name: hiphop-php
ed14b19f
ER
14Version: 2.1.0
15Release: 0.1
3f49543c 16License: PHP 3.01
ac2930bc 17Group: Development/Languages
ed14b19f
ER
18Source0: https://github.com/facebook/hiphop-php/archive/HPHP-%{version}.tar.gz
19# Source0-md5: edd3d8b4371d38286c7c5f0c2582f5e1
ef07ca95
ER
20# need fb.changes.patch, which is available for 1.4 only
21Source1: http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
22# Source1-md5: a00e037e4d3f9e4fe9893e8a2d27918c
be373886 23Source2: get-source.sh
59f13ffd 24Patch0: cmake-missing-library.patch
be373886 25Patch1: libevent14.patch
ef07ca95
ER
26Patch3: system-xhp.patch
27Patch4: system-libafdt.patch
6147aa3c 28Patch5: system-folly.patch
37be4b7f 29Patch6: boost-system-category.patch
1c7ec817 30Patch7: gcc4.8.patch
3f49543c
ER
31URL: http://wiki.github.com/facebook/hiphop-php/
32BuildRequires: binutils-devel
59f13ffd 33BuildRequires: bison >= 2.3
ed14b19f
ER
34BuildRequires: boost-devel >= 1.50
35BuildRequires: cmake >= 2.8.5
36BuildRequires: curl-devel >= 7.29.0
37BuildRequires: elfutils-devel
3f49543c 38BuildRequires: expat-devel
59f13ffd 39BuildRequires: flex >= 2.5.35
3f49543c 40BuildRequires: gd-devel
ed14b19f
ER
41BuildRequires: glog-devel >= 0.3.2
42BuildRequires: imap-devel >= 1:2007
a0922d01 43#BuildRequires: jemalloc-devel
ef07ca95 44BuildRequires: libafdt-devel >= 0.1.0
3f49543c 45BuildRequires: libcap-devel
ed14b19f
ER
46BuildRequires: libdwarf-devel
47#BuildRequires: libevent-devel >= 1.4.14
ac2930bc 48BuildRequires: libicu-devel >= 4.2
be373886 49#BuildRequires: libmbfl-devel
ed14b19f 50BuildRequires: libmcrypt-devel
e883c14f 51BuildRequires: libmemcached-devel >= 1.0.4
ef07ca95 52BuildRequires: libstdc++-devel >= 6:4.3
ed14b19f 53BuildRequires: libunwind-devel
ac2930bc 54BuildRequires: libxml2-devel
3f49543c 55BuildRequires: mysql-devel
ac2930bc 56BuildRequires: oniguruma-devel
3f49543c
ER
57BuildRequires: openssl-devel
58BuildRequires: pcre-devel
ed14b19f 59#BuildRequires: php-xhp-devel >= 1.3.9-6
3f49543c 60BuildRequires: re2c >= 0.13.0
ed14b19f 61BuildRequires: readline-devel
ef07ca95 62BuildRequires: rpmbuild(macros) >= 1.600
ed14b19f 63BuildRequires: tbb-devel >= 4.0.6000
3f49543c 64BuildRequires: zlib-devel
65446f6c
ER
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67%description
ed14b19f
ER
68HipHop VM (HHVM) is a new open-source virtual machine designed for
69executing programs written in PHP. HHVM uses a just-in-time
70compilation approach to achieve superior performance while maintaining
71the flexibility that PHP developers are accustomed to. HipHop VM (and
72before it HPHPc) has realized > 5x increase in throughput for Facebook
73compared with Zend PHP 5.2.
65446f6c 74
ed14b19f
ER
75HipHop is most commonly run as a standalone server, replacing both
76Apache and mod_php.
65446f6c 77
65446f6c 78%prep
ed14b19f 79%setup -q -n %{name}-HPHP-%{version} -a1
6147aa3c 80%patch5 -p1
37be4b7f 81%patch6 -p1
1c7ec817 82%patch7 -p1
ed14b19f
ER
83
84ln -s libevent-1.4.*-stable libevent
85%{__patch} -d libevent -p1 < hphp/third_party/libevent-1.4.14.fb-changes.diff
86
87%if 0
59f13ffd 88%patch0 -p1
be373886 89%patch1 -p1
ef07ca95
ER
90#%patch3 -p1
91%patch4 -p1
92
59f13ffd 93
be373886
ER
94#rm -rf src/third_party/libmbfl
95#sed -i -e '/add_subdirectory(third_party\/libmbfl)/d' src/CMakeLists.txt
96
ef07ca95
ER
97rm -rf src/third_party/xhp
98rm -rf src/third_party/libafdt
ed14b19f 99%endif
ac2930bc
ER
100
101%build
ef07ca95
ER
102# build libevent 1.4 with fb patches
103if [ ! -d libevent/.libs ]; then
104 cd libevent
105 # TODO: should use static linking, but then it fails to detect libraries due missing -lrt
106 %configure \
107 %{?0:--enable-static} \
108 %{?0:--disable-shared}
109 %{__make}
110 ln -s .libs lib
111 ln -s . include
112 cd ..
113fi
114
ac2930bc
ER
115export HPHP_HOME=$(pwd)
116export HPHP_LIB=$HPHP_HOME/bin
117
ed14b19f
ER
118%if 0
119export LIBEVENT_PREFIX=$HPHP_HOME/libevent
120
121 -DLibEvent_LIB=$HPHP_HOME/libevent/libevent.so \
122 -DLibEvent_INCLUDE_PATHS=$HPHP_HOME/libevent \
123 -DLibEvent_LIB_PATHS=$HPHP_HOME/libevent/.libs \
124%endif
125
e883c14f
ER
126%if 0
127# out of dir build broken (can't find it's tools)
ef07ca95
ER
128install -d build
129cd build
e883c14f
ER
130%endif
131
ed14b19f 132CPPFLAGS="%{rpmcppflags} -fno-permissive"
ef07ca95 133%cmake \
ed14b19f 134 -DLIBEVENT_LIB=$HPHP_HOME/libevent/lib/libevent.so \
c5cd2e9b 135 -DLIBEVENT_INCLUDE_DIR=$HPHP_HOME/libevent \
ef07ca95
ER
136 -DCMAKE_PREFIX_PATH=%{_prefix} \
137 -DSKIP_BUNDLED_XHP=ON \
a0922d01 138 -DUSE_JEMALLOC=OFF \
be373886 139 -DUSE_TCMALLOC=OFF \
e883c14f 140 ./
ac2930bc
ER
141%{__make}
142
65446f6c
ER
143%install
144rm -rf $RPM_BUILD_ROOT
be373886
ER
145install -d $RPM_BUILD_ROOT%{_bindir}
146install -p build/src/hphp/hphp $RPM_BUILD_ROOT%{_bindir}
65446f6c
ER
147
148%clean
149rm -rf $RPM_BUILD_ROOT
150
151%files
152%defattr(644,root,root,755)
be373886 153%attr(755,root,root) %{_bindir}/hphp
This page took 0.054427 seconds and 4 git commands to generate.