@@ -165,25 +165,43 @@ def install_cpanm(self):
165165 make ()
166166 make ('install' )
167167
168- def setup_dependent_environment (self , spack_env , run_env , dependent_spec ):
168+ def setup_dependent_build_environment (self , env , dependent_spec ):
169169 """Set PATH and PERL5LIB to include the extension and
170170 any other perl extensions it depends on,
171171 assuming they were installed with INSTALL_BASE defined."""
172- perl_lib_dirs = []
173- perl_bin_dirs = []
172+ perl_lib_dirs = [join_path (self .spec .prefix .lib ,
173+ str (self .spec .version ))]
174+ perl_bin_dirs = [self .spec .prefix .bin ]
174175 for d in dependent_spec .traverse (
175176 deptype = ('build' , 'run' ), deptype_query = 'run' ):
176177 if d .package .extends (self .spec ):
177178 perl_lib_dirs .append (d .prefix .lib .perl5 )
178179 perl_bin_dirs .append (d .prefix .bin )
179180 if perl_bin_dirs :
180181 perl_bin_path = ':' .join (perl_bin_dirs )
181- spack_env .prepend_path ('PATH' , perl_bin_path )
182- run_env .prepend_path ('PATH' , perl_bin_path )
182+ env .prepend_path ('PATH' , perl_bin_path )
183183 if perl_lib_dirs :
184184 perl_lib_path = ':' .join (perl_lib_dirs )
185- spack_env .prepend_path ('PERL5LIB' , perl_lib_path )
186- run_env .prepend_path ('PERL5LIB' , perl_lib_path )
185+ env .prepend_path ('PERL5LIB' , perl_lib_path )
186+
187+ def setup_dependent_run_environment (self , env , dependent_spec ):
188+ """Set PATH and PERL5LIB to include the extension and
189+ any other perl extensions it depends on,
190+ assuming they were installed with INSTALL_BASE defined."""
191+ perl_lib_dirs = [join_path (self .spec .prefix .lib ,
192+ str (self .spec .version ))]
193+ perl_bin_dirs = [self .spec .prefix .bin ]
194+ for d in dependent_spec .traverse (
195+ deptype = ('run' ,), deptype_query = 'run' ):
196+ if d .package .extends (self .spec ):
197+ perl_lib_dirs .append (d .prefix .lib .perl5 )
198+ perl_bin_dirs .append (d .prefix .bin )
199+ if perl_bin_dirs :
200+ perl_bin_path = ':' .join (perl_bin_dirs )
201+ env .prepend_path ('PATH' , perl_bin_path )
202+ if perl_lib_dirs :
203+ perl_lib_path = ':' .join (perl_lib_dirs )
204+ env .prepend_path ('PERL5LIB' , perl_lib_path )
187205
188206 def setup_dependent_package (self , module , dependent_spec ):
189207 """Called before perl modules' install() methods.
0 commit comments