v8js

From DreamFactory
Jump to: navigation, search
(Created page with "This module allows you to execute server-side JavaScript, using the V8 engine. These instructions area adapted from https://github.com/phpv8/v8js/blob/master/README.Linux.md...")
 
Line 15: Line 15:
 
#* <source lang="bash">$ tools/dev/v8gen.py -vv x64.release</source>
 
#* <source lang="bash">$ tools/dev/v8gen.py -vv x64.release</source>
 
#* <source lang="bash">$ echo is_component_build = true >> out.gn/x64.release/args.gn</source>
 
#* <source lang="bash">$ echo is_component_build = true >> out.gn/x64.release/args.gn</source>
# Build V8
+
# Build v8
 
#* <source lang="bash">$ ninja -C out.gn/x64.release/</source>
 
#* <source lang="bash">$ ninja -C out.gn/x64.release/</source>
 
# Install to /opt/v8
 
# Install to /opt/v8
Line 21: Line 21:
 
#* <source lang="bash">$ sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin /opt/v8/lib/</source>
 
#* <source lang="bash">$ sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin /opt/v8/lib/</source>
 
#* <source lang="bash">$ sudo cp -R include/* /opt/v8/include/</source>
 
#* <source lang="bash">$ sudo cp -R include/* /opt/v8/include/</source>
 +
# Build and Install v8js from source
 +
#* <source lang="bash">$ cd /tmp</source>
 +
#* <source lang="bash">$ git clone https://github.com/phpv8/v8js.git</source>
 +
#* <source lang="bash">$ cd v8js</source>
 +
#* <source lang="bash">$ phpize</source>
 +
#* <source lang="bash">$ ./configure --with-v8js=/opt/v8</source>
 +
#* <source lang="bash">$ make</source>
 +
#* <source lang="bash">$ make test</source>
 +
#* <source lang="bash">$ sudo make install</source>
 +
#* <source lang="bash">$ sudo sh -c 'echo "extension=v8js.so" > /etc/php/7.0/mods-available/v8js.ini'</source>
 +
#* <source lang="bash">$ sudo phpenmod v8js</source>

Revision as of 19:52, 14 June 2017

This module allows you to execute server-side JavaScript, using the V8 engine.

These instructions area adapted from https://github.com/phpv8/v8js/blob/master/README.Linux.md

  1. Install Dependencies
    • $ sudo apt-get install build-essential git python libglib2.0-dev
  2. Install Depot Tools
    • $ cd /tmp
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ export PATH=`pwd`/depot_tools:"$PATH"
  3. Download V8
    • $ fetch v8
  4. Setup GN
    • $ cd v8
    • $ tools/dev/v8gen.py -vv x64.release
    • $ echo is_component_build = true >> out.gn/x64.release/args.gn
  5. Build v8
    • $ ninja -C out.gn/x64.release/
  6. Install to /opt/v8
    • $ sudo mkdir -p /opt/v8/{lib,include}
    • $ sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin /opt/v8/lib/
    • $ sudo cp -R include/* /opt/v8/include/
  7. Build and Install v8js from source
    • $ cd /tmp
    • $ git clone https://github.com/phpv8/v8js.git
    • $ cd v8js
    • $ phpize
    • $ ./configure --with-v8js=/opt/v8
    • $ make
    • $ make test
    • $ sudo make install
    • $ sudo sh -c 'echo "extension=v8js.so" > /etc/php/7.0/mods-available/v8js.ini'
    • $ sudo phpenmod v8js