void-packages/srcpkgs/nodeenv/patches/fix-i686-and-musl.patch

56 lines
2.0 KiB
Diff

--- a/tests/nodeenv_test.py
+++ b/tests/nodeenv_test.py
@@ -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
+++ b/nodeenv.py
@@ -526,8 +526,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):
@@ -1082,13 +1095,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 args.prebuilt and is_musl() and not is_x86_64_musl():
+ logger.error('No prebuilt Node.js for MUSL libc exists!')
+ exit(1)
+
if not args.node or args.node.lower() == 'latest':
args.node = get_last_stable_node_version()
elif args.node.lower() == 'lts':