Alien-SDL3
view release on metacpan or search on metacpan
builder/Alien/SDL3/Builder.pm view on Meta::CPAN
field $jobs : param //= 1;
field $destdir : param //= '';
field $prefix : param //= '';
field $cwd = cwd()->absolute;
#
#
ADJUST {
-e 'META.json' or die "No META information provided\n";
}
method write_file( $filename, $content ) { path($filename)->spew_raw($content) or die "Could not open $filename: $!\n" }
method read_file ($filename) { path($filename)->slurp_utf8 or die "Could not open $filename: $!\n" }
method step_build() {
$self->step_build_libs;
for my $pl_file ( find( qr/\.PL$/, 'lib' ) ) {
( my $pm = $pl_file ) =~ s/\.PL$//;
system $^X, $pl_file->stringify, $pm and die "$pl_file returned $?\n";
}
my %modules = map { $_ => catfile( 'blib', $_ ) } find( qr/\.pm$/, 'lib' );
my %docs = map { $_ => catfile( 'blib', $_ ) } find( qr/\.pod$/, 'lib' );
my %scripts = map { $_ => catfile( 'blib', $_ ) } find( qr/(?:)/, 'script' );
builder/Alien/SDL3/Builder.pm view on Meta::CPAN
$p->child('.config')->spew( join "\n", @out );
}
}
method get_arguments (@sources) {
$_ = detildefy($_) for grep {defined} $install_base, $destdir, $prefix, values %{$install_paths};
$install_paths = ExtUtils::InstallPaths->new( dist_name => $meta->name );
return;
}
method fetch ( $liburl, $outfile ) {
$http //= HTTP::Tiny->new();
printf 'Downloading %s... ', $liburl if $verbose;
$outfile->parent->mkpath;
my $response = $http->mirror( $liburl, $outfile, {} );
say $response->{reason} if $verbose;
if ( $response->{success} ) { #ddx $response;
#~ $self->add_to_cleanup($outfile);
my $outdir = $outfile->parent->child( $outfile->basename( '.tar.gz', '.zip' ) );
printf 'Extracting %s to %s... ', $outfile, $outdir if $verbose;
require Archive::Extract;
my $ae = Archive::Extract->new( archive => $outfile );
if ( $ae->extract( to => $outdir ) ) {
say 'done' if $verbose;
#~ $self->add_to_cleanup( $ae->extract_path );
return path( $ae->extract_path );
}
else {
croak 'Failed to extract ' . $outfile;
}
}
else {
croak 'Failed to download ' . $liburl;
}
return 0;
}
method Build(@args) {
my $method = $self->can( 'step_' . $action );
lib/Alien/SDL3.pm view on Meta::CPAN
}
\%h;
}
->();
return $config->{$feature} if defined $feature;
$config;
}
}
1;
=encoding utf-8
=head1 NAME
Alien::SDL3 - Build and install SDL3
=head1 SYNOPSIS
use Alien::SDL3; # Don't.
=head1 DESCRIPTION
( run in 0.803 second using v1.01-cache-2.11-cpan-47059a37de6 )