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