From c4134ee71e43a6a2a38822e25cc72ca73efdcfea Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 23 Mar 2016 00:36:32 -0700 Subject: Fix #608: broken numpy build. - Failed to catch all instances of modify_module when it was renamed to setup_dependent_package. - Refactored remaining modify_module calls. - Also modified Python's setup_dependent_package slightly: only creates empty site-packages directory for Python extensions now, not for all dependents. --- var/spack/repos/builtin/packages/python/package.py | 11 ++++++----- var/spack/repos/builtin/packages/ruby/package.py | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'var') 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') """ # 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')) -- cgit v1.2.3-70-g09d2