nodejs: add 0.12 version of node

add node-js 0.12 and a few gyp bindings

Signed-off-by: John Crispin <blogic@openwrt.org>
This commit is contained in:
John Crispin
2015-08-02 08:26:39 +02:00
parent 23bee2145f
commit 1fd7b5d1e6
12 changed files with 3171 additions and 0 deletions
+94
View File
@@ -0,0 +1,94 @@
#
# 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:=cylon
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=1.1.0
PKG_RELEASE:=1
PKG_SOURCE:=v0.22.0.tar.gz
PKG_SOURCE_URL:=https://github.com/hybridgroup/cylon-firmata/archive/
PKG_BUILD_DEPENDS:=node
PKG_NODE_VERSION:=0.12.7
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=Apache-2.0
include $(INCLUDE_DIR)/package.mk
define Package/node-cylon/default
DEPENDS:=+node $(2)
SUBMENU:=Node.js
SECTION:=lang
CATEGORY:=Languages
TITLE:=CylonJS - $(1)
URL:=https://www.npmjs.org/package/cylon
endef
define Package/node-cylon
$(call Package/node-cylon/default,Core)
endef
define Package/node-cylon-i2c
$(call Package/node-cylon/default,I2C,+node-cylon)
endef
define Package/node-cylon-gpio
$(call Package/node-cylon/default,GPIO,+node-cylon)
endef
define Package/node-cylon-firmata
$(call Package/node-cylon/default,Firmata,+node-cylon-gpio +node-cylon-i2c +node-arduino-firmata)
endef
define Package/node-cylon/description
JavaScript Robotics, By Your Command Next generation robotics framework with support for 36 different platforms Get Started
endef
define Build/Prepare
/bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
$(Build/Patch)
endef
EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
define Build/Compile
$(MAKE_FLAGS) \
npm_config_arch=$(CONFIG_ARCH) \
npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
$(STAGING_DIR_HOST)/bin/npm install -g $(PKG_BUILD_DIR)
endef
define Package/node-cylon/install
mkdir -p $(1)/usr/lib/node/cylon
$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon/* $(1)/usr/lib/node/cylon/
endef
define Package/node-cylon-i2c/install
mkdir -p $(1)/usr/lib/node/cylon-i2c
$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon-i2c/* $(1)/usr/lib/node/cylon-i2c/
endef
define Package/node-cylon-gpio/install
mkdir -p $(1)/usr/lib/node/cylon-gpio
$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/node_modules/cylon-gpio/* $(1)/usr/lib/node/cylon-gpio/
endef
define Package/node-cylon-firmata/install
mkdir -p $(1)/usr/lib/node/cylon-firmata
$(CP) -r $(PKG_INSTALL_DIR)/usr/lib/node_modules/cylon-firmata/{index.js,lib,LICENSE,package.json,README.md,RELEASES.md,spec} $(1)/usr/lib/node/cylon-firmata/
endef
$(eval $(call BuildPackage,node-cylon))
$(eval $(call BuildPackage,node-cylon-i2c))
$(eval $(call BuildPackage,node-cylon-gpio))
$(eval $(call BuildPackage,node-cylon-firmata))