You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.6 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NPM_NAME:=serialport
  9. PKG_NAME:=node-$(PKG_NPM_NAME)
  10. PKG_VERSION:=1.4.6
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
  13. PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
  14. PKG_MD5SUM:=1eb21082e0aa676b8350182a60230808
  15. PKG_BUILD_DEPENDS:=node
  16. PKG_NODE_VERSION:=0.12.7
  17. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/node-serialport
  20. DEPENDS:=+node
  21. SUBMENU:=Node.js
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. TITLE:=Node.js package to access serial ports for reading and writing
  25. URL:=https://www.npmjs.org/package/serialport
  26. endef
  27. define Package/node-serialport/description
  28. Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
  29. endef
  30. define Build/Prepare
  31. /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
  32. $(Build/Patch)
  33. endef
  34. EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
  35. define Build/Compile
  36. $(MAKE_FLAGS) \
  37. npm_config_arch=$(CONFIG_ARCH) \
  38. npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
  39. PREFIX="$(PKG_INSTALL_DIR)/usr/" \
  40. $(STAGING_DIR_HOST)/bin/npm install -g $(PKG_BUILD_DIR)
  41. endef
  42. define Package/node-serialport/install
  43. mkdir -p $(1)/usr/lib/node/
  44. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
  45. endef
  46. $(eval $(call BuildPackage,node-serialport))