From 4fb8b399c05a1b66986fc76e13525f6c5e0d9b58 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 5 Sep 2016 15:58:01 +1200 Subject: 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 --- meta/classes/npm.bbclass | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'meta/classes') 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} -- cgit 1.2.3-korg