]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/npm: use npm install to do installation
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 31 Oct 2016 04:02:23 +0000 (17:02 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 6 Nov 2016 23:35:15 +0000 (23:35 +0000)
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@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/npm.bbclass

index fce4c1146f29cee55df7643b63bfa9723db013e6..43228c57d329318bc26516f0ada4277abdf054fb 100644 (file)
@@ -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 () {