diff options
author | Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> | 2019-05-17 17:14:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-21 12:56:33 +0100 |
commit | eecba41822e86b69ebdb9cbc8fbfd512ad9a47d7 (patch) | |
tree | 2a5b67c66e95d27e3c1f8256a116f6b3ccf81b4e | |
parent | 797916f93af161cfb6d89ede32dfc045c4850cdb (diff) | |
download | poky-eecba41822e86b69ebdb9cbc8fbfd512ad9a47d7.tar.gz |
npm: get npm package name from npm pack
Fixes [YOCTO #12534]
When using npm packages with exotic names, like "JSONSelect" (with
uppercase) or "@angular/cli" (with at sign and slash), there are three
different names:
- the recipe name ("jsonselect" or "angular-cli")
- the npm module name ("JSONSelect" or "@angular/cli")
- the npm pack name ("JSONSelect" or "angular-cli")
The commit fa9c077068a2acea04389fa2b44eb2e93548fce2 allow to have
different recipe name and npm module name by setting the NPMPN variable.
This commit allows to have yet another npm pack name. The pack filename
is now dynamically retrieved from the 'npm pack' command.
(From OE-Core rev: b6ffa59d03fbf53d1681fce5f8c3c1f163cf9923)
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/npm.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 6dbae6bc79..3dd2d13804 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
@@ -53,8 +53,8 @@ npm_do_install() { | |||
53 | # be created in this directory | 53 | # be created in this directory |
54 | export HOME=${WORKDIR} | 54 | export HOME=${WORKDIR} |
55 | mkdir -p ${D}${libdir}/node_modules | 55 | mkdir -p ${D}${libdir}/node_modules |
56 | npm pack . | 56 | local NPM_PACKFILE=$(npm pack .) |
57 | npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${NPMPN}-${PV}.tgz | 57 | npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${NPM_PACKFILE} |
58 | mv ${D}${libdir}/node_modules ${D}${libdir}/node | 58 | mv ${D}${libdir}/node_modules ${D}${libdir}/node |
59 | if [ -d ${D}${prefix}/etc ] ; then | 59 | if [ -d ${D}${prefix}/etc ] ; then |
60 | # This will be empty | 60 | # This will be empty |