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.

69 lines
2.0 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:=arduino-firmata
  9. PKG_NAME:=node-$(PKG_NPM_NAME)
  10. PKG_VERSION:=0.3.3
  11. PKG_RELEASE:=6
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
  14. PKG_SOURCE_VERSION:=16e76007edf218d72df590adbd711ac6b7432845
  15. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
  17. PKG_MIRROR_HASH:=b7a498ccf70e466503e72d38ae5b474e91416b6c9842fd167dff249357b0dc37
  18. PKG_BUILD_DEPENDS:=node/host
  19. PKG_NODE_VERSION:=4.4.5
  20. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  21. PKG_LICENSE:=MIT
  22. PKG_LICENSE_FILES:=LICENSE.txt
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/node-arduino-firmata
  25. DEPENDS:=+node +node-npm
  26. SUBMENU:=Node.js
  27. SECTION:=lang
  28. CATEGORY:=Languages
  29. DEPENDS:=+node +node-serialport
  30. TITLE:=Node.js package to access serial ports for reading and writing
  31. URL:=https://www.npmjs.org/package/serialport
  32. endef
  33. define Package/node-arduino-firmata/description
  34. Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
  35. endef
  36. define Build/Prepare
  37. /bin/tar xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
  38. $(Build/Patch)
  39. endef
  40. EXTRA_LDFLAGS="-L$(TOOLCHAIN_DIR)/lib/ -Wl,-rpath-link $(TOOLCHAIN_DIR)/lib/" \
  41. define Build/Compile
  42. $(MAKE_FLAGS) \
  43. npm_config_arch=$(CONFIG_ARCH) \
  44. npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
  45. npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
  46. PREFIX="$(PKG_INSTALL_DIR)/usr/" \
  47. npm install -g $(PKG_BUILD_DIR)
  48. endef
  49. define Package/node-arduino-firmata/install
  50. mkdir -p $(1)/usr/lib/node
  51. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node
  52. rm -rf $(1)/usr/lib/node/arduino-firmata/node_modules/serialport/
  53. $(CP) ./files/* $(1)/
  54. endef
  55. $(eval $(call BuildPackage,node-arduino-firmata))