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