in reply to Re^3: Clean smoke-test install for Inline based modules using Inline::MakeMaker
in thread Clean smoke-test install for Inline based modules using Inline::MakeMaker

Hammered? Its much ado about nothing

SmokeTesters Complain of Missing Dependencies Which a Module's Makefile.PL Requires

http://wiki.cpantesters.org/wiki/CPANAuthorNotes

#!/usr/bin/perl -- BEGIN { unless( eval { require Inline::MakeMaker; 1; } ){ warn "Warning: prerequisite Inline::MakeMaker 0 not found.\n"; exit 0; } }

#!/usr/bin/perl -- use ExtUtils::MakeMaker(); if( eval { require Inline::MakeMaker; 1; } ) { *WriteMakefile = \Inline::MakeMaker::WriteMakefile; } else { *WriteMakefile = \&ExtUtils::MakeMaker::WriteMakefile; } WriteMakefile( ... PREREQ_PM => { 'Inline::CPP' => 0.33, 'Inline::MakeMaker' => 0, ... }, )

But its a whole bunch of effort to avoid some Makefile.PL boilerplate (the essence of Inline::MakeMaker), or switching to Module::Install

Replies are listed 'Best First'.
Re^5: Clean smoke-test install for Inline based modules using Inline::MakeMaker
by syphilis (Archbishop) on Dec 15, 2011 at 10:10 UTC
    Hammered? Its much ado about nothing

    Yeah, I feel much the same way - but I have some respect for the wishes of those who expect their modules to build straight out of the box in the cpan shell, no failures and no NA/UNKNOWN.

    The problem with your BEGIN{} block is that it doesn't tell the cpan shell to fetch and install the package that contains Inline::MakeMaker. If it was *my* module, that wouldn't bother me in the slightest, but many people expect better.

    The second attempt looks promising - it might even provide the desired behaviour. (Does it ? The thing is that, when it comes to finally build the module, it's Inline::MakeMaker, not ExtUtils::MakeMaker, that needs to be loaded by the Makefile.PL.)
    There's actually no need to specify Inline::MakeMaker in PREREQ_PM, as installing Inline::CPP will install Inline::MakeMaker.
    I think that might actually work !!

    But its a whole bunch of effort to avoid ... switching to Module::Install

    And well worth the effort, imo. (But, again, this is not necessarily a view shared by the perl community at large.)

    Cheers,
    Rob

      The second attempt looks promising - it might even provide the desired behaviour. (Does it ? ...

      AFAIK it should, I'm 90% that it will, but if it doesn't, this ought to fix it (should force make to rerun Makefile.PL with Inline::MakeMaker )

      END { if( not exist $INC{'Inline/MakeMaker.pm'} ){ $atime = $mtime = time + 10 ; utime $atime, $mtime, 'Makefile.PL'; } }