Libmraa compilation fix
authorRF-Networks <archil@rf-networks.com>
Sun, 10 Nov 2019 19:02:14 +0000 (21:02 +0200)
committerRF-Networks <archil@rf-networks.com>
Sun, 10 Nov 2019 19:13:59 +0000 (21:13 +0200)
Signed-off-by: Archil Pirmisashvili <kulipator@gmail.com>
Signed-off-by: RF-Networks <archil@rf-networks.com>
libs/libmraa/Makefile
libs/libmraa/patches/0005-ramips_fixes.patch [new file with mode: 0644]

index 6d980b25211e2ab837959fab2b8164846a561a8a..01ff150b2cff56e9c1b55d3860bae945202ef17c 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmraa
-PKG_VERSION:=0.8.0
+PKG_VERSION:=0.8.1
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/mraa.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=70600dece4138b0c0dbaff42f57828f1559cd840
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_MIRROR_HASH:=9cbda58e7c7790db3d62cee62f399975effcdc2d9688d3d6bb2b4a86748faff9
+PKG_MIRROR_HASH:=049ba5fa9f2d18ac0ec6729c46916b34998d3c5f
 PKG_BUILD_DEPENDS:=node python/host swig/host node/host
 CMAKE_INSTALL:=1
 
diff --git a/libs/libmraa/patches/0005-ramips_fixes.patch b/libs/libmraa/patches/0005-ramips_fixes.patch
new file mode 100644 (file)
index 0000000..5aa7069
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/src/javascript/mraajs.i
++++ b/src/javascript/mraajs.i
+@@ -42,7 +42,13 @@ namespace mraa {
+ class Spi;
+ %typemap(out) uint8_t*
+ {
+-%#if SWIG_V8_VERSION > 0x032870
++%#if SWIG_V8_VERSION > 0x040000
++   v8::MaybeLocal<v8::Object> objret = node::Buffer::Copy(v8::Isolate::GetCurrent(), (char*) result, arg3);
++   free(result);
++   if(!objret.ToLocal(&$result)){
++      SWIG_exception_fail(SWIG_ERROR, "Spi buffer failed");
++   }
++%#elif SWIG_V8_VERSION > 0x032870
+   $result = node::Buffer::New((char*) $1, arg3);
+ %#else
+   $result = node::Buffer::New((char*) $1, arg3)->handle_;
+@@ -76,7 +82,13 @@ class Spi;
+        SWIG_exception_fail(SWIG_ERROR, "I2c write failed");
+        SWIGV8_RETURN(SWIGV8_UNDEFINED());
+    }
+-%#if SWIG_V8_VERSION > 0x032870
++%#if SWIG_V8_VERSION > 0x040000
++   v8::MaybeLocal<v8::Object> objret = node::Buffer::Copy(v8::Isolate::GetCurrent(), (char*) $1, result);
++   free($1);
++   if(!objret.ToLocal(&$result)) {
++      SWIG_exception_fail(SWIG_ERROR, "Uart buffer failed");
++   }
++%#elif SWIG_V8_VERSION > 0x032870
+    $result = node::Buffer::New((char*) $1, result);
+ %#else
+    $result = node::Buffer::New((char*) $1, result)->handle_;
+@@ -105,7 +117,13 @@ class Spi;
+        SWIG_exception_fail(SWIG_ERROR, "I2c write failed");
+        SWIGV8_RETURN(SWIGV8_UNDEFINED());
+    }
+-%#if SWIG_V8_VERSION > 0x032870
++%#if SWIG_V8_VERSION > 0x040000
++   v8::MaybeLocal<v8::Object> objret = node::Buffer::Copy(v8::Isolate::GetCurrent(), (char*) $1, result);
++   free($1);
++   if(!objret.ToLocal(&$result)) {
++      SWIG_exception_fail(SWIG_ERROR, "I2c buffer failed");
++   }
++%#elif SWIG_V8_VERSION > 0x032870
+    $result = node::Buffer::New((char*) $1, result);
+ %#else
+    $result = node::Buffer::New((char*) $1, result)->handle_;