summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-02-27 14:00:46 +0100
committerGitHub <noreply@github.com>2019-02-27 14:00:46 +0100
commit7eec038690779325d6e36d7b88a4c960d290735a (patch)
tree958c440ec3e28efdadc616619b318defc47871b2
parent5efff5d2fcb784803576ee20c817c7aa05b94f4e (diff)
downloadspack-7eec038690779325d6e36d7b88a4c960d290735a.tar.gz
spack-7eec038690779325d6e36d7b88a4c960d290735a.tar.bz2
spack-7eec038690779325d6e36d7b88a4c960d290735a.tar.xz
spack-7eec038690779325d6e36d7b88a4c960d290735a.zip
Update environment-modules package (#10717)
The environment modules package has been updated to include versions up to 4.0.0. The url of the package and the homepage have been updated accordingly. The `spack bootstrap` command now builds version 3.2.10 of the environment-modules package, and will do until #10708 is fixed.
-rw-r--r--lib/spack/spack/cmd/bootstrap.py2
-rw-r--r--var/spack/repos/builtin/packages/environment-modules/package.py90
2 files changed, 60 insertions, 32 deletions
diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py
index 593b581c30..f6464f97b8 100644
--- a/lib/spack/spack/cmd/bootstrap.py
+++ b/lib/spack/spack/cmd/bootstrap.py
@@ -46,7 +46,7 @@ def bootstrap(parser, args, **kwargs):
# Define requirement dictionary defining general specs which need
# to be satisfied, and the specs to install when the general spec
# isn't satisfied.
- requirement_dict = {'environment-modules': 'environment-modules~X'}
+ requirement_dict = {'environment-modules': 'environment-modules@3.2.10~X'}
for requirement in requirement_dict:
installed_specs = spack.store.db.query(requirement)
diff --git a/var/spack/repos/builtin/packages/environment-modules/package.py b/var/spack/repos/builtin/packages/environment-modules/package.py
index 4da5b4abbd..c7fef5f1c5 100644
--- a/var/spack/repos/builtin/packages/environment-modules/package.py
+++ b/var/spack/repos/builtin/packages/environment-modules/package.py
@@ -3,64 +3,92 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-from spack import *
-import os
+import os.path
class EnvironmentModules(Package):
"""The Environment Modules package provides for the dynamic
- modification of a user's environment via modulefiles."""
+ modification of a user's environment via module files.
+ """
- homepage = "https://sourceforge.net/p/modules/wiki/Home/"
- url = "http://prdownloads.sourceforge.net/modules/modules-3.2.10.tar.gz"
+ homepage = 'https://cea-hpc.github.io/modules/'
+ url = 'https://github.com/cea-hpc/modules/releases/download/v4.2.2/modules-4.2.2.tar.gz'
- version('3.2.10', '8b097fdcb90c514d7540bb55a3cb90fb')
+ maintainers = ['xdelaruelle']
+
+ version('4.2.2', sha256='481fe8d03eec6806c1b401d764536edc2c233ac9d82091a10094de6101867afc')
+ version('4.2.1', sha256='c796ea6a03e22d63886ca9ec6b1bef821e8cb09f186bd007f63653e31e9cb595')
+ version('4.2.0', sha256='d439dfa579a633108c4f06574ed9bc3b91b8610d2ce3a6eb803bf377d0284be7')
+ version('4.1.4', sha256='965b6056ea6b72b87d9352d4c1db1d7a7f9f358b9408df2689d823b932d6aa7f')
+ version('4.1.3', sha256='dab82c5bc20ccea284b042d6af4bd6eaba95f4eaadd495a75413115d33a3151f')
+ version('4.1.2', sha256='d1f54f639d1946aa1d7ae8ae03752f8ac464a879c14bc35e63b6a87b8a0b7522')
+ version('4.1.1', sha256='998e9cc936045b4e84f28ca60c4680c08385a210d6bb95fc31c28a7d634a9357')
+ version('4.1.0', sha256='d98aa369219bf0a4ec41efe7cb8d1127d34cb07666088dd79da6b424196d4cfd')
+ version('4.0.0', sha256='f0ab7f6a747863cb980681a904a3c9380e2e52de6eb046cfa285e5e225f9ac47')
+ version(
+ '3.2.10', sha256='fb05c82a83477805a1d97737a9f0ca0db23f69b7bce504f1609ba99477b03955',
+ url='http://prdownloads.sourceforge.net/modules/modules-3.2.10.tar.gz'
+ )
variant('X', default=True, description='Build with X functionality')
# Dependencies:
depends_on('tcl', type=('build', 'link', 'run'))
+ depends_on('tcl@8.4:', type=('build', 'link', 'run'), when='@4.0.0:')
def install(self, spec, prefix):
- tcl_spec = spec['tcl']
-
- # We are looking for tclConfig.sh
- tcl_config_name = 'tclConfig.sh'
- tcl_config_dir_options = [tcl_spec.prefix.lib,
- tcl_spec.prefix.lib64]
-
- tcl_config_found = False
- for tcl_config_dir in tcl_config_dir_options:
- tcl_config_found = os.path.exists(
- join_path(tcl_config_dir, tcl_config_name))
- if tcl_config_found:
- break
-
- if not tcl_config_found:
- raise InstallError('Failed to locate ' + tcl_config_name)
+ tcl = spec['tcl']
- # See: https://sourceforge.net/p/modules/bugs/62/
- cpp_flags = ['-DUSE_INTERP_ERRORLINE']
+ # Determine where we can find tclConfig.sh
+ for tcl_lib_dir in [tcl.prefix.lib, tcl.prefix.lib64]:
+ tcl_config_file = os.path.join(tcl_lib_dir, 'tclConfig.sh')
+ if os.path.exists(tcl_config_file):
+ break
+ else:
+ raise InstallError('Failed to locate tclConfig.sh')
config_args = [
+ "--prefix=" + prefix,
"--without-tclx",
"--with-tclx-ver=0.0",
- "--prefix=" + prefix,
# It looks for tclConfig.sh
- "--with-tcl=" + tcl_config_dir,
- "--with-tcl-ver=%d.%d" % (
- tcl_spec.version.version[0], tcl_spec.version.version[1]),
- '--disable-debug',
+ "--with-tcl=" + tcl_lib_dir,
+ "--with-tcl-ver={0}.{1}".format(*tcl.version.version[0:2]),
'--disable-dependency-tracking',
'--disable-silent-rules',
'--disable-versioning',
- '--datarootdir=' + prefix.share,
- 'CPPFLAGS=' + ' '.join(cpp_flags)
+ '--datarootdir=' + prefix.share
]
if '~X' in spec:
config_args = ['--without-x'] + config_args
+ if '@4.2.0:' in self.spec:
+ config_args.extend([
+ '--enable-auto-handling'
+ ])
+
+ if '@4.1.0:' in self.spec:
+ config_args.extend([
+ # Variables in quarantine are empty during module command
+ # start-up and they will be restored to the value they had
+ # in the environment once the command starts
+ '--with-quarantine-vars=LD_LIBRARY_PATH'
+ ])
+
+ if '@4.0.0:' in self.spec:
+ config_args.extend([
+ '--disable-compat-version',
+ '--with-tclsh={0}'.format(tcl.prefix.bin.tclsh)
+ ])
+
+ if '@3.2.10' in self.spec:
+ # See: https://sourceforge.net/p/modules/bugs/62/
+ config_args.extend([
+ '--disable-debug',
+ 'CPPFLAGS=-DUSE_INTERP_ERRORLINE'
+ ])
+
configure(*config_args)
make()
make('install')