Alien-Xmake
view release on metacpan or search on metacpan
"share",
"eg",
"examples",
"author",
"builder"
]
},
"prereqs" : {
"build" : {
"recommends" : {
"IO::Socket::SSL" : "0"
},
"requires" : {
"Exporter" : "5.57",
"ExtUtils::Helpers" : "0.028",
"ExtUtils::Install" : "0",
"ExtUtils::InstallPaths" : "0.002",
"File::Basename" : "0",
"File::Find" : "0",
"File::Path" : "0",
"File::Spec::Functions" : "0",
builder/Alien/Xmake/Builder.pm view on Meta::CPAN
my $speed_github = $self->_get_host_speed('github.com');
if ( $speed_gitee <= $speed_github ) {
return 'gitee.com';
}
return 'github.com';
}
method _download_file ( $url, $dest ) {
my $dest_str = "$dest";
# Try HTTP::Tiny + IO::Socket::SSL
if ( eval { require IO::Socket::SSL; 1 } ) {
say 'Downloading with HTTP::Tiny...';
my $http = HTTP::Tiny->new( verify_SSL => 1 );
my $res = $http->mirror( $url, $dest_str );
if ( $res->{success} ) {
return 1;
}
say "HTTP::Tiny failed: $res->{status} $res->{reason}";
}
else {
say 'HTTP::Tiny skipped: IO::Socket::SSL not installed.';
}
# Try curl
if ( $self->_run_cmd('curl --version >/dev/null 2>&1') ) {
say 'Downloading with curl...';
# -L: Follow redirects, -f: Fail on error, -o: Output
if ( $self->_run_cmd( 'curl', '-L', '-f', '-o', $dest_str, $url ) ) {
return 1;
}
requires 'ExtUtils::InstallPaths', '0.002';
requires 'File::Basename';
requires 'File::Find';
requires 'File::Path';
requires 'File::Spec::Functions';
requires 'Getopt::Long', '2.36';
requires 'HTTP::Tiny';
requires 'JSON::PP', '2';
requires 'Path::Tiny';
requires 'perl', 'v5.40.0';
recommends 'IO::Socket::SSL';
};
on test => sub {
requires 'Capture::Tiny';
requires 'File::Temp';
requires 'Test2::V0';
};
on develop => sub {
requires 'CPAN::Uploader';
requires 'Code::TidyAll';
requires 'Code::TidyAll::Plugin::ClangFormat';
( run in 1.661 second using v1.01-cache-2.11-cpan-39bf76dae61 )