forked from vshymanskyy/blynk-library-openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 1.53 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=blynk-library
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.4.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_MD5SUM:=7e90c28befe0eae9a18b7c6cab966804
PKG_BUILD_DEPENDS:=node/host
PKG_USE_MIPS16:=0
PKG_MAINTAINER:=Volodymyr Shymanskyy
PKG_LICENSE:=MIT
include $(INCLUDE_DIR)/package.mk
define Package/node-blynk-library
SUBMENU:=Node.js
SECTION:=lang
CATEGORY:=Languages
TITLE:=Blynk client for Node.js
URL:=https://www.npmjs.com/package/blynk-library
DEPENDS:=+node
endef
define Package/node-blynk-library/description
Blynk is a platform with iOS and Android apps to control Arduino,
Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your projects
by simply dragging and dropping widgets.
endef
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
endef
define Build/Compile
$(MAKE_VARS) \
$(MAKE_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
npm install --no-optional --build-from-source --target_arch=$(NODEJS_CPU) -g $(DL_DIR)/$(PKG_SOURCE)
endef
define Package/node-blynk-library/install
$(INSTALL_DIR) $(1)/usr/lib/node
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
endef
$(eval $(call BuildPackage,node-blynk-library))