These RPM were built to have an easy way to install the google's javascript engine v8 5.x and v8js php extension for EL7 users.
- You can install prebuilt rpm binary package from here. (Recommended method)
$ wget https://github.com/lesstif/v8js-rpm/releases/download/5.2.371/v8-5.2.371-1.x86_64.rpm
$ wget https://github.com/lesstif/v8js-rpm/releases/download/1.3.1-1/v8js-1.3.1-2.x86_64.rpm
$ sudo yum localinstall v8*.rpm -y
- GNU make
- g++ 4.8 or newer
- libicu-devel
yum install gcc-c++ make libicu-devel
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
cd v8
git checkout 6.5.237
gclient sync
gclient sync
tools/dev/v8gen.py -vv x64.release
echo is_component_build = true >> out.gn/x64.release/args.gn
ninja -C out.gn/x64.release/
mkdir -p ~/opt-v8/{bin,lib,include}
cp out.gn/x64.release/d8 ~/opt-v8/bin/
cp out.gn/x64.release/libv8*.so out.gn/x64.release/*_blob.bin ~/opt-v8/lib/
cp -R include/* ~/opt-v8/include/
rpmbuild -ba v8.spec
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
cd v8
git checkout 5.2.1
gclient sync
gclient sync
# use libicu of operating system
export GYPFLAGS="-Duse_system_icu=1"
# Build (with internal snapshots)
export GYPFLAGS="${GYPFLAGS} -Dv8_use_snapshot=true -Dv8_use_external_startup_data=0 "
# eliminates swarming_client dependency
export GYPFLAGS="${GYPFLAGS} -Dtest_isolation_mode=noop"
# Force gyp to use system-wide ld.gold
export GYPFLAGS="${GYPFLAGS} -Dlinux_use_bundled_gold=0"
make x64.release library=shared snapshot=on i18nsupport=on -j8
change /home/v8/v8 to your v8 checkout directory.
rpmbuild -bb v8.spec --buildroot=/tmp/v8 --define="pre_built_dir /home/lesstif/v8"
cd ~
git clone https://github.com/phpv8/v8js
git checkout php7
phpize
./configure --with-v8js=/opt/v8 LDFLAGS="-lstdc++"
make
make test
change /home/v8/v8js to your v8js checkout directory.
rpmbuild -bb v8js.spec --define="pre_built_dir /home/v8/v8js"