node: Move NPM into a separated pacakge 4233/head
authorYgal Blum <ygal.blum@gmail.com>
Mon, 3 Apr 2017 12:21:39 +0000 (15:21 +0300)
committerYgal Blum <ygal.blum@technicolor.com>
Thu, 6 Apr 2017 07:15:32 +0000 (10:15 +0300)
In order to reduce flash requirements and also to disallow running NPM on the target
move NPM out of the default NodeJS package.
In order to allow adding NPM via opkg install, move it to a separated
directory

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
lang/node-arduino-firmata/Makefile
lang/node-cylon/Makefile
lang/node-hid/Makefile
lang/node-serialport/Makefile
lang/node/Makefile

index f4de0c0c4dbd52913f9421ea451cf6283c50dfb5..ead638b55f7533c24e3ba3220c41c4ca340d98a9 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NPM_NAME:=arduino-firmata
 PKG_NAME:=node-$(PKG_NPM_NAME)
 PKG_VERSION:=0.3.3
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
@@ -28,7 +28,7 @@ PKG_LICENSE_FILES:=LICENSE.txt
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-arduino-firmata
-  DEPENDS:=+node
+  DEPENDS:=+node +node-npm
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
index 13833a3552c3e6221e821dcc2b0680fc34f5b425..bdb18cedc7d2809a36fa57799ee3aff4945210cb 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NPM_NAME:=cylon
 PKG_NAME:=node-$(PKG_NPM_NAME)
 PKG_VERSION:=0.22.0
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/hybridgroup/cylon-firmata.git
@@ -28,7 +28,7 @@ PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-cylon/default
-  DEPENDS:=+node $(2)
+  DEPENDS:=+node +node-npm $(2)
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
index b8a5b7ab9ddab29468779497cfd706184d7bc963..50c1bd89c2a927be77b2925e9ce96cff3ed673cf 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NPM_NAME:=hid
 PKG_NAME:=node-$(PKG_NPM_NAME)
 PKG_VERSION:=0.5.1
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/node-hid/node-hid.git
@@ -28,7 +28,7 @@ PKG_LICENSE_FILES:=
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-hid
-  DEPENDS:=+node
+  DEPENDS:=+node +node-npm
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
index 3109404921e796cf203a0725f4210b656cf7b1e4..e46db57644f6a45065d6b026bc1473212da25a74 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NPM_NAME:=serialport
 PKG_NAME:=node-$(PKG_NPM_NAME)
 PKG_VERSION:=3.0.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
@@ -26,7 +26,7 @@ PKG_LICENSE_FILES:=LICENSE
 include $(INCLUDE_DIR)/package.mk
 
 define Package/node-serialport
-  DEPENDS:=+node
+  DEPENDS:=+node +node-npm
   SUBMENU:=Node.js
   SECTION:=lang
   CATEGORY:=Languages
index 3a1a2f3eb836181da40cbda8a65f4ff0da2eb0d1..4d72ffa88a74696745119ef728e4f3ede6dc69ea 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=node
 PKG_VERSION:=v4.4.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
@@ -44,6 +44,19 @@ define Package/node/description
    package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
 endef
 
+define Package/node-npm
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Node.js
+  TITLE:=NPM stands for Node Package Manager
+  URL:=http://npmjs.com/
+  DEPENDS:=+node
+endef
+
+define Package/node-npm/description
+       NPM is the package manager for NodeJS
+endef
+
 CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
 
 MAKE_VARS += \
@@ -82,8 +95,13 @@ define Build/InstallDev
 endef
 
 define Package/node/install
+       mkdir -p $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
+endef
+
+define Package/node-npm/install
        mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
@@ -92,3 +110,4 @@ endef
 
 $(eval $(call HostBuild))
 $(eval $(call BuildPackage,node))
+$(eval $(call BuildPackage,node-npm))