diff options
-rw-r--r-- | meta/classes/npm.bbclass | 6 | ||||
-rw-r--r-- | scripts/lib/devtool/standard.py | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index b5db99d2b9..33ff5e3f45 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
@@ -1,6 +1,8 @@ | |||
1 | DEPENDS_prepend = "nodejs-native " | 1 | DEPENDS_prepend = "nodejs-native " |
2 | S = "${WORKDIR}/npmpkg" | 2 | S = "${WORKDIR}/npmpkg" |
3 | 3 | ||
4 | NPM_INSTALLDIR = "${D}${libdir}/node_modules/${PN}" | ||
5 | |||
4 | npm_do_compile() { | 6 | npm_do_compile() { |
5 | # changing the home directory to the working directory, the .npmrc will | 7 | # changing the home directory to the working directory, the .npmrc will |
6 | # be created in this directory | 8 | # be created in this directory |
@@ -14,8 +16,8 @@ npm_do_compile() { | |||
14 | } | 16 | } |
15 | 17 | ||
16 | npm_do_install() { | 18 | npm_do_install() { |
17 | mkdir -p ${D}${libdir}/node_modules/${PN}/ | 19 | mkdir -p ${NPM_INSTALLDIR}/ |
18 | cp -a ${S}/* ${D}${libdir}/node_modules/${PN}/ --no-preserve=ownership | 20 | cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership |
19 | } | 21 | } |
20 | 22 | ||
21 | python populate_packages_prepend () { | 23 | python populate_packages_prepend () { |
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 7600a8fa1f..9ac2ad57a8 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -238,6 +238,17 @@ def add(args, config, basepath, workspace): | |||
238 | f.write(' rm -f ${D}/singletask.lock\n') | 238 | f.write(' rm -f ${D}/singletask.lock\n') |
239 | f.write('}\n') | 239 | f.write('}\n') |
240 | 240 | ||
241 | if bb.data.inherits_class('npm', rd): | ||
242 | f.write('do_install_append() {\n') | ||
243 | f.write(' # Remove files added to source dir by devtool/externalsrc\n') | ||
244 | f.write(' rm -f ${NPM_INSTALLDIR}/singletask.lock\n') | ||
245 | f.write(' rm -rf ${NPM_INSTALLDIR}/.git\n') | ||
246 | f.write(' rm -rf ${NPM_INSTALLDIR}/oe-local-files\n') | ||
247 | f.write(' for symlink in ${EXTERNALSRC_SYMLINKS} ; do\n') | ||
248 | f.write(' rm -f ${NPM_INSTALLDIR}/${symlink%%:*}\n') | ||
249 | f.write(' done\n') | ||
250 | f.write('}\n') | ||
251 | |||
241 | _add_md5(config, recipename, appendfile) | 252 | _add_md5(config, recipename, appendfile) |
242 | 253 | ||
243 | logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) | 254 | logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile) |