also: `nvm_get_os`: set `NVM_DIR` in the OpenHarmony chroots, and skip them without a glibc x86-64 layout
`sudo` resets the environment, and `nvm.sh` returns early when it cannot detect `NVM_DIR`,
so in the chroots `nvm_get_os` was undefined and every check got an empty result.
The chroot setup needs `ldd` and `/lib64/ld-linux-x86-64.so.2`, which macOS does not have.
Co-authored-by: hqzing <hqzing@outlook.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
On SmartOS setups using 64 bits pkgsrc repositories, `nvm_get_arch`
would not handle pkg_info's output properly.
This would result in nvm not being to install any node binary when
running on SmartOS setups using a 64 bits pkgsrc repository.
This change fixes this problem, and fixes the tests suite on similar
setups.
uname on SmartOS cannot be used to guess if 32 and/or 64 bits binaries
are supported, and its output is different than other uname commands on
other operating systems.
This change uses pkg_info to determine what types of binaries pkgsrc
would install. If pkg_info fails to run or is not present, this change
falls back to using isainfo -n, which determines what the kernel
supports.
It allows users to install node binaries on Solaris derivatives. io.js
can also be installed on Solaris derivatives starting with version
v3.3.1.