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.

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