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