1config BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS
2	bool
3	default y if BR2_HOSTARCH = "aarch64"
4	default y if BR2_HOSTARCH = "arm"
5	default y if BR2_HOSTARCH = "ppc64le"
6	default y if BR2_HOSTARCH = "x86_64"
7
8comment "host nodejs needs a host gcc >= 8"
9	depends on !BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS
10	depends on !BR2_HOST_GCC_AT_LEAST_8
11
12config BR2_PACKAGE_HOST_NODEJS
13	bool "host nodejs"
14	depends on BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS || \
15		BR2_HOST_GCC_AT_LEAST_8
16	help
17	  Event-driven I/O server-side JavaScript environment based on
18	  V8.
19
20	  http://nodejs.org/
21
22if BR2_PACKAGE_HOST_NODEJS
23
24choice
25	prompt "host nodejs variant"
26	default BR2_PACKAGE_HOST_NODEJS_BIN if BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS
27	default BR2_PACKAGE_HOST_NODEJS_SRC
28	help
29	  Select a nodejs variant - built from source or
30	  pre-built.
31
32config BR2_PACKAGE_HOST_NODEJS_BIN
33	bool "pre-built version"
34	depends on BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS
35
36config BR2_PACKAGE_HOST_NODEJS_SRC
37	bool "compile from source"
38	depends on BR2_HOST_GCC_AT_LEAST_8
39	select BR2_PACKAGE_HOST_PYTHON3
40	select BR2_PACKAGE_HOST_PYTHON3_BZIP2
41	select BR2_PACKAGE_HOST_PYTHON3_SSL
42
43comment "host nodejs from source needs a host gcc >= 8"
44	depends on !BR2_HOST_GCC_AT_LEAST_8
45
46endchoice
47
48config BR2_PACKAGE_HOST_NODEJS_COREPACK
49	bool "Corepack"
50	help
51	  Enable Corepack with host nodejs.
52
53	  Corepack is a zero-runtime-dependency Node.js script that
54	  acts as a bridge between Node.js projects and the package
55	  managers they are intended to be used with during
56	  development. In practical terms, Corepack will let you use
57	  Yarn and pnpm without having to install them - just like
58	  what currently happens with npm, which is shipped by Node.js
59	  by default.
60
61endif
62
63config BR2_PACKAGE_PROVIDES_HOST_NODEJS
64	string
65	default "host-nodejs-src" if BR2_PACKAGE_HOST_NODEJS_SRC
66	# default to host-nodejs-bin so it's used if nothing is set explicitly
67	default "host-nodejs-bin" if !BR2_PACKAGE_HOST_NODEJS_SRC
68