Alien-CMake
view release on metacpan or search on metacpan
};
if($rv=check_src_build($build->os_type)) {
push @candidates, @{$rv};
};
push @candidates, { title => 'Quit installation' };
#### ask user what way to go
my $i = 1;
my $prompt_string = "\nYou have the following options:\n";
foreach my $c (@candidates) {
$prompt_string .= "[" . $i++ . "] " . $c->{title} . "\n"
}
$prompt_string .= "\nWhat way do you wanna go?";
my $ans = $build->prompt($prompt_string, 1);
#### store build params into 'notes'
if(($ans>0) && ($ans<scalar(@candidates))) {
$build->notes('build_params', $candidates[$ans-1]);
}
else {
$build->notes('build_params', undef); # just to be sure
}
inc/My/Builder.pm view on Meta::CPAN
dircopy($bindir, catdir($build_out, 'bin'));
dircopy($sharedir, catdir($build_out, 'share'));
}
sub extract_sources {
my ($self, $download, $patches, $build_src) = @_;
my $bp = $self->notes('build_params');
my $srcdir = catfile($build_src, $bp->{dirname});
my $unpack = 'y';
$unpack = $self->prompt("Dir '$srcdir' exists, wanna replace with clean sources?", "n") if (-d $srcdir);
if (lc($unpack) eq 'y') {
$self->clean_dir($srcdir);
my $archive = catfile($download, File::Fetch->new(uri => $bp->{url})->file);
print "Extracting sources...\n";
my $ae = Archive::Extract->new( archive => $archive );
die "###ERROR###: cannot extract $bp ", $ae->error unless $ae->extract(to => $build_src);
foreach my $i (@{$bp->{patches}}) {
chdir $srcdir;
print "Applying patch '$i'\n";
my $cmd = $self->patch_command($srcdir, catfile($patches, $i));
( run in 0.621 second using v1.01-cache-2.11-cpan-0b5f733616e )