New package: nodeenv-1.6.0_1.

Signed-off-by: Joseph Benden <joe@benden.us>
This commit is contained in:
Joseph Benden 2021-10-27 14:32:17 -07:00 committed by Piotr
parent 0c16a0f8dd
commit 634b0882be
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,55 @@
--- 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':

19
srcpkgs/nodeenv/template Normal file
View File

@ -0,0 +1,19 @@
# Template file for 'nodeenv'
pkgname=nodeenv
version=1.6.0
revision=1
wrksrc="nodeenv-${version}"
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="make python3-setuptools"
checkdepends="nodejs python3-coverage python3-mock python3-pytest which"
short_desc="Node.js virtual environment builder"
maintainer="Joseph Benden <joe@benden.us>"
license="BSD-3-Clause"
homepage="https://github.com/ekalinin/nodeenv"
distfiles="https://github.com/ekalinin/nodeenv/archive/${version}.tar.gz"
checksum=87b04b0832d38bd825e004e7c8ed82d75524efaa6b8a72e3a55088d93e4e17f7
post_install() {
vlicense LICENSE
}