summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-10-25 20:14:50 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-10-31 17:01:44 +1300
commita8f4016cce5e83996d59149104d7b8c0ddbec798 (patch)
treea801e9ad479c7133dc20debddc82953701434f32
parentb18fa5f2f2f46afc6fdc58f4d29679dea9c36c43 (diff)
downloadopenembedded-core-contrib-paule/npm-install-fix.tar.gz
openembedded-core-contrib-paule/npm-install-fix.tar.bz2
openembedded-core-contrib-paule/npm-install-fix.zip
classes/npm: use npm install to do installationpaule/npm-install-fix
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>
-rw-r--r--meta/classes/npm.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index fce4c1146f..43228c57d3 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 () {