diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-05 15:58:01 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-08 00:36:43 +0100 |
commit | 4fb8b399c05a1b66986fc76e13525f6c5e0d9b58 (patch) | |
tree | be6183ab3a3871fd2ef1b3f946dee8875d55c321 /meta/classes | |
parent | f0d6f4b7e87ea781ac0dffcc8d0310570975811b (diff) | |
download | openembedded-core-4fb8b399c05a1b66986fc76e13525f6c5e0d9b58.tar.gz openembedded-core-4fb8b399c05a1b66986fc76e13525f6c5e0d9b58.tar.bz2 openembedded-core-4fb8b399c05a1b66986fc76e13525f6c5e0d9b58.zip |
recipetool: create: support node.js code outside of npm
If you have your own node.js application you may not publish it (or at
least not immediately) in an npm registry - it might just be in a
repository on github or on your local machine. Add support to recipetool
create for creating recipes to build such applications - extract their
dependencies, fetch them, and add corresponding npm:// URLs to SRC_URI,
and ensure that LICENSE / LIC_FILES_CHKSUM are updated to match. For
example, you can now run:
recipetool create https://github.com/diversario/node-ssdp
(I had to borrow some code from bitbake/lib/bb/fetch2/npm.py to
implement this functionality; this should be refactored out but now
isn't the time to do that refactoring.)
Part of the fix for [YOCTO #9537].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/npm.bbclass | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 55c7c3e278..fce4c1146f 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -16,6 +16,10 @@ def npm_oe_arch_map(target_arch, d): NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH', True), d)}" npm_do_compile() { + # Copy in any additionally fetched modules + if [ -d ${WORKDIR}/node_modules ] ; then + cp -a ${WORKDIR}/node_modules ${S}/ + fi # changing the home directory to the working directory, the .npmrc will # be created in this directory export HOME=${WORKDIR} |