More changes to Build.PL

This commit is contained in:
Alessandro Ranellucci 2013-06-23 11:20:03 +02:00
parent 2d3fb15a3f
commit ecf4099611

View File

@ -27,18 +27,28 @@ my %recommends = qw(
Class::XSAccessor 0 Class::XSAccessor 0
Growl::GNTP 0.15 Growl::GNTP 0.15
XML::SAX::ExpatXS 0 XML::SAX::ExpatXS 0
Wx 0.9901 );
# removed:
# Wx 0.9901
my @try = (
$ENV{CPANM} // (),
File::Spec->catfile($Config{sitebin}, 'cpanm'),
File::Spec->catfile($Config{installscript}, 'cpanm'),
); );
my $cpanm; my $cpanm;
if (defined $ENV{CPANM} && -x $ENV{CPANM}) { foreach my $path (@try) {
$cpanm = $ENV{CPANM}; if (-e $path) { # don't use -x because it fails on Windows
} elsif (-x (my $c = File::Spec->catfile($Config{sitebin}, 'cpanm'))) { $cpanm = $path;
$cpanm = $c; last;
} elsif (-x (my $c = File::Spec->catfile($Config{installscript}, 'cpanm'))) { }
$cpanm = $c; }
} elsif ($^O =~ /^(?:darwin|linux)$/ && system(qw(which cpanm)) == 0) { if (!$cpanm) {
$cpanm = 'cpanm'; if ($^O =~ /^(?:darwin|linux)$/ && system(qw(which cpanm)) == 0) {
$cpanm = 'cpanm';
}
} }
die <<'EOF' die <<'EOF'
cpanm was not found. Please install it before running this script. cpanm was not found. Please install it before running this script.