File Coverage

blib/lib/Alien/Build/Plugin/Core/Legacy.pm
Criterion Covered Total %
statement 24 24 100.0
branch 4 4 100.0
condition 6 6 100.0
subroutine 6 6 100.0
pod 1 1 100.0
total 41 41 100.0


line stmt bran cond sub pod time code
1             package Alien::Build::Plugin::Core::Legacy;
2              
3 47     47   2255 use strict;
  47         101  
  47         1232  
4 47     47   200 use warnings;
  47         92  
  47         950  
5 47     47   671 use 5.008004;
  47         152  
6 47     47   611 use Alien::Build::Plugin;
  47         100  
  47         329  
7              
8             # ABSTRACT: Core Alien::Build plugin to maintain compatibility with legacy Alien::Base
9             our $VERSION = '2.47'; # VERSION
10              
11              
12             sub init
13             {
14 322     322 1 745 my($self, $meta) = @_;
15              
16             $meta->after_hook(
17             $_ => sub {
18 42     42   120 my($build) = @_;
19              
20 42         303 $build->log("adding legacy hash to config");
21              
22 42         290 my $runtime = $build->runtime_prop;
23              
24 42 100 100     315 if($runtime->{cflags} && ! defined $runtime->{cflags_static})
25             {
26 10         32 $runtime->{cflags_static} = $runtime->{cflags};
27             }
28              
29 42 100 100     237 if($runtime->{libs} && ! defined $runtime->{libs_static})
30             {
31 10         31 $runtime->{libs_static} = $runtime->{libs};
32             }
33              
34 42         202 $runtime->{legacy}->{finished_installing} = 1;
35 42         189 $runtime->{legacy}->{install_type} = $runtime->{install_type};
36 42         185 $runtime->{legacy}->{version} = $runtime->{version};
37 42         160 $runtime->{legacy}->{original_prefix} = $runtime->{prefix};
38             }
39 322         2443 ) for qw( gather_system gather_share );
40             }
41              
42             1;
43              
44             __END__