Subject: | configure_requires problems |
Date: | Sun, 23 May 2010 14:21:11 -0700 |
To: | bug-DBD-SQLite [...] rt.cpan.org |
From: | Father Chrysostomos <sprout [...] cpan.org> |
When using the latest ‘stable’ CPAN.pm (1.9402), I get this message:
DBI 1.57 is required to configure this module, please install it or
upgrade your CPAN/CPANPLUS shell
So I try this:
cpan[1]> install CPAN
CPAN is up to date (1.9402).
One has to have the latest *dev* release of CPAN.pm (1.94_56) for
configure_requires to work. But even that has problems (see <http://rt.cpan.org/Ticket/Display.html?id=57788
Show quoted text
>).
So, basically, any distribution that either relies on
configure_requires or has listed under configure_requires a module
that is also a run-time prerequisite is going to have installation
problems.
I think the best solution is to stop using configure_requires for now
(until 5.14 is the earliest version of perl you are willing to
support) and to use something like this instead, which probably works
all the way back to perl 5:
(in Makefile.PL:)
my $recursive = $ARGV[0] eq 'recursive' && shift;
if( ... the configure dependencies have not been met ... ) {
if($recursive) {
die <<"end"
Such and such is required to configure this module. Please install it
and re-run $0.
end
}
package MY;
*top_targets = sub {
my $inherited = SUPER'top_targets{shift}@'_;
my $mpl_args = join " ", map qq["$_"], @ARGV;
$inherited
=~ s<^(all\s*::.*?(\r?\n))><
$1
."\t\$(PERLRUN) Makefile.PL recursive $mpl_args$2"
."\t\$(MAKE) \$(PASTHRU)$2"
Show quoted text >me;
$inherited;
};
}
(P.S.: In that error message that Makefile.PL currently emits, you
have two independent clauses joined with a comma. It should be a
semicolon or a fullstop. Also, there is a fullstop missing at the end.)