diff options
author | Alfredo Adolfo Gimenez <alfredo.gimenez@gmail.com> | 2016-09-21 00:52:09 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2016-09-21 00:52:09 -0700 |
commit | 02307cf7ceabdf16d02f1afd0f38c50bd7501080 (patch) | |
tree | e79f2140fa86a888d838c08457425f25a2666a4d | |
parent | 1cc48bf7d78f592097f795a62546effd5f04d38d (diff) | |
download | spack-02307cf7ceabdf16d02f1afd0f38c50bd7501080.tar.gz spack-02307cf7ceabdf16d02f1afd0f38c50bd7501080.tar.bz2 spack-02307cf7ceabdf16d02f1afd0f38c50bd7501080.tar.xz spack-02307cf7ceabdf16d02f1afd0f38c50bd7501080.zip |
Set JAVA_HOME on module load and on dependent installs. (#1716)
* Set JAVA_HOME on module load and on dependent installs.
* Include environment setup from dependencies in dependee module (#1714)
-rw-r--r-- | lib/spack/spack/modules.py | 1 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/jdk/package.py | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py index d75bfbac45..aa3ad5843f 100644 --- a/lib/spack/spack/modules.py +++ b/lib/spack/spack/modules.py @@ -392,6 +392,7 @@ class EnvModule(object): for mod in modules: set_module_variables_for_package(package, mod) set_module_variables_for_package(package, package.module) + package.setup_environment(spack_env, env) package.setup_dependent_package(self.pkg.module, self.spec) package.setup_dependent_environment(spack_env, env, self.spec) diff --git a/var/spack/repos/builtin/packages/jdk/package.py b/var/spack/repos/builtin/packages/jdk/package.py index 63bf6514cb..bab0920434 100644 --- a/var/spack/repos/builtin/packages/jdk/package.py +++ b/var/spack/repos/builtin/packages/jdk/package.py @@ -68,3 +68,9 @@ class Jdk(Package): def install(self, spec, prefix): distutils.dir_util.copy_tree(".", prefix) + + def setup_environment(self, spack_env, run_env): + run_env.set('JAVA_HOME', self.spec.prefix) + + def setup_dependent_environment(self, spack_env, run_env, dependent_spec): + spack_env.set('JAVA_HOME', self.spec.prefix) |