2 # Copyright (C) 2014 Arduino LLC
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
10 PKG_NPM_NAME
:=serialport
11 PKG_NAME
:=node-
$(PKG_NPM_NAME
)
15 PKG_SOURCE
:=$(PKG_NPM_NAME
)-$(PKG_VERSION
).tgz
16 PKG_SOURCE_URL
:=http
://registry.npmjs.org
/$(PKG_NPM_NAME
)/-/
17 PKG_MD5SUM
:=ea20a17746dd64e72d5f6f2019d9e28d
19 PKG_BUILD_DEPENDS
:=node
/host
20 PKG_NODE_VERSION
:=4.4.5
22 PKG_MAINTAINER
:=John Crispin
<blogic@openwrt.org
>
24 PKG_LICENSE_FILE
:=LICENSE
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/node-serialport
33 TITLE
:=Node.js package to access serial ports for reading and writing
34 URL
:=https
://www.npmjs.org
/package
/serialport
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
!
42 /bin
/tar xzf
$(DL_DIR
)/$(PKG_SOURCE
) -C
$(PKG_BUILD_DIR
) --strip-components
1
46 CPU
:=$(subst x86_64
,x64
,$(subst i386
,ia32
,$(ARCH
)))
48 EXTRA_LDFLAGS
="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
52 npm_config_arch
=$(CONFIG_ARCH
) \
53 npm_config_nodedir
=$(BUILD_DIR
)/node-v
$(PKG_NODE_VERSION
)/ \
54 npm_config_cache
=$(BUILD_DIR
)/node-v
$(PKG_NODE_VERSION
)/npm-cache \
55 PREFIX
="$(PKG_INSTALL_DIR)/usr/" \
56 $(STAGING_DIR
)/host
/bin
/npm
install --build-from-source
--target_arch
=$(CPU
) -g
$(PKG_BUILD_DIR
)
59 define Package
/node-serialport
/install
60 mkdir
-p
$(1)/usr
/lib
/node
/
61 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/node_modules
/* $(1)/usr
/lib
/node
/
64 $(eval
$(call BuildPackage
,node-serialport
))