line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::MB; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
196005
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
713
|
use Path::Tiny (); |
|
1
|
|
|
|
|
10640
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
614
|
use Alien::Build; |
|
1
|
|
|
|
|
44107
|
|
|
1
|
|
|
|
|
37
|
|
7
|
1
|
|
|
1
|
|
8
|
use base qw( Module::Build ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
476
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Alien::Build installer class for Module::Build |
10
|
|
|
|
|
|
|
our $VERSION = '0.09'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
4
|
|
|
4
|
1
|
26888
|
my($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
4
|
50
|
|
|
|
52
|
if(! -f 'alienfile') |
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
|
|
0
|
die "unable to find alienfile"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
else |
22
|
|
|
|
|
|
|
{ |
23
|
4
|
|
|
|
|
38
|
my $build = Alien::Build->load('alienfile', root => '_alien'); |
24
|
4
|
|
|
|
|
28682
|
$build->load_requires('configure'); |
25
|
4
|
|
|
|
|
254
|
$build->root; |
26
|
4
|
|
|
|
|
1035
|
$build->checkpoint; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
4734
|
my $self = $class->SUPER::new(%args); |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
50898
|
my $build = $self->alien_build(1); |
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
|
|
75
|
$self->_add_prereq( "${_}_requires", 'Module::Build' => '0.36' ) for qw( configure build ); |
34
|
4
|
|
|
|
|
253
|
$self->_add_prereq( "${_}_requires", 'Alien::Build::MB' => '0.01' ) for qw( configure build ); |
35
|
4
|
|
|
|
|
200
|
$self->add_to_cleanup("_alien"); |
36
|
|
|
|
|
|
|
|
37
|
4
|
|
|
|
|
495
|
foreach my $hook_name (qw( test_ffi test_share test_system )) |
38
|
|
|
|
|
|
|
{ |
39
|
12
|
100
|
|
|
|
131
|
if($build->meta->has_hook($hook_name)) |
40
|
|
|
|
|
|
|
{ |
41
|
2
|
|
|
|
|
35
|
$self->_add_prereq( "configure_requires", 'Alien::Build::MB' => '0.05'); |
42
|
2
|
|
|
|
|
405
|
last; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
4
|
|
|
|
|
24
|
my %config_requires = %{ $build->requires('configure') }; |
|
4
|
|
|
|
|
32
|
|
47
|
4
|
|
|
|
|
81
|
foreach my $module (keys %config_requires) |
48
|
|
|
|
|
|
|
{ |
49
|
5
|
|
|
|
|
34
|
my $version = $config_requires{$module}; |
50
|
5
|
|
|
|
|
24
|
$self->_add_prereq( 'configure_requires', $module => $version ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
4
|
50
|
|
|
|
118
|
unless($build->install_type =~ /^(share|system)$/) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
0
|
die "unknown install type: @{[ $build->install_type ]}"; |
|
0
|
|
|
|
|
0
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
4
|
|
|
|
|
6791
|
my %build_requires = %{ $build->requires($build->install_type) }; |
|
4
|
|
|
|
|
20
|
|
59
|
4
|
|
|
|
|
144
|
foreach my $module (keys %build_requires) |
60
|
|
|
|
|
|
|
{ |
61
|
2
|
|
|
|
|
7
|
my $version = $build_requires{$module}; |
62
|
2
|
|
|
|
|
8
|
$self->_add_prereq( 'build_requires', $module => $version ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
4
|
50
|
|
|
|
78
|
my $final_dest = $self->install_destination($build->meta_prop->{arch} ? 'arch' : 'lib'); |
66
|
|
|
|
|
|
|
|
67
|
4
|
|
|
|
|
3606
|
my $prefix = Path::Tiny->new($final_dest) |
68
|
|
|
|
|
|
|
->child("auto/share/dist") |
69
|
|
|
|
|
|
|
->child($self->dist_name) |
70
|
|
|
|
|
|
|
->absolute; |
71
|
4
|
|
|
|
|
489
|
my $stage = Path::Tiny->new("blib/lib/auto/share/dist") |
72
|
|
|
|
|
|
|
->child($self->dist_name) |
73
|
|
|
|
|
|
|
->absolute; |
74
|
|
|
|
|
|
|
|
75
|
4
|
|
|
|
|
451
|
$build->set_stage ($stage->stringify ); |
76
|
4
|
|
|
|
|
118
|
$build->set_prefix($prefix->stringify); |
77
|
4
|
|
|
|
|
149
|
$build->runtime_prop->{perl_module_version} = $self->dist_version; |
78
|
|
|
|
|
|
|
|
79
|
4
|
|
|
|
|
92
|
$build->checkpoint; |
80
|
|
|
|
|
|
|
|
81
|
4
|
50
|
|
|
|
7471
|
if($self->alien_alienfile_meta) |
82
|
|
|
|
|
|
|
{ |
83
|
|
|
|
|
|
|
$self->meta_merge->{x_alienfile} = { |
84
|
4
|
|
50
|
|
|
38
|
generated_by => "@{[ __PACKAGE__ ]} version @{[ __PACKAGE__->VERSION || 'dev' ]}", |
|
4
|
|
|
|
|
98
|
|
85
|
|
|
|
|
|
|
requires => { |
86
|
|
|
|
|
|
|
map { |
87
|
4
|
|
|
|
|
46
|
my %reqs = %{ $build->requires($_) }; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
20
|
|
88
|
8
|
|
|
|
|
200
|
$reqs{$_} = "$reqs{$_}" for keys %reqs; |
89
|
8
|
|
|
|
|
77
|
$_ => \%reqs; |
90
|
|
|
|
|
|
|
} qw( share system ) |
91
|
|
|
|
|
|
|
}, |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
4
|
|
|
|
|
163
|
$self; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__PACKAGE__->add_property( alien_alienfile_meta => 1 ); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub alien_build |
103
|
|
|
|
|
|
|
{ |
104
|
19
|
|
|
19
|
1
|
14966
|
my($self, $noload) = @_; |
105
|
19
|
|
|
|
|
137
|
my $build = Alien::Build->resume('alienfile', '_alien'); |
106
|
19
|
|
|
|
|
123920
|
$build->load_requires('configure'); |
107
|
19
|
100
|
|
|
|
1422
|
$build->load_requires($build->install_type) unless $noload; |
108
|
19
|
|
|
|
|
389
|
$build; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub _alien_already_done ($) |
112
|
|
|
|
|
|
|
{ |
113
|
11
|
|
|
11
|
|
37
|
my($name) = @_; |
114
|
11
|
|
|
|
|
63
|
my $path = Path::Tiny->new("_alien/mb/$name"); |
115
|
11
|
|
|
|
|
312
|
return -f $path; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub _alien_touch ($) |
119
|
|
|
|
|
|
|
{ |
120
|
8
|
|
|
8
|
|
41
|
my($name) = @_; |
121
|
8
|
|
|
|
|
62
|
my $path = Path::Tiny->new("_alien/mb/$name"); |
122
|
8
|
|
|
|
|
237
|
$path->parent->mkpath; |
123
|
8
|
|
|
|
|
1630
|
$path->touch; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub ACTION_alien_download |
128
|
|
|
|
|
|
|
{ |
129
|
5
|
|
|
5
|
1
|
8547
|
my($self) = @_; |
130
|
5
|
100
|
|
|
|
14
|
return $self if _alien_already_done 'download'; |
131
|
4
|
|
|
|
|
75
|
my $build = $self->alien_build; |
132
|
4
|
|
|
|
|
41
|
$build->download; |
133
|
4
|
|
|
|
|
2649
|
$build->checkpoint; |
134
|
4
|
|
|
|
|
6951
|
_alien_touch 'download'; |
135
|
4
|
|
|
|
|
828
|
$self; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub ACTION_alien_build |
140
|
|
|
|
|
|
|
{ |
141
|
6
|
|
|
6
|
1
|
11205
|
my($self) = @_; |
142
|
6
|
100
|
|
|
|
20
|
return $self if _alien_already_done 'build'; |
143
|
4
|
|
|
|
|
153
|
$self->depends_on('alien_download'); |
144
|
|
|
|
|
|
|
|
145
|
4
|
|
|
|
|
97
|
my $build = $self->alien_build; |
146
|
4
|
|
|
|
|
60
|
$build->build; |
147
|
|
|
|
|
|
|
|
148
|
4
|
50
|
|
|
|
19967
|
if($build->meta_prop->{arch}) |
149
|
|
|
|
|
|
|
{ |
150
|
4
|
|
|
|
|
62
|
my $archdir = Path::Tiny->new("./blib/arch/auto/@{[ join '/', split /-/, $self->dist_name ]}"); |
|
4
|
|
|
|
|
21
|
|
151
|
4
|
|
|
|
|
171
|
$archdir->mkpath; |
152
|
4
|
|
|
|
|
1322
|
my $archfile = $archdir->child($archdir->basename . ".txt"); |
153
|
4
|
|
|
|
|
246
|
$archfile->spew('Alien based distribution with architecture specific file in share'); |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
{ |
157
|
4
|
|
|
|
|
1342
|
my @parts = split /-/, $self->dist_name; |
|
4
|
|
|
|
|
19
|
|
158
|
4
|
|
|
|
|
55
|
my $package = join '::', @parts; |
159
|
4
|
|
|
|
|
24
|
my $install_files = Path::Tiny->new("./blib/lib")->child( @parts, 'Install', 'Files.pm' ); |
160
|
4
|
|
|
|
|
259
|
$install_files->parent->mkpath; |
161
|
4
|
|
|
|
|
1252
|
$install_files->spew_utf8( |
162
|
|
|
|
|
|
|
"package ${package}::Install::Files;\n", |
163
|
|
|
|
|
|
|
"use strict;\n", |
164
|
|
|
|
|
|
|
"use warnings;\n", |
165
|
|
|
|
|
|
|
"require ${package};\n", |
166
|
|
|
|
|
|
|
"sub Inline { shift; ${package}->Inline(\@_) }\n", |
167
|
|
|
|
|
|
|
"1;\n", |
168
|
|
|
|
|
|
|
"\n", |
169
|
|
|
|
|
|
|
"=begin Pod::Coverage\n", |
170
|
|
|
|
|
|
|
"\n", |
171
|
|
|
|
|
|
|
" Inline\n", |
172
|
|
|
|
|
|
|
"\n", |
173
|
|
|
|
|
|
|
"=cut\n", |
174
|
|
|
|
|
|
|
); |
175
|
|
|
|
|
|
|
}; |
176
|
|
|
|
|
|
|
|
177
|
4
|
|
|
|
|
3025
|
$build->checkpoint; |
178
|
|
|
|
|
|
|
|
179
|
4
|
|
|
|
|
8621
|
_alien_touch 'build'; |
180
|
4
|
|
|
|
|
719
|
$self; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub ACTION_alien_test |
185
|
|
|
|
|
|
|
{ |
186
|
2
|
|
|
2
|
1
|
4451
|
my($self) = @_; |
187
|
2
|
|
|
|
|
18
|
$self->depends_on('alien_build'); |
188
|
|
|
|
|
|
|
|
189
|
2
|
|
|
|
|
73
|
my $build = $self->alien_build; |
190
|
2
|
50
|
|
|
|
32
|
if($build->can('test')) |
191
|
|
|
|
|
|
|
{ |
192
|
2
|
|
|
|
|
11
|
$build->test; |
193
|
1
|
|
|
|
|
921
|
$build->checkpoint; |
194
|
|
|
|
|
|
|
} |
195
|
1
|
|
|
|
|
2170
|
$self; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub ACTION_test |
199
|
|
|
|
|
|
|
{ |
200
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
201
|
0
|
|
|
|
|
|
$self->depends_on('alien_test'); |
202
|
0
|
|
|
|
|
|
$self->SUPER::ACTION_test; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
sub ACTION_code |
206
|
|
|
|
|
|
|
{ |
207
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
208
|
0
|
|
|
|
|
|
$self->depends_on('alien_build'); |
209
|
0
|
|
|
|
|
|
$self->SUPER::ACTION_code; |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
1; |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
__END__ |