Subject: | configure_requires causes installation problems |
Date: | Sun, 13 Jun 2010 14:45:49 -0700 |
To: | bug-B-Utils [...] rt.cpan.org |
From: | Father Chrysostomos <sprout [...] cpan.org> |
CPAN.pm did not start supporting configure_requires properly until
1.94_57. So the latest ‘stable’ release (1.9402) doesn’t even support
it.
This makes it hard to install B::Utils (or any other module using
configure_requires) on a new perl installation.
I’ve come up with a solution, which I believe may work all the way
back to perl 5: List the configure dependences as regular dependencies
and have the Makefile re-run Makefile.PL if necessary.
This piece of code should do it:
(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;
};
}
Then, in maybe ten years or so, you can delete it. :-)