node: Reduce node-npm package size
authorHirokazu MORIKAWA <morikw2@gmail.com>
Fri, 28 May 2021 04:04:48 +0000 (13:04 +0900)
committerHirokazu MORIKAWA <morikw2@gmail.com>
Fri, 28 May 2021 04:04:48 +0000 (13:04 +0900)
Reduce package size by about 1MB.

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
lang/node/Makefile

index 9b1a67d95a126ae26af9fc3be89f0ae7c07fd075..87126f59bdef75f880fdff36d7c0ed4df6443e4d 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=node
 PKG_VERSION:=v14.17.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION)
@@ -141,8 +141,13 @@ define Package/node/install
 endef
 
 define Package/node-npm/install
-       $(INSTALL_DIR) $(1)/usr/lib/node_modules
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node_modules/
+       $(INSTALL_DIR) $(1)/usr/lib/node_modules/npm
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE} \
+               $(1)/usr/lib/node_modules/npm/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{AUTHORS,*.md} \
+               $(1)/usr/lib/node_modules/npm/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{node_modules,bin,lib} \
+               $(1)/usr/lib/node_modules/npm/
        $(INSTALL_DIR) $(1)/usr/bin
        $(LN) ../lib/node_modules/npm/bin/npm-cli.js $(1)/usr/bin/npm
        $(LN) ../lib/node_modules/npm/bin/npx-cli.js $(1)/usr/bin/npx