forked from nxhack/openwrt-node-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=node-red-contrib-gpio
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.14.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=d3a4d007638bc3f55e9fbd8bd01a35469e9e9f43f8e0ff116fa3915e2be9e1e7
PKG_BUILD_DEPENDS:=node/host
PKG_USE_MIPS16:=0
PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=License.md
include $(INCLUDE_DIR)/package.mk
define Package/node-node-red-contrib-gpio
SUBMENU:=Node.js
SECTION:=lang
CATEGORY:=Languages
TITLE:=nodes for using johnny-five and IO plugins
URL:=http://nodered.org/
DEPENDS:=+node
endef
define Package/node-node-red-contrib-gpio/description
A set of input and output nodes for controlling General Purpose Input and Outputs (GPIOs) though the use of johnny-five I/O Plugins as well as running johnny-five scripts!
endef
TAR_OPTIONS+= --strip-components 1
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
define Build/Compile
$(MAKE_VARS) \
$(MAKE_FLAGS) \
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
endef
define Package/node-node-red-contrib-gpio/install
$(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,*.md} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{*.js,*.html,*.png} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,lib,icons} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
endef
$(eval $(call BuildPackage,node-node-red-contrib-gpio))