| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Build::MSYS; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
1321
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
109
|
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
88
|
|
|
5
|
4
|
|
|
4
|
|
68
|
use 5.008004; |
|
|
4
|
|
|
|
|
12
|
|
|
6
|
4
|
|
|
4
|
|
425
|
use Alien::Build::Plugin; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
24
|
|
|
7
|
4
|
|
|
4
|
|
477
|
use File::Which (); |
|
|
4
|
|
|
|
|
938
|
|
|
|
4
|
|
|
|
|
93
|
|
|
8
|
4
|
|
|
4
|
|
772
|
use Env qw( @PATH ); |
|
|
4
|
|
|
|
|
2312
|
|
|
|
4
|
|
|
|
|
45
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: MSYS plugin for Alien::Build |
|
11
|
|
|
|
|
|
|
our $VERSION = '2.47'; # VERSION |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has msys_version => '0.07'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub init |
|
17
|
|
|
|
|
|
|
{ |
|
18
|
9
|
|
|
9
|
1
|
27
|
my($self, $meta) = @_; |
|
19
|
|
|
|
|
|
|
|
|
20
|
9
|
50
|
|
|
|
31
|
if($self->msys_version ne '0.07') |
|
21
|
|
|
|
|
|
|
{ |
|
22
|
0
|
|
|
|
|
0
|
$meta->add_requires('configure' => 'Alien::Build::Plugin::Build::MSYS' => '0.84'); |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
9
|
50
|
|
|
|
22
|
if(_win_and_needs_msys($meta)) |
|
26
|
|
|
|
|
|
|
{ |
|
27
|
0
|
|
|
|
|
0
|
$meta->add_requires('share' => 'Alien::MSYS' => $self->msys_version); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$meta->around_hook( |
|
30
|
|
|
|
|
|
|
$_ => sub { |
|
31
|
0
|
|
|
0
|
|
0
|
my $orig = shift; |
|
32
|
0
|
|
|
|
|
0
|
my $build = shift; |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
local $ENV{PATH} = $ENV{PATH}; |
|
35
|
0
|
|
|
|
|
0
|
unshift @PATH, Alien::MSYS::msys_path(); |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
$orig->($build, @_); |
|
38
|
|
|
|
|
|
|
}, |
|
39
|
0
|
|
|
|
|
0
|
) for qw( build build_ffi test_share test_ffi ); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
9
|
50
|
|
|
|
24
|
if($^O eq 'MSWin32') |
|
44
|
|
|
|
|
|
|
{ |
|
45
|
|
|
|
|
|
|
# Most likely if we are trying to build something unix-y and |
|
46
|
|
|
|
|
|
|
# we are using MSYS, then we want to use the make that comes |
|
47
|
|
|
|
|
|
|
# with MSYS. |
|
48
|
|
|
|
|
|
|
$meta->interpolator->replace_helper( |
|
49
|
0
|
|
|
0
|
|
0
|
make => sub { 'make' }, |
|
50
|
0
|
|
|
|
|
0
|
); |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
9
|
|
|
|
|
22
|
$self; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _win_and_needs_msys |
|
58
|
|
|
|
|
|
|
{ |
|
59
|
9
|
|
|
9
|
|
18
|
my($meta) = @_; |
|
60
|
|
|
|
|
|
|
# check to see if we are running on windows. |
|
61
|
|
|
|
|
|
|
# if we are running on windows, check to see if |
|
62
|
|
|
|
|
|
|
# it is MSYS2, then we can just use that. Otherwise |
|
63
|
|
|
|
|
|
|
# we are probably on Strawberry, or (less likely) |
|
64
|
|
|
|
|
|
|
# VC Perl, in which case we will still need Alien::MSYS |
|
65
|
9
|
50
|
|
|
|
40
|
return 0 unless $^O eq 'MSWin32'; |
|
66
|
0
|
0
|
|
|
|
|
return 0 if $meta->prop->{platform}->{system_type} eq 'windows-mingw'; |
|
67
|
0
|
|
|
|
|
|
return 1; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |