[oe-commits] [openembedded-core] 07/84: classes/npm: use npm install to do installation

git at git.openembedded.org git at git.openembedded.org
Sun Nov 6 10:28:24 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit f3ac0d75435ec6f55ee5a3fc2132ead029887845
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Mon Oct 31 17:02:23 2016 +1300

    classes/npm: use npm install to do installation
    
    Using "npm install" instead of "cp -a" is the more correct thing to be
    doing here, and ensures that symlinks for executable scripts are put
    into ${prefix}/bin. (I'd prefer ${bindir}, but npm does not allow
    specifying paths at that level - only a prefix.)
    
    Fixes [YOCTO #10460].
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/npm.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index fce4c11..43228c5 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -33,7 +33,11 @@ npm_do_compile() {
 
 npm_do_install() {
 	mkdir -p ${NPM_INSTALLDIR}/
-	cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
+	npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry
+	if [ -d ${D}${prefix}/etc ] ; then
+		# This will be empty
+		rmdir ${D}${prefix}/etc
+	fi
 }
 
 python populate_packages_prepend () {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list