2019-01-01 14:04:23 +08:00
|
|
|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-08-04 19:58:42 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2016-11-12 11:16:30 +08:00
|
|
|
import os
|
2016-08-04 19:58:42 +08:00
|
|
|
from spack import *
|
|
|
|
|
|
|
|
|
2017-01-19 02:34:09 +08:00
|
|
|
class Npm(AutotoolsPackage):
|
2016-08-04 19:58:42 +08:00
|
|
|
"""npm: A package manager for javascript."""
|
|
|
|
|
|
|
|
homepage = "https://github.com/npm/npm"
|
|
|
|
# base http://www.npmjs.com/
|
|
|
|
url = "https://registry.npmjs.org/npm/-/npm-3.10.5.tgz"
|
|
|
|
|
2019-10-11 13:44:41 +08:00
|
|
|
version('3.10.9', sha256='fb0871b1aebf4b74717a72289fade356aedca83ee54e7386e38cb51874501dd6')
|
|
|
|
version('3.10.5', sha256='ff019769e186152098841c1fa6325e5a79f7903a45f13bd0046a4dc8e63f845f')
|
2016-08-04 19:58:42 +08:00
|
|
|
|
2017-03-28 05:02:00 +08:00
|
|
|
depends_on('node-js', type=('build', 'run'))
|
2017-01-19 02:34:09 +08:00
|
|
|
|
2019-11-30 05:00:44 +08:00
|
|
|
def setup_dependent_build_environment(self, env, dependent_spec):
|
2016-11-12 11:16:30 +08:00
|
|
|
npm_config_cache_dir = "%s/npm-cache" % dependent_spec.prefix
|
|
|
|
if not os.path.isdir(npm_config_cache_dir):
|
|
|
|
mkdir(npm_config_cache_dir)
|
2019-11-30 05:00:44 +08:00
|
|
|
env.set('npm_config_cache', npm_config_cache_dir)
|
|
|
|
|
|
|
|
def setup_dependent_run_environment(self, env, dependent_spec):
|
|
|
|
npm_config_cache_dir = "%s/npm-cache" % dependent_spec.prefix
|
|
|
|
if not os.path.isdir(npm_config_cache_dir):
|
|
|
|
mkdir(npm_config_cache_dir)
|
|
|
|
env.set('npm_config_cache', npm_config_cache_dir)
|