diff options
| author | Nisha Parrakat <nishaparrakat@gmail.com> | 2022-01-12 09:40:57 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2022-01-12 09:35:18 -0800 |
| commit | 1bdbdf3a7e09b387fa25a3fa0dc0f15188cb5331 (patch) | |
| tree | 621e836894ef99e8f320746cabbf5b750d26c842 | |
| parent | 9786d0fb55cc10f6dcd99e6e6b56f4ca7efbdf38 (diff) | |
| download | meta-openembedded-1bdbdf3a7e09b387fa25a3fa0dc0f15188cb5331.tar.gz | |
nodejs_16.11.1.bb: only handle npm if configured
npm-cli.js should be symlinked only when the file is present
the file may not be available if the configure option is --without-npm
Signed-off-by: Nisha Parrakat <nishaparrakat@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb index 11034420aa..c8d9425387 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_16.11.1.bb | |||
| @@ -175,8 +175,9 @@ do_install:append:class-native() { | |||
| 175 | # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js | 175 | # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js |
| 176 | # use sed on npm-cli.js because otherwise symlink is replaced with normal file and | 176 | # use sed on npm-cli.js because otherwise symlink is replaced with normal file and |
| 177 | # npm-cli.js continues to use old shebang | 177 | # npm-cli.js continues to use old shebang |
| 178 | sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | 178 | if [[ -f "${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js" ]]; then |
| 179 | 179 | sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | |
| 180 | fi | ||
| 180 | # Install the native binaries to provide it within sysroot for the target compilation | 181 | # Install the native binaries to provide it within sysroot for the target compilation |
| 181 | install -d ${D}${bindir} | 182 | install -d ${D}${bindir} |
| 182 | install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque | 183 | install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque |
| @@ -189,7 +190,9 @@ do_install:append:class-native() { | |||
| 189 | } | 190 | } |
| 190 | 191 | ||
| 191 | do_install:append:class-target() { | 192 | do_install:append:class-target() { |
| 192 | sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | 193 | if [[ -f "${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js" ]]; then |
| 194 | sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 195 | fi | ||
| 193 | } | 196 | } |
| 194 | 197 | ||
| 195 | PACKAGES =+ "${PN}-npm" | 198 | PACKAGES =+ "${PN}-npm" |
