mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-03 02:10:04 +00:00
nodejs: Drop workaround for an absolute path in the npm shebang
The rewrite of the npm shebang to use an absolute path was removed in version 7.0.0. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
committed by
Khem Raj
parent
4229bddf42
commit
a7fd038743
@@ -160,20 +160,6 @@ do_install () {
|
||||
}
|
||||
|
||||
do_install:append:class-native() {
|
||||
# use node from PATH instead of absolute path to sysroot
|
||||
# node-v0.10.25/tools/install.py is using:
|
||||
# shebang = os.path.join(node_prefix, 'bin/node')
|
||||
# update_shebang(link_path, shebang)
|
||||
# and node_prefix can be very long path to bindir in native sysroot and
|
||||
# when it exceeds 128 character shebang limit it's stripped to incorrect path
|
||||
# and npm fails to execute like in this case with 133 characters show in log.do_install:
|
||||
# updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node
|
||||
# /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js
|
||||
# use sed on npm-cli.js because otherwise symlink is replaced with normal file and
|
||||
# npm-cli.js continues to use old shebang
|
||||
if [[ -f "${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js" ]]; then
|
||||
sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
|
||||
fi
|
||||
# Install the native binaries to provide it within sysroot for the target compilation
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque
|
||||
@@ -185,12 +171,6 @@ do_install:append:class-native() {
|
||||
install -m 0755 ${S}/out/Release/node_mksnapshot ${D}${bindir}/node_mksnapshot
|
||||
}
|
||||
|
||||
do_install:append:class-target() {
|
||||
if [[ -f "${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js" ]]; then
|
||||
sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
|
||||
fi
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-npm"
|
||||
FILES:${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx"
|
||||
RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \
|
||||
|
||||
Reference in New Issue
Block a user