Merge pull request #2700 from lissyx/swig-doc

Improve SWIG reference
This commit is contained in:
lissyx 2020-01-29 11:16:03 +01:00 committed by GitHub
commit 0428c846f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

View File

@ -108,6 +108,35 @@ The API mirrors the C++ API and is demonstrated in `client.py <python/client.py>
Install Node.JS bindings
^^^^^^^^^^^^^^^^^^^^^^^^
Unfortunately, JavaScript support on SWIG is a bit behind, and while there are
pending patches proposed to upstream, it is not yet merged.
You would need to patch SWIG, either from your distribution's setup, or do a
local-patched build of SWIG.
If you patch from a v3.0 SWIG, you will need to apply those:
.. code-block::
native_client/swig_node_v7x-v8x-v9x_0001.patch
native_client/swig_node_v7x-v8x-v9x_0002.patch
native_client/swig_node_v12_0001-Upgrade-SWIG-to-support-NodeJS-v12-V8-v7.6-v8-v7.8-r.patch
If you patch from a v4.0 SWIG, you can just apply this:
.. code-block::
native_client/swig_node_v12_0001-Upgrade-SWIG-to-support-NodeJS-v12-V8-v7.6-v8-v7.8-r.patch
On a Debian/Ubuntu system, you would need:
.. code-block::
for patch_file in native_client/swig_node_v7x-v8x-v9x_0001.patch native_client/swig_node_v7x-v8x-v9x_0002.patch native_client/swig_node_v12_0001-Upgrade-SWIG-to-support-NodeJS-v12-V8-v7.6-v8-v7.8-r.patch;
do
patch -d /usr/share/swig3.0/ -p2 < $patch_file
done;
After following the above build and installation instructions, the Node.JS bindings can be built:
.. code-block::