56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
--- a/tests/nodeenv_test.py.orig 2021-04-09 01:10:31.000000000 -0700
|
|
+++ b/tests/nodeenv_test.py 2021-11-06 15:08:23.169976189 -0700
|
|
@@ -108,7 +108,7 @@ def test_mirror_option():
|
|
('',
|
|
'https://nodejs.org/download/release/index.json')]
|
|
sys_type = sysconfig.get_config_var('HOST_GNU_TYPE')
|
|
- musl_type = ['x86_64-pc-linux-musl', 'x86_64-unknown-linux-musl']
|
|
+ musl_type = ['x86_64-pc-linux-musl', 'x86_64-unknown-linux-musl', 'i686-pc-linux-gnu', 'armv6l-unknown-linux-gnueabi']
|
|
# Check if running on musl system and delete last mirror if it is
|
|
if sys_type in musl_type:
|
|
urls.pop()
|
|
--- a/nodeenv.py.orig 2021-04-09 01:10:31.000000000 -0700
|
|
+++ b/nodeenv.py 2021-12-06 12:55:47.748645252 -0700
|
|
@@ -510,8 +510,21 @@ def get_root_url(version):
|
|
return src_base_url
|
|
|
|
|
|
+def is_armv6l_linux():
|
|
+ return sysconfig.get_config_var('HOST_GNU_TYPE') == 'armv6l-unknown-linux-gnueabi'
|
|
+
|
|
+
|
|
+def is_i686_linux():
|
|
+ return sysconfig.get_config_var('HOST_GNU_TYPE') == 'i686-pc-linux-gnu'
|
|
+
|
|
+
|
|
+def is_musl():
|
|
+ return str(sysconfig.get_config_var('HOST_GNU_TYPE')).endswith('-musl')
|
|
+
|
|
+
|
|
def is_x86_64_musl():
|
|
- return sysconfig.get_config_var('HOST_GNU_TYPE') == 'x86_64-pc-linux-musl'
|
|
+ return sysconfig.get_config_var('HOST_GNU_TYPE') == 'x86_64-pc-linux-musl' or \
|
|
+ sysconfig.get_config_var('HOST_GNU_TYPE') == 'x86_64-unknown-linux-musl'
|
|
|
|
|
|
def get_node_bin_url(version):
|
|
@@ -1057,13 +1070,17 @@ def main():
|
|
else:
|
|
src_domain = opt.mirror
|
|
# use unofficial builds only if musl and no explicitly chosen mirror
|
|
- elif is_x86_64_musl():
|
|
+ elif is_x86_64_musl() or is_armv6l_linux() or is_i686_linux():
|
|
src_domain = 'unofficial-builds.nodejs.org'
|
|
else:
|
|
src_domain = 'nodejs.org'
|
|
if src_base_url is None:
|
|
src_base_url = 'https://%s/download/release' % src_domain
|
|
|
|
+ if opt.prebuilt and is_musl() and not is_x86_64_musl():
|
|
+ logger.error('No prebuilt Node.js for MUSL libc exists!')
|
|
+ exit(1)
|
|
+
|
|
if not opt.node or opt.node.lower() == 'latest':
|
|
opt.node = get_last_stable_node_version()
|
|
elif opt.node.lower() == 'lts':
|