diff options
author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2022-08-22 13:13:37 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-25 11:08:06 +0100 |
commit | cf6648d437b8110917e5d80f8ba2dc6e54145161 (patch) | |
tree | 64c37b6d044091b6dfa5f1fbbec9fa1e1297e9eb /meta/classes-recipe/npm.bbclass | |
parent | b6caff521a1ddebf7dd73efb2c3dc00448d30455 (diff) | |
download | poky-cf6648d437b8110917e5d80f8ba2dc6e54145161.tar.gz |
npm.bbclass: fix architecture mapping
Use the same code as the 'nodejs_16.4.bb recipe' for mapping the OE
arch to the NPM arch.
A noticeable change (and fix for exiting problems) is the move from
'arm' to 'arm64' for 'aarch64'.
(From OE-Core rev: cd773722cb66eea487c6004a006e1b88f0b07a5a)
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/npm.bbclass')
-rw-r--r-- | meta/classes-recipe/npm.bbclass | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/meta/classes-recipe/npm.bbclass b/meta/classes-recipe/npm.bbclass index 8e73400678..20350cea25 100644 --- a/meta/classes-recipe/npm.bbclass +++ b/meta/classes-recipe/npm.bbclass | |||
@@ -28,20 +28,18 @@ NPM_INSTALL_DEV ?= "0" | |||
28 | 28 | ||
29 | NPM_NODEDIR ?= "${RECIPE_SYSROOT_NATIVE}${prefix_native}" | 29 | NPM_NODEDIR ?= "${RECIPE_SYSROOT_NATIVE}${prefix_native}" |
30 | 30 | ||
31 | def npm_target_arch_map(target_arch): | 31 | ## must match mapping in nodejs.bb (openembedded-meta) |
32 | """Maps arch names to npm arch names""" | 32 | def map_nodejs_arch(a, d): |
33 | import re | 33 | import re |
34 | if re.match("p(pc|owerpc)(|64)", target_arch): | 34 | |
35 | return "ppc" | 35 | if re.match('i.86$', a): return 'ia32' |
36 | elif re.match("i.86$", target_arch): | 36 | elif re.match('x86_64$', a): return 'x64' |
37 | return "ia32" | 37 | elif re.match('aarch64$', a): return 'arm64' |
38 | elif re.match("x86_64$", target_arch): | 38 | elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64' |
39 | return "x64" | 39 | elif re.match('powerpc$', a): return 'ppc' |
40 | elif re.match("arm64$", target_arch): | 40 | return a |
41 | return "arm" | 41 | |
42 | return target_arch | 42 | NPM_ARCH ?= "${@map_nodejs_arch(d.getVar("TARGET_ARCH"), d)}" |
43 | |||
44 | NPM_ARCH ?= "${@npm_target_arch_map(d.getVar("TARGET_ARCH"))}" | ||
45 | 43 | ||
46 | NPM_PACKAGE = "${WORKDIR}/npm-package" | 44 | NPM_PACKAGE = "${WORKDIR}/npm-package" |
47 | NPM_CACHE = "${WORKDIR}/npm-cache" | 45 | NPM_CACHE = "${WORKDIR}/npm-cache" |