Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Best strategy to facilitate dependency installation for a Perl-based software distribution

by hermida (Scribe)
on Nov 15, 2011 at 12:01 UTC ( [id://938149]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Best strategy to facilitate dependency installation for a Perl-based software distribution
in thread Best strategy to facilitate dependency installation for a Perl-based software distribution

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

Replies are listed 'Best First'.
Re^4: Best strategy to facilitate dependency installation for a Perl-based software distribution
by Anonymous Monk on Nov 15, 2011 at 12:37 UTC

    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

      Hello, thank you for the help and advice, I'm a bit lost and I think I need a bit more help :-( sorry. Let me start over... here's my scenario:

      The only requirement is that an install site has Perl installed and nothing else from CPAN. A site will download the software app distro into a directory $APP_HOME

      The software distro comes with all non-CORE and non-XS CPAN dependencies in $APP_HOME/extlib/lib/perl5 (which I installed via cpanm -L extlib <module>) and it's own module library in $APP_HOME/lib

      Programs in the software distro, lets say in $APP_HOME/scripts will need to use extlib and lib I imagine they would have this in at the top:

      use FindBin; use local::lib "$FindBin::Bin/../extlib"; use local::lib "$FindBin::Bin/../lib"; use My::App; use Sort::Key; ...

      I would like everything to be self-contained within the app distro, therefore no meddling with the install user's .bashrc or anything like that because of multiple reasons, one being that the install user might not be the user actually running software.

      local::lib is not in Perl CORE and I could have it already in extlib/lib/perl5 but then you have this chicken-egg problem. Or is local::lib not really what I want? I am not interested in the local::lib functionality to allow a user to have their own CPAN modules installed in their $HOME directory, I am interested in providing a software application distro with non-CORE dependencies already included and a way for the distro's programs to use these included library paths all in a self-contained manner. What is the recommended and standard way to do this in Perl?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://938149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found