summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/modules.py4
-rw-r--r--lib/spack/spack/preferred_packages.py4
-rw-r--r--var/spack/repos/builtin/packages/python/package.py11
-rw-r--r--var/spack/repos/builtin/packages/ruby/package.py6
4 files changed, 14 insertions, 11 deletions
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index 05c93cd3e6..8ed98e5d38 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -160,8 +160,8 @@ class EnvModule(object):
# package-specific modifications
for extendee in self.pkg.extendees:
extendee_spec = self.spec[extendee]
- extendee_spec.package.modify_module(
- self.pkg.module, extendee_spec, self.spec)
+ extendee_spec.package.setup_dependent_package(
+ self.pkg.module, self.spec)
# Package-specific environment modifications
spack_env = EnvironmentModifications()
diff --git a/lib/spack/spack/preferred_packages.py b/lib/spack/spack/preferred_packages.py
index 4d8526c75f..f0a5382dc9 100644
--- a/lib/spack/spack/preferred_packages.py
+++ b/lib/spack/spack/preferred_packages.py
@@ -150,7 +150,9 @@ class PreferredPackages(object):
def version_compare(self, pkgname, a, b):
"""Return less-than-0, 0, or greater than 0 if version a of pkgname is
respecively less-than, equal-to, or greater-than version b of pkgname.
- One version is less-than another if it is preferred over the other."""
+ Versions marked 'preferred=True' in package.py take precedence over any
+ versions not marked preferred.
+ """
return self._spec_compare(pkgname, 'version', a, b, True, None)
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 4f55bc803e..6d9030805b 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -108,7 +108,7 @@ class Python(Package):
run_env.set('PYTHONPATH', pythonpath)
- def modify_module(self, module, spec, ext_spec):
+ def setup_dependent_package(self, module, ext_spec):
"""
Called before python modules' install() methods.
@@ -118,17 +118,18 @@ class Python(Package):
"""
# Python extension builds can have a global python executable function
if self.version >= Version("3.0.0") and self.version < Version("4.0.0"):
- module.python = Executable(join_path(spec.prefix.bin, 'python3'))
+ module.python = Executable(join_path(self.spec.prefix.bin, 'python3'))
else:
- module.python = Executable(join_path(spec.prefix.bin, 'python'))
+ module.python = Executable(join_path(self.spec.prefix.bin, 'python'))
# Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs.
module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir)
module.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir)
module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir)
- # Make the site packages directory if it does not exist already.
- mkdirp(module.site_packages_dir)
+ # Make the site packages directory for extensions, if it does not exist already.
+ if ext_spec.package.is_extension:
+ mkdirp(module.site_packages_dir)
# ========================================================================
# Handle specifics of activating and deactivating python modules.
diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py
index 7ff1898ce9..e13677e4d2 100644
--- a/var/spack/repos/builtin/packages/ruby/package.py
+++ b/var/spack/repos/builtin/packages/ruby/package.py
@@ -30,7 +30,7 @@ class Ruby(Package):
# The actual installation path for this gem
spack_env.set('GEM_HOME', extension_spec.prefix)
- def modify_module(self, module, spec, ext_spec):
+ def setup_dependent_package(self, module, ext_spec):
"""Called before ruby modules' install() methods. Sets GEM_HOME
and GEM_PATH to values appropriate for the package being built.
@@ -39,5 +39,5 @@ class Ruby(Package):
gem('install', '<gem-name>.gem')
"""
# Ruby extension builds have global ruby and gem functions
- module.ruby = Executable(join_path(spec.prefix.bin, 'ruby'))
- module.gem = Executable(join_path(spec.prefix.bin, 'gem'))
+ module.ruby = Executable(join_path(self.spec.prefix.bin, 'ruby'))
+ module.gem = Executable(join_path(self.spec.prefix.bin, 'gem'))