http://www.perlmonks.org?node_id=937838


in reply to Best strategy to facilitate dependency installation for a Perl-based software distribution

Ok so I've gone the route of including all non-CORE and non-XS dependencies bundled in an extlib in my distribution to make things as easy as possible for people trying to install the software, looks to be a good way.

When I started building the extlib in my development environment using cpanm -L extlib <module> etc I realized that cpanm installs everything in a local::lib compatible way, meaning everything doesn't go starting at extlib but rather extlib/lib/perl5. Therefore I would have to use local::lib "$FindBin::Bin/../extlib" in my programs instead of use lib "$FindBin::Bin/../extlib" to get use the dependencies in extlib but this brings a chicken-or-egg problem, local::lib in not in CORE :-(

Is there something I'm not thinking right here? I don't want to make to have to make an external dependency that people have local::lib already installed in their Perl tree (which could require administrator access)

  • Comment on Re: Best strategy to facilitate dependency installation for a Perl-based software distribution
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Best strategy to facilitate dependency installation for a Perl-based software distribution
by Anonymous Monk on Nov 14, 2011 at 02:51 UTC

    Is there something I'm not thinking right here?

    I think so :)

    If the route you have chosen is to bundle all non-CORE dependencies, and local::lib is not core, why can't you bundle local::lib?

      Sorry if I wasn't clear, its because one needs to use local::lib "$FindBin::Bin/../extlib" to be able to include and use these bundled dependencies therefore local::lib cannot be bundled

        Sorry if I wasn't clear, its because one needs to use local::lib "$FindBin::Bin/../extlib" to be able to include and use these bundled dependencies therefore local::lib cannot be bundled

        ??

        Maybe you want to study local::lib a little closer?

        $ perl Makefile.PL purchasing clue ... Checking if your kit is complete... Looks good Writing Makefile for ... Writing MYMETA.yml and MYMETA.json $ make test ... $ make install ... Installing /home/username/perl5/lib/perl5/bin/clue $ cat /home/username/perl5/lib/perl5/bin/clue #!/usr/bin/perl -- use lib '/home/username/perl5/lib/perl5/i386-linux', '/home/username/perl5/lib/perl5', ; use MyClues; MyClues->run; __END__ $ perl -I$HOME/perl5/lib/perl5 -Mlocal::lib -e 1 export PERL_MB_OPT='--install_base /home/username/perl5' export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5' export PERL5LIB='/home/username/perl5/lib/perl5/i386-linux:/home/use +rname/perl5/lib/perl5' export PATH="/home/username/perl5/bin:$PATH" $ echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc

        Now this clue preparation can be generating scripts/clue from template, it can "bootstrapping" local::lib, or instructing your users to append to bashrc

        I don't see a problem