implement spack external find for node-js

This commit is contained in:
Danny McClanahan
2022-04-20 15:16:56 +00:00
parent b9bedba68c
commit 2487a75422

View File

@@ -60,6 +60,8 @@ class NodeJs(Package):
depends_on('openssl@1.1:', when='@10:+openssl')
depends_on('zlib', when='+zlib')
executables = ['node']
phases = ['configure', 'build', 'install']
# https://github.com/spack/spack/issues/19310
@@ -67,6 +69,19 @@ class NodeJs(Package):
msg="fails to build with gcc 4.8 "
"(see https://github.com/spack/spack/issues/19310")
@classmethod
def determine_version(cls, exe_path):
try:
exe = Executable(exe_path)
output = exe('--version', output=str, error=str)
if not output.startswith('v'):
return None
return Version(output[1:])
except spack.util.executable.ProcessError:
pass
return None
def setup_build_environment(self, env):
# Force use of experimental Python 3 support
env.set('PYTHON', self.spec['python'].command.path)