Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

CPAN + PREFIX + Module::Build

by mdi (Acolyte)
on Jul 14, 2005 at 19:25 UTC ( [id://475019]=perlquestion: print w/replies, xml ) Need Help??

mdi has asked for the wisdom of the Perl Monks concerning the following question:

I like to install non-core modules under ~/. I've been using CPAN and setting PREFIX, et al. to do this until recently when I ran into a module that required Module::Build. Obviously, the current stable release of M::B doesn't like PREFIX and instead looks for install_base, install_path, etc.

So, my question is how do you Monks handle this sort of situation w/o a lot of fuss? I'm hoping to find a way to just set my preferences and not have to constantly muck around with them.

Replies are listed 'Best First'.
Re: CPAN + PREFIX + Module::Build
by dragonchild (Archbishop) on Jul 14, 2005 at 19:33 UTC
    Wait for the next release of M::B (coming soon) that will support PREFIX (inasmuch as EU::MM ever supported it). I started the coding and it was finished by the excellent M::B developers.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: CPAN + PREFIX + Module::Build
by ysth (Canon) on Jul 14, 2005 at 19:41 UTC
    With an up to date ExtUtils-MakeMaker and (stable) Module-Build, you should be able to use INSTALLBASE=~ instead for both. Or wait for Module-Build 0.27_02 (or get it from CVS) and use PREFIX for both. I haven't tried it myself, though.

    Update: INSTALLBASE is a flop; EU::MM has INSTALLBASE, M::B has install_base. A passthrough Makefile.PL translates the case but doesn't add the _. Also, EU::MM installs stuff into lib/perl5 (under your selected directory), while M::B uses just lib. Perhaps there's something I'm missing here...

      There's a reason why INSTALLBASE is not yet documented. MakeMaker and Module::Build are still out of sync on the behavior. MakeMaker needs to be fixed to use INSTALL_BASE to match --install_base and Module::Build has to fix it so modules go into lib/perl5/ and programs into bin/ (already fixed in the alphas).

      This should all be sorted out with Module::Build 0.28 and the next MakeMaker. While I would have liked this to happen before OSCON it doesn't look like MB's going to be ready in time.

Re: CPAN + PREFIX + Module::Build
by chromatic (Archbishop) on Jul 14, 2005 at 21:33 UTC
Re: CPAN + PREFIX + Module::Build
by dakkar (Hermit) on Jul 15, 2005 at 18:08 UTC

    I use this setup:

    export PERL5LIB=/home/dakkar/localperl:$PERL5LIB export PERL5_CPANPLUS_CONFIG=/home/dakkar/.cpanplus/config export PERL_MM_OPT='INSTALLDIRS=perl LIB=/home/dakkar/localperl/ INSTA +LLBIN=/home/dakkar/bin INSTALLSCRIPT=/home/dakkar/bin/ INSTALLMAN1DIR +=/home/dakkar/man/man1 INSTALLMAN3DIR=/home/dakkar/man/man3' function MyBuild { perl Build.PL \ --install_path lib=/home/dakkar/localperl/lib/ \ --install_path arch=/home/dakkar/localperl/lib/i686-linux-thre +ad-multi/ \ --install_path script=/home/dakkar/bin/ \ --install_path bin=/home/dakkar/bin/ \ --install_path bindoc=/home/dakkar/man/man1 \ --install_path libdoc=/home/dakkar/man/man3 \ "$@" } export MANPATH=/home/dakkar/man:$MANPATH

    This way, I have my modules in ~/localperl and scripts and manpages go in usable places. It works both with MakeMaker and Module::Build, provided you use MyBuild instead of perl Build.PL. It also has a localized CPANPLUS config, with the same parameters set per both build systems.

    -- 
            dakkar - Mobilis in mobile
    

    Most of my code is tested...

    Perl is strongly typed, it just has very few types (Dan)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://475019]
Approved by dragonchild
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-28 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found