App-MechaCPAN
view release on metacpan or search on metacpan
lib/App/MechaCPAN/Perl.pm view on Meta::CPAN
}
}
my ( $src_tz, $version ) = _get_targz( $src // $pv_ver, $opts );
my $bin_tz;
if ( ref $src_tz eq 'ARRAY' )
{
( $bin_tz, $src_tz ) = @$src_tz;
}
# If _get_targz couldn't find a version, guess based on the file
if ( !$version && $src_tz =~ m($perl5_ver_re [^/]* $)xms )
{
my $major = $1;
my $minor = $2;
$version = "5.$major.$minor";
info("Looks like $src_tz is perl $version, assuming that's true");
}
local $JOBS = $opts->{jobs} // $JOBS;
lib/App/MechaCPAN/Perl.pm view on Meta::CPAN
}
sub _get_targz
{
my $src = shift;
my $opts = shift;
# If there's no src, find the newest version.
if ( !defined $src )
{
# Do a terrible job of guessing what the current version is
use Time::localtime;
my $year = localtime->year() + 1900;
# 5.12 was released in 2010, and approximatly every May, a new even
# version was released
my $major = ( $year - 2010 ) * 2 + ( localtime->mon < 4 ? 10 : 12 );
# Verify our guess
{
my $dnld = _dnld_url( $major, 0 ) . ".md5.txt";
my $contents = '';
my $where = eval { fetch_file( $dnld => \$contents ) };
if ( !defined $where && $major > 12 )
{
$major -= 2;
redo;
}
lib/App/MechaCPAN/Perl.pm view on Meta::CPAN
=item * If the parameter is a file, it will try to use that file as an archive to install perl.
=item * If the parameter looks like a URL, it will fetch that URL and try to use it as an archive to install perl.
=item * If the parameter is a major version (5.XX), it will attempt to download and install the newest minor version of that major version.
=item * If the parameter is a minor version (5.XX.X), it will attempt to download and install that exact version.
=back
In the cases where a version is given, and the C<--no-source-only> option is given, C<App::MechaCPAN::Perl> will attempt to download a binary archive prebuilt for the operating system. This guess is made by looking at how the currently executing L<pe...
After an archive is retrieved, it will be checked to see if it is a binary or source package. This is accomplished by checking for an executable C<bin/perl> file in the archive. Basic tests are ran to make sure the binary is usable, notably by runnin...
=head2 Arguments
=head3 source-only
By default a source archive is attempted to be retreived and installed. If you want it to attempt to also retrieve a binary archive, you can use C<--no-source-only>. If you do not want C<App::MechaCPAN::Perl> to even attempt to use a binary archive, ...
=head3 threads
By default, perl is compiled without threads. If you'd like to enable threads, use this argument.
=head3 shared-lib
By default, perl will not generate a libperl.a file. If you need libperl.so, then use this argument.
=head3 jobs
How many make jobs to use when running make. The code will guess if C<make> supports running multiple jobs, and as such, it may not work for all versions of make. Defaults to 2.
=head3 skip-tests
Test for perl are ran by default. If you are sure that the tests will pass and you want to save some time, you can skip the testing phase with this option.
=head3 smart-tests
As an alternative to telling C<App::MechaCPAN::Perl> to use tests or not, C<App::MechaCPAN::Perl> can try to be clever and guess if it needs to run tests. If there is a C<.perl-version> file and it is the same version that is being installed, then te...
C<smart-tests> are off by default, but are enabled by L<App::MechaCPAN::Deploy> when there is a C<cpanfile.snapshot> file. See L<App::MechaCPAN::Install/smart-tests>.
=head3 skip-local
Since perl and modules will be installed by L<App::MechaCPAN> into C<local/>, by default C<local/> will be added to C<@INC>. This means that if you use the C<local/> installed perl you do not need to use L<local::lib> or other C<@INC> tricks. If you ...
=head3 skip-lib
If a C<lib/> directory exists in the same directory as the C<local/> directory, then C<lib/> will also bee added to C<@INC>. This is helpful if you're installing to run an application that includes a C<lib/> directory. If you do not want this to be a...
( run in 0.242 second using v1.01-cache-2.11-cpan-702932259ff )