From d0296583238cd70ed151a4d38e65a47c5710ac45 Mon Sep 17 00:00:00 2001 From: RF-Networks Date: Sun, 10 Nov 2019 21:02:14 +0200 Subject: [PATCH 1/3] Libmraa compilation fix Signed-off-by: Archil Pirmisashvili Signed-off-by: RF-Networks --- libs/libmraa/Makefile | 4 +- libs/libmraa/patches/0005-ramips_fixes.patch | 47 ++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 libs/libmraa/patches/0005-ramips_fixes.patch diff --git a/libs/libmraa/Makefile b/libs/libmraa/Makefile index 6d980b252..01ff150b2 100644 --- a/libs/libmraa/Makefile +++ b/libs/libmraa/Makefile @@ -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 index 000000000..5aa7069e1 --- /dev/null +++ b/libs/libmraa/patches/0005-ramips_fixes.patch @@ -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 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 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 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_; From 1b64cb83d69e1128044cdda361f7376421b48cd9 Mon Sep 17 00:00:00 2001 From: RF-Networks Date: Sun, 10 Nov 2019 21:35:06 +0200 Subject: [PATCH 2/3] Libmraa compilation fix Signed-off-by: Archil Pirmisashvili --- libs/libmraa/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libmraa/Makefile b/libs/libmraa/Makefile index 01ff150b2..f4c5f962e 100644 --- a/libs/libmraa/Makefile +++ b/libs/libmraa/Makefile @@ -15,9 +15,9 @@ PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/mraa.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=70600dece4138b0c0dbaff42f57828f1559cd840 +PKG_SOURCE_VERSION:=049ba5fa9f2d18ac0ec6729c46916b34998d3c5f PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_MIRROR_HASH:=049ba5fa9f2d18ac0ec6729c46916b34998d3c5f +PKG_MIRROR_HASH:=9cbda58e7c7790db3d62cee62f399975effcdc2d9688d3d6bb2b4a86748faff9 PKG_BUILD_DEPENDS:=node python/host swig/host node/host CMAKE_INSTALL:=1 From cf4e50ab7b09137f112e34aa37c33bb4d09369b5 Mon Sep 17 00:00:00 2001 From: Archil Pirmisashvili Date: Wed, 13 Nov 2019 22:28:37 +0200 Subject: [PATCH 3/3] Compilation fix & upgrade to version 0.8.1 Signed-off-by: Archil Pirmisashvili --- libs/libmraa/patches/0001-base.patch | 6 +-- libs/libmraa/patches/0004-fixes.patch | 2 +- libs/libmraa/patches/0005-ramips_fixes.patch | 47 -------------------- 3 files changed, 4 insertions(+), 51 deletions(-) delete mode 100644 libs/libmraa/patches/0005-ramips_fixes.patch diff --git a/libs/libmraa/patches/0001-base.patch b/libs/libmraa/patches/0001-base.patch index 5094389f4..d790296bb 100644 --- a/libs/libmraa/patches/0001-base.patch +++ b/libs/libmraa/patches/0001-base.patch @@ -21,11 +21,11 @@ Subject: [PATCH 1/4] base # Make a version file containing the current version from git. -include (GetGitRevisionDescription) -git_describe (VERSION "--tags") --if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND") +-if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND") - message (WARNING " - Install git to compile a production libmraa!") -- set (VERSION "v0.8.0-dirty") +- set (VERSION "v0.8.1-dirty") -endif () -+set (VERSION "v0.8.0") ++set (VERSION "v0.8.1") message (INFO " - libmraa Version ${VERSION}") diff --git a/libs/libmraa/patches/0004-fixes.patch b/libs/libmraa/patches/0004-fixes.patch index 40e5930ee..7acdea789 100644 --- a/libs/libmraa/patches/0004-fixes.patch +++ b/libs/libmraa/patches/0004-fixes.patch @@ -655,7 +655,7 @@ Subject: [PATCH 4/4] fixes b->gpio_count++; --- a/src/gpio/gpio.c +++ b/src/gpio/gpio.c -@@ -113,6 +113,8 @@ +@@ -114,6 +114,8 @@ close(export); } diff --git a/libs/libmraa/patches/0005-ramips_fixes.patch b/libs/libmraa/patches/0005-ramips_fixes.patch deleted file mode 100644 index 5aa7069e1..000000000 --- a/libs/libmraa/patches/0005-ramips_fixes.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- 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 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 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 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_;