Skip to content

Instantly share code, notes, and snippets.

@jjmartucci
Last active April 24, 2016 01:17
Show Gist options
  • Save jjmartucci/3cce71dcc6dec98fd4bc434a8174afaf to your computer and use it in GitHub Desktop.
Save jjmartucci/3cce71dcc6dec98fd4bc434a8174afaf to your computer and use it in GitHub Desktop.
v8js on Scotchbox
sudo apt-get install libicu-dev
cd /tmp
# Install depot_tools first (needed for source checkout)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
# Download v8
fetch v8
cd v8
# (optional) If you'd like to build a certain version:
git checkout 4.9.385.28
gclient sync
# use libicu of operating system
export GYP_DEFINES="use_system_icu=1"
# Build (with internal snapshots)
export GYPFLAGS="-Dv8_use_external_startup_data=0"
make native library=shared snapshot=on -j8
# Install to /usr
sudo mkdir -p /usr/lib /usr/include
sudo cp out/native/lib.target/lib*.so /usr/lib/
sudo cp -R include/* /usr/include
echo -e "create /usr/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend"
# Pecl install v8js
sudo pecl install v8js-0.1.3
echo "extension=v8js.so" | sudo tee /etc/php5/mods-available/v8js.ini
sudo php5enmod v8js
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment