Private
Public Access
2
0
Commit Graph

54 Commits

Author SHA1 Message Date
Brendan Le Foll
80024ff184 javascript: Fix build for nodejs v5 which has smaller version string
SWIG uses SWIG_V8_VERSION made of
0x0${V8_VERSION_MAJOR}${V8_VERSION_MINOR}${V8_VERSION_PATCH}. Because newer v8
versions don't seem to have a patch version that is padded the version string
ends up too small ending with using the node.js 0.10.x paths. This fix pads the
version string to 8chars which (we assume) is always correct. Fixes #358

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-11-11 13:47:43 +00:00
xbolshe
63ff901674 JavaScript SPI.write output correction #2
Closes #330.

Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-10-26 15:36:20 +00:00
xbolshe
f9af006c97 JavaScript SPI.write output correction
Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-10-26 15:35:31 +00:00
xbolshe
3059c06fa0 javascript: Add nodejs 4.1.1 support
API changes in V8 API mean that node.js 4 needs some changes both in mraajs.i
but also require a C++11 compiler

Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-10-03 17:36:54 +01:00
Brendan Le Foll
eb5a3ac5d2 cmake: add ${mraa_LIBS} to linker for swig libraries
This means that the correct libraries are added when mraa_LIBS is appended,
fixes ft4222 handling with SWIG APIs

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-08 14:42:04 +01:00
Brendan Le Foll
dc6a585991 binding.gyp.cmake: Fix npm builds for ia32 node.js 0.10.x
Node.js 0.10.x seems to struggle with the 'or' directive. Fixes #272

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-09-07 10:54:17 +01:00
Brendan Le Foll
9c0753cb18 npm: Fix npm builds for ARM hosts
NPM builds don't support cross compiling and will always compile for the host.
Binding.gyp now uses mraa_NPM_SRCS instead of mraa_LIB_SRCS_NOAUTO which
contains all platforms. Cmake now uses mraa_LIB_PLAT_SRCS_NOAUTO to provide all
the sources. NPM builds will build objects for all platforms reguardless of
space which does meann slightly bigger binaries.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-07-24 14:04:48 +01:00
Brendan Le Foll
4698d18fa1 mraajs.i: Fix memory leak on javascript Spi::write
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-07-02 19:06:59 +01:00
Brendan Le Foll
2cb32f791c binding.gyp.cmake: fix compilation when not setting target_arch
NPM package now only builds x86 builds, but for npm those are the only ones
that have ever worked due to a rework of the cmake code generating the
binding.gyp file is required

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-03 14:51:13 +01:00
Brendan Le Foll
21355d4bb5 mraajs.i: Use 0x032870 as SWIG_V8_VERSION to distinguish node.js 0.12.x
This fixes compilation with node.js 0.12.4

Closes #211

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 17:37:35 +01:00
Brendan Le Foll
d4968b6b81 doxygen2jsdoc: add custom typemap file
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 15:24:23 +01:00
Brendan Le Foll
d6b33a9cbf cmake: add yuidoc documentation generation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 15:16:42 +01:00
Brendan Le Foll
e0ce5454bd uart: move string funcs to {read,write}Str
This commit adds raw binary read/write functions using the same typemaps as I2c
functions

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-06-01 10:58:11 +01:00
Brendan Le Foll
55533ed8c1 mraajs.i: add buffer checks to python write() typemaps in Spi & I2c
Previously anything passed to an I2c::write() or Spi::write() function in
node.js that wasn't a node::Buffer or an object would likely cause a segfault
later on during future calls. This change calls node::Buffer::HasInstance(obj)
to make sure the buffer is valid prior to grabbing it's data

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-05-20 11:16:18 +01:00
Alexander Komarov
4302f0d0c3 java: Added Java SWIG binding creation
%init directive is not supported in java so move %init to js/py interface files

