Merge pull request #4868 from nxhack/CVE-2017-1000250
[feed/packages.git] / lang / node-arduino-firmata / Makefile
1 #
2 # Copyright (C) 2014 Arduino LLC
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NPM_NAME:=arduino-firmata
11 PKG_NAME:=node-$(PKG_NPM_NAME)
12 PKG_VERSION:=0.3.3
13 PKG_RELEASE:=7
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
17 PKG_SOURCE_VERSION:=16e76007edf218d72df590adbd711ac6b7432845
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
20 PKG_MIRROR_HASH:=b7a498ccf70e466503e72d38ae5b474e91416b6c9842fd167dff249357b0dc37
21
22 PKG_BUILD_DEPENDS:=node/host
23 PKG_NODE_VERSION:=6.11.2
24
25 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
26 PKG_LICENSE:=MIT
27 PKG_LICENSE_FILES:=LICENSE.txt
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/node-arduino-firmata
32 SUBMENU:=Node.js
33 SECTION:=lang
34 CATEGORY:=Languages
35 TITLE:=Node.js package to access serial ports for reading and writing
36 URL:=https://www.npmjs.org/package/serialport
37 DEPENDS:=+node +node-npm +node-serialport
38 endef
39
40 define Package/node-arduino-firmata/description
41 Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
42 endef
43
44 define Build/Prepare
45 /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
46 $(Build/Patch)
47 endef
48
49 EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
50
51 define Build/Compile
52 $(MAKE_FLAGS) \
53 npm_config_arch=$(CONFIG_ARCH) \
54 npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
55 npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
56 PREFIX="$(PKG_INSTALL_DIR)/usr/" \
57 npm install -g $(PKG_BUILD_DIR)
58 endef
59
60 define Package/node-arduino-firmata/install
61 mkdir -p $(1)/usr/lib/node
62 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node
63 rm -rf $(1)/usr/lib/node/arduino-firmata/node_modules/serialport/
64 $(CP) ./files/* $(1)/
65 endef
66
67 $(eval $(call BuildPackage,node-arduino-firmata))
68