From 0e9db80f0e864c5d1c6964c37b78780c1c78382e Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Tue, 25 Aug 2020 17:39:31 +0900 Subject: [PATCH] libmraa: support node.js v12 Maintainer: @blogic me Compile tested: head r14241-ba2ddba, x86_64 Run tested: x86_64 (VirtualBox) Description: Addressed the build failure with node.js version 12. Re-enable swig. https://github.com/openwrt/packages/issues/11977 https://github.com/openwrt/packages/pull/12225 Signed-off-by: Hirokazu MORIKAWA --- libs/libmraa/Makefile | 7 +++---- libs/libmraa/patches/020-support_v12.patch | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 libs/libmraa/patches/020-support_v12.patch diff --git a/libs/libmraa/Makefile b/libs/libmraa/Makefile index 18515ce8a6..ff3311c9fd 100644 --- a/libs/libmraa/Makefile +++ b/libs/libmraa/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmraa PKG_VERSION:=2.1.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/eclipse/mraa/tar.gz/v$(PKG_VERSION)? @@ -30,8 +30,7 @@ include $(INCLUDE_DIR)/cmake.mk include ../../lang/python/python3-package.mk CMAKE_OPTIONS=-DENABLEEXAMPLES=0 \ - -DFIRMATA=ON \ - -DBUILDSWIG=OFF + -DFIRMATA=ON TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/node @@ -78,7 +77,7 @@ endef define Package/libmraa-python3 $(call Package/libmraa/Default) TITLE:=Eclipse MRAA lowlevel IO Python3 library - DEPENDS:=+libmraa +python3-light @BROKEN + DEPENDS:=+libmraa +python3-light endef define Package/libmraa-python3/description diff --git a/libs/libmraa/patches/020-support_v12.patch b/libs/libmraa/patches/020-support_v12.patch new file mode 100644 index 0000000000..cc70d5ba64 --- /dev/null +++ b/libs/libmraa/patches/020-support_v12.patch @@ -0,0 +1,14 @@ +--- a/api/mraa/gpio.hpp ++++ b/api/mraa/gpio.hpp +@@ -175,7 +175,11 @@ + v8::Local argv[] = { SWIGV8_INTEGER_NEW(-1) }; + #if NODE_MODULE_VERSION >= 0x000D + v8::Local f = v8::Local::New(v8::Isolate::GetCurrent(), This->m_v8isr); ++#if NODE_MODULE_VERSION >= 72 ++ f->Call(SWIGV8_CURRENT_CONTEXT(), SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv); ++#else + f->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv); ++#endif + #else + This->m_v8isr->Call(SWIGV8_CURRENT_CONTEXT()->Global(), argc, argv); + #endif -- 2.30.2