logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: [Module::Build] ./Build diff: msg#00052

Subject: Re: [Module::Build] ./Build diff
nice, thanks Ken.

* Ken Williams <ken@xxxxxxxxxxxxx> [2004-07-29 22:47:32 -0500]:

> Hi Kevin,
> 
> You can do this a bit more cleanly using subclassing:
> 
> 
>     my $package = Module::Build->subclass(code => <<'EOF');
>       sub ACTION_diff {
>         my $self = shift;
>         local @INC = ($self->install_destination('lib'), @INC);
>         $self->SUPER::ACTION_diff(@_);
>       }
>     EOF
> 
>     my $build = $package->new
>         (
>         module_name => 'My::Package',
>         license     => 'perl',
>         dist_version => '0.3',
>         requires    => {
>             'Test::More'  => '0.1',
>             'HTML::Mason'  => '1.12',
>         },
>         install_base => '/some/random/path',  # like PREFIX= in perl 
> Makefile.PL
>         add_to_cleanup => [],
>         );
>     $build->create_build_script;
> 
> 
> The fix I incorporate into Module::Build itself will probably look 
> something like this.
> 
>  -Ken
> 
> 
> On Jul 28, 2004, at 8:21 AM, Kevin Baker wrote:
> >I ended up doing this. But, then to save having to remember this
> >each time I added it to the BuilD.PL script. Which now adds the
> >path to @INC if it is not there.
> >
> >    use strict;
> >    use Module::Build;
> >
> >
> >    use constant INSTALL_DIR => '/some/random/path';
> >
> >    BEGIN {
> >        # force the INSTALL_DIR onto the perl @INC. it is in a 
> >non-standard
> >        # place so we need this extra help to save programmer sanity.
> >        my $INSTALL_DIR = &INSTALL_DIR."/lib";
> >        if (-d $INSTALL_DIR) {
> >            my $found = 0;
> >            foreach my $inc_path (@INC) {
> >                $found = 1 if $inc_path =~ m#^$INSTALL_DIR#;
> >            }
> >            unshift @INC, $INSTALL_DIR unless $found;
> >        }
> >    }
> >
> >    # show the @INC to the user
> >    use Data::Dumper 'Dumper';
> >    warn "\@INC = ".Dumper(\@INC)."\n";
> >
> >
> >
> >    my $build = Module::Build->new
> >        (
> >        module_name => 'My::Package',
> >        license     => 'perl',
> >        dist_version => '0.3',
> >        requires    => {
> >            'Test::More'  => '0.1',
> >            'HTML::Mason'  => '1.12',
> >        },
> >        install_base => &INSTALL_DIR,      # like PREFIX= in perl 
> >Makefile.PL
> >        add_to_cleanup => [],
> >        );
> >    $build->create_build_script;
> >
> >
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
> one more big change to announce. We are now OSTG- Open Source Technology
> Group. Come see the changes on the new OSTG site. www.ostg.com
> _______________________________________________
> Module-build-general mailing list
> Module-build-general@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/module-build-general

-- 
Kevin Baker                                               RIPE NCC x313



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com


<Prev in Thread] Current Thread [Next in Thread>