summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2019-11-29 04:30:40 -0700
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-11-29 12:30:40 +0100
commitcacfc3a6e1c79520087455a0831a567ad6fb3486 (patch)
tree03ed612a71f692961a87324ea99cbccdab7ecec9 /var
parent4dca63f0072da08c537b133f1e37dd9ddab8ba9a (diff)
downloadspack-cacfc3a6e1c79520087455a0831a567ad6fb3486.tar.gz
spack-cacfc3a6e1c79520087455a0831a567ad6fb3486.tar.bz2
spack-cacfc3a6e1c79520087455a0831a567ad6fb3486.tar.xz
spack-cacfc3a6e1c79520087455a0831a567ad6fb3486.zip
Handle external perl (#13903)
* dont add perl bin directory to PATH when setting up env (this is already handled by spack core in a way that omits system dirs); also consolidate repeated logic between build/run env setup. * the bin/ dir of each dependency is already added to PATH in Spack core, so there is no need to do this in the Perl package
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/perl/package.py35
1 files changed, 8 insertions, 27 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py
index 5df5692895..547699fc03 100644
--- a/var/spack/repos/builtin/packages/perl/package.py
+++ b/var/spack/repos/builtin/packages/perl/package.py
@@ -165,43 +165,24 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
make()
make('install')
- def setup_dependent_build_environment(self, env, dependent_spec):
+ def _setup_dependent_env(self, env, dependent_spec, deptypes):
"""Set PATH and PERL5LIB to include the extension and
any other perl extensions it depends on,
assuming they were installed with INSTALL_BASE defined."""
- perl_lib_dirs = [join_path(self.spec.prefix.lib,
- str(self.spec.version))]
- perl_bin_dirs = [self.spec.prefix.bin]
- for d in dependent_spec.traverse(
- deptype=('build', 'run'), deptype_query='run'):
+ perl_lib_dirs = []
+ for d in dependent_spec.traverse(deptype=deptypes):
if d.package.extends(self.spec):
perl_lib_dirs.append(d.prefix.lib.perl5)
- perl_bin_dirs.append(d.prefix.bin)
- if perl_bin_dirs:
- perl_bin_path = ':'.join(perl_bin_dirs)
- env.prepend_path('PATH', perl_bin_path)
if perl_lib_dirs:
perl_lib_path = ':'.join(perl_lib_dirs)
env.prepend_path('PERL5LIB', perl_lib_path)
+ def setup_dependent_build_environment(self, env, dependent_spec):
+ self._setup_dependent_env(env, dependent_spec,
+ deptypes=('build', 'run'))
+
def setup_dependent_run_environment(self, env, dependent_spec):
- """Set PATH and PERL5LIB to include the extension and
- any other perl extensions it depends on,
- assuming they were installed with INSTALL_BASE defined."""
- perl_lib_dirs = [join_path(self.spec.prefix.lib,
- str(self.spec.version))]
- perl_bin_dirs = [self.spec.prefix.bin]
- for d in dependent_spec.traverse(
- deptype=('run',), deptype_query='run'):
- if d.package.extends(self.spec):
- perl_lib_dirs.append(d.prefix.lib.perl5)
- perl_bin_dirs.append(d.prefix.bin)
- if perl_bin_dirs:
- perl_bin_path = ':'.join(perl_bin_dirs)
- env.prepend_path('PATH', perl_bin_path)
- if perl_lib_dirs:
- perl_lib_path = ':'.join(perl_lib_dirs)
- env.prepend_path('PERL5LIB', perl_lib_path)
+ self._setup_dependent_env(env, dependent_spec, deptypes=('run',))
def setup_dependent_package(self, module, dependent_spec):
"""Called before perl modules' install() methods.