summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py4
-rw-r--r--lib/spack/spack/modules.py5
-rw-r--r--lib/spack/spack/package.py9
3 files changed, 10 insertions, 8 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index e5d256a2e0..68477145fe 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -284,8 +284,8 @@ def setup_package(pkg):
# Allow dependencies to set up environment as well.
for dependency_spec in pkg.spec.traverse(root=False):
- dependency_spec.package.module_modifications(pkg.module, dependency_spec, pkg.spec)
- env.extend(dependency_spec.package.environment_modifications(pkg.spec))
+ dependency_spec.package.modify_module(pkg.module, dependency_spec, pkg.spec)
+ dependency_spec.package.setup_dependent_environment(env, pkg.spec)
# TODO : implement validation
#validate(env)
env.apply_modifications()
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index 7e395736e4..09895d8c44 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -162,9 +162,8 @@ class EnvModule(object):
# Environment modifications guessed by inspecting the installation prefix
env = inspect_path(self.spec.prefix)
# Package-specific environment modifications
- # FIXME : decide how to distinguish between calls done in the installation and elsewhere
- env.extend(self.spec.package.environment_modifications(None))
- # site_specific = ...`
+ self.spec.package.setup_environment(env)
+ # TODO : implement site-specific modifications and filters
if not env:
return
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 042833964a..8e56dd1f97 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -977,7 +977,7 @@ class Package(object):
fromlist=[self.__class__.__name__])
- def environment_modifications(self, dependent_spec):
+ def setup_environment(self, env):
"""
Called before the install() method of dependents.
@@ -998,9 +998,12 @@ class Package(object):
Returns:
instance of environment modifications
"""
- return EnvironmentModifications()
+ pass
+
+ def setup_dependent_environment(self, env, dependent_spec):
+ self.setup_environment(env)
- def module_modifications(self, module, spec, dependent_spec):
+ def modify_module(self, module, spec, dependent_spec):
"""
Called before the install() method of dependents.