2015-08-02 06:26:39 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2014 Arduino LLC
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NPM_NAME:=arduino-firmata
|
|
|
|
PKG_NAME:=node-$(PKG_NPM_NAME)
|
2018-03-09 17:20:23 +00:00
|
|
|
PKG_VERSION:=0.3.4
|
2019-04-05 04:47:33 +00:00
|
|
|
PKG_RELEASE:=3
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2019-04-05 04:47:33 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
|
|
|
|
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
|
|
|
|
PKG_HASH:=d7157e02867eae82887cb5e17b90c963fe7489bacd464110bfd20c672b8d5a98
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2016-03-17 09:34:56 +00:00
|
|
|
PKG_BUILD_DEPENDS:=node/host
|
2019-04-05 04:47:33 +00:00
|
|
|
PKG_USE_MIPS16:=0
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2019-04-05 04:47:33 +00:00
|
|
|
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
|
2015-10-19 13:46:03 +00:00
|
|
|
PKG_LICENSE:=MIT
|
2016-09-02 22:00:54 +00:00
|
|
|
PKG_LICENSE_FILES:=LICENSE.txt
|
2015-08-02 06:26:39 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
|
|
|
define Package/node-arduino-firmata
|
|
|
|
SUBMENU:=Node.js
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
2019-04-05 04:47:33 +00:00
|
|
|
TITLE:=Arduino Firmata implementation for Node.js
|
|
|
|
URL:=https://www.npmjs.com/package/arduino-firmata
|
2017-09-13 05:46:20 +00:00
|
|
|
DEPENDS:=+node +node-npm +node-serialport
|
2015-08-02 06:26:39 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/node-arduino-firmata/description
|
2019-04-05 04:47:33 +00:00
|
|
|
Arduino Firmata protocol (http://firmata.org) implementation on Node.js.
|
2015-08-02 06:26:39 +00:00
|
|
|
endef
|
|
|
|
|
2019-04-05 04:47:33 +00:00
|
|
|
TAR_OPTIONS+= --strip-components 1
|
|
|
|
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2019-04-05 04:47:33 +00:00
|
|
|
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
|
2015-08-02 06:26:39 +00:00
|
|
|
|
|
|
|
define Build/Compile
|
2019-04-05 04:47:33 +00:00
|
|
|
$(MAKE_VARS) \
|
2015-08-02 06:26:39 +00:00
|
|
|
$(MAKE_FLAGS) \
|
2019-04-05 04:47:33 +00:00
|
|
|
npm_config_arch=$(NODEJS_CPU) \
|
|
|
|
npm_config_target_arch=$(NODEJS_CPU) \
|
|
|
|
npm_config_build_from_source=true \
|
|
|
|
npm_config_nodedir=$(STAGING_DIR)/usr/ \
|
|
|
|
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
|
|
|
|
npm_config_cache=$(TMP_DIR)/npm-cache \
|
|
|
|
npm_config_tmp=$(TMP_DIR)/npm-tmp \
|
|
|
|
npm install -g $(PKG_BUILD_DIR)
|
|
|
|
rm -rf $(TMP_DIR)/npm-tmp
|
|
|
|
rm -rf $(TMP_DIR)/npm-cache
|
2015-08-02 06:26:39 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/node-arduino-firmata/install
|
2019-04-05 04:47:33 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,README.md} \
|
|
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{tests,*.txt} \
|
|
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,lib} \
|
|
|
|
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
|
2016-03-11 17:10:04 +00:00
|
|
|
$(CP) ./files/* $(1)/
|
2015-08-02 06:26:39 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,node-arduino-firmata))
|