node update v0.12.13
[feed/packages.git] / lang / node-serialport / 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:=serialport
11 PKG_NAME:=node-$(PKG_NPM_NAME)
12 PKG_VERSION:=1.4.6
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
16 PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
17 PKG_MD5SUM:=1eb21082e0aa676b8350182a60230808
18
19 PKG_BUILD_DEPENDS:=node/host
20 PKG_NODE_VERSION:=0.12.13
21
22 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
23 PKG_LICENSE:=Custom
24 PKG_LICENSE_FILE:=LICENSE
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/node-serialport
29 DEPENDS:=+node
30 SUBMENU:=Node.js
31 SECTION:=lang
32 CATEGORY:=Languages
33 TITLE:=Node.js package to access serial ports for reading and writing
34 URL:=https://www.npmjs.org/package/serialport
35 endef
36
37 define Package/node-serialport/description
38 Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
39 endef
40
41 define Build/Prepare
42 /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
43 $(Build/Patch)
44 endef
45
46 EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
47
48 define Build/Compile
49 $(MAKE_FLAGS) \
50 npm_config_arch=$(CONFIG_ARCH) \
51 npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
52 npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
53 PREFIX="$(PKG_INSTALL_DIR)/usr/" \
54 $(STAGING_DIR)/host/bin/npm install -g $(PKG_BUILD_DIR)
55 endef
56
57 define Package/node-serialport/install
58 mkdir -p $(1)/usr/lib/node/
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
60 endef
61
62 $(eval $(call BuildPackage,node-serialport))
63