Signed-off-by: Alexander Komarov <alexander.komarov@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-24 12:12:11 +01:00
Brendan Le Foll
6aa601cd1d javascript/CMakeLists.txt: stop requiring doc_i files for node.js
These files are required when building docs for python but are never used for
the node.js module

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-04-02 14:01:06 +01:00
Brendan Le Foll
2174ee1673 package.json.cmake: use 0.10.x is the minimum version to compile
Note that if you compile a 0.12.x version it'll still have 0.10.x as a min req
but will likely not work with a 0.10.x interpreter

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
c1ac6f1928 binding.gyp.cmake: get v8 version from node and export to c++ compiler
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
35d1dc10c7 mraajs.i: use SWIG_V8_VERSION from C++ preprocessor not swig
SWIG's preprocessor will not handle the SWIG_V8_VERSION these will go in the
wrapper code so that someone compiling with npm will use his version of node

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:06 +00:00
Brendan Le Foll
f0b3035337 package.json.cmake: create node version specific package.json
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
128f0a22da nodejs: add infra to detect nodejs version
This introduces FindNodes.cmake which finds the v8 version and the nodejs
interp version and passes the information to SWIG via SWIG_V8_VERSION

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
824618ccf1 mraajs: update for node.js 0.12 API differences
This requires setting #define SWIG_V8_VERSION 0x032873 in the
mraajsJAVASCRIPT_wrap.cxx file. Note most v8 APIs now require v8::Isolate and
v8::Persistent is no longer a v8::Handle so the gpio.hpp for ISR support is
also modified by this change

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-03-19 18:26:05 +00:00
Brendan Le Foll
008184c305 nodejs: Add isr support to node.js
This commit adds isr support to node.js mraa module, it also forces
SWIGJAVASCRIPT to be set at compile time by cmake (SWIG uses SWIGJAVASCRIPT and
not SWIGNODE in it's preprocessor). This uses libuv uv_queue_work to call v8isr
and is all done at a C++ level unlike the python isr, so this reuses the
mraa_gpio_isr call. This closes #110

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-18 16:41:01 +00:00
yoneken
2965665fee Add options for nodejs include directory
Signed-off-by: Kenta Yonekura <yoneken@ieee.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-02-15 21:15:24 +00:00
Brendan Le Foll
50ca84b600 mraajs.i: add %include carrays.i to fix generation with SWIG 3.0.4
Fixes #97

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-16 13:45:04 +00:00
Brendan Le Foll
b7a0856f51 spi: Make Spi write() work from SWIG with typemaps
This change also changes the C++ API write(char) call to writeByte(uint8_t) and
the write() call now takes a uint8_t* instead of a char*. This should not alter
any code significantly and does not affect the C API.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-14 11:52:12 +00:00
Brendan Le Foll
f14654a120 mraajs.i: add i2c read/write function typemaps
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2015-01-06 11:24:56 +00:00
Brendan Le Foll
da15fdb6da binding.gyp.cmake: fix architecture name for 32bit x86
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-10 14:52:23 +00:00
Brendan Le Foll
2c5e749c2c binding.gyp.cmake: define *PLAT based on target_platform
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-09 18:39:21 +00:00
Helio Chissini de Castro
1b059c1351 package.json.cmake: Proper version requires for nodejs
Signed-off-by: Helio Chissini de Castro <helio@kde.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-01 15:23:32 +00:00
Brendan Le Foll
14f4567d86 package.json.cmake: fix broken main property
This is a partial revert of previous commit

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-01 14:41:20 +00:00
Brendan Le Foll
36e24bade8 npmpkg: Fix package.json having invalid main property
Fixes #48

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-12-01 13:59:47 +00:00
Brendan Le Foll
abd538dc4b cmake: fix indentation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-24 18:03:36 +00:00
Brendan Le Foll
0ca4b10687 package.json.cmake: remove repository tag causing issues on update
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-24 17:45:50 +00:00
Brendan Le Foll
a38c07f7b1 npm: add node-gyp build support
This commit adds all the infrastructure necessary for doing node-gyp builds of
mraa. Note this will only build the mraa js bindings and will dirty your git
tree whilst doing it. It also assumes the user does not have SWIG installed on
their machines and so the swig wrapper is static. The target to use this
feature is 'npmpkg'.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-24 15:20:19 +00:00
Brendan Le Foll
d4552fdc5e javascript: add a generated package.json with versioning
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-11-24 11:19:05 +00:00
Thomas Ingleby
181ba35f4d javascript: dont't wipe other cxx flags
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-09-09 17:29:42 +01:00
Brendan Le Foll
c821c84e4a mraa: pymraa becomes mraa and mraajs becomes mraa
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-25 17:49:07 +01:00
Thomas Ingleby
6853997a92 mraa: rename from maa to mraa
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-24 17:24:54 +01:00
Thomas Ingleby
be1248930b js-swig: remove whitespace
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-06-10 20:17:09 +01:00
Brendan Le Foll
35d38bc72a package.json: add extra info about module license and runtime support
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-04 15:37:00 +01:00
Brendan Le Foll
2c278acfcd cmake: install python & node.js modules correctly
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-06-04 12:06:04 +01:00
Brendan Le Foll
28fc9f97c9 swig: use C++ generated class doc and include directly from maa.i
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-30 10:28:21 +01:00
Brendan Le Foll
bd1fabab5e nodejs: define BUILDING_NODE_EXTENSION in CXXFLAGS for upstream swig
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-22 11:40:59 +01:00
Thomas Ingleby
923e4829a9 maa: change javascript to use swig upstream
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
2014-05-22 10:16:09 +01:00
Brendan Le Foll
9387c943d9 cmake: fix hard includ of node headers for cross compile
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-15 16:40:40 +01:00
Brendan Le Foll
aa60cae49d maajs: fix example with object API
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-08 11:24:13 +01:00
Brendan Le Foll
8c016318a6 swig: make swig generation of objects generic
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-05-01 16:11:17 +01:00
Brendan Le Foll
0450c2e159 doxygen: generic and more reliable doxygen/swig autodoc integration
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-30 10:50:44 +01:00
Brendan Le Foll
804c4a437d javascript: fix swig generation of node.js api
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2014-04-29 18:44:09 +01:00