2

I've customized a Module::Build script to install files from a perllib/ directory in my sandbox to perl/ in the target directory.

# Install perllib
$build->add_build_element("perllib");
$build->install_path(perllib => "$install_base/perl");

When I run ./Build test, Perl can't find the files under blib/ because it doesn't know that that these perllib files belong on @INC.

Is it possible to add the custom perllib directory to the installation, in such a way that the build system understands that they're Perl files, which should be included when we run tests?

ajwood
  • 18,227
  • 15
  • 61
  • 104
  • What is the goal of keeping these files separate from the `lib` directory? – cjm Aug 10 '15 at 21:58
  • It's to conform with a custom system that we've been using to manage multiple installations. Eventually, I'd like to update it to use more a more standard installation tree, but so far it's been easier to update the build scripts. – ajwood Aug 10 '15 at 22:27
  • Oh, can I keep a more standard sandbox to fix my testing issue, and somehow coerce Module::Build to install it in a non-standard place? – ajwood Aug 10 '15 at 22:38
  • `PERL_MB_OPT` env var to tell M::B where to install it, and `PERL5LIB` to tell Perl where to look. – ikegami Aug 10 '15 at 23:03
  • `PERL5LIB` has been my testing workaround.. I figure M::B should be able to figure it out on it's own though – ajwood Aug 10 '15 at 23:05

1 Answers1

0

There isn't a good reason to keep this perllib/ directory in the module. I renamed it to lib/ and customized its installation location.

my $build = Module::Build->new();
$build->install_base_relpaths(lib => 'perl');
ajwood
  • 18,227
  • 15
  • 61
  • 104