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:49 +0100 |
commit | ff259b095d1a84d1dc9b004c669c8f35659c3c2b (patch) | |
tree | b907b000b830f4955273463d886896660ff88a18 /meta | |
parent | fa90c2f54d7954dd3149404b38a0899d2e4962cf (diff) | |
download | poky-ff259b095d1a84d1dc9b004c669c8f35659c3c2b.tar.gz |
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].
(From OE-Core rev: 4fb8b399c05a1b66986fc76e13525f6c5e0d9b58)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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): | |||
16 | NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH', True), d)}" | 16 | NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH', True), d)}" |
17 | 17 | ||
18 | npm_do_compile() { | 18 | npm_do_compile() { |
19 | # Copy in any additionally fetched modules | ||
20 | if [ -d ${WORKDIR}/node_modules ] ; then | ||
21 | cp -a ${WORKDIR}/node_modules ${S}/ | ||
22 | fi | ||
19 | # changing the home directory to the working directory, the .npmrc will | 23 | # changing the home directory to the working directory, the .npmrc will |
20 | # be created in this directory | 24 | # be created in this directory |
21 | export HOME=${WORKDIR} | 25 | export HOME=${WORKDIR} |