line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::proj;
|
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
491436
|
use strict;
|
|
4
|
|
|
|
|
38
|
|
|
4
|
|
|
|
|
99
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings;
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
93
|
|
5
|
4
|
|
|
4
|
|
382
|
use parent qw( Alien::Base );
|
|
4
|
|
|
|
|
265
|
|
|
4
|
|
|
|
|
25
|
|
6
|
4
|
|
|
4
|
|
54429
|
use Env qw ( @PATH @LD_LIBRARY_PATH @DYLD_LIBRARY_PATH );
|
|
4
|
|
|
|
|
2572
|
|
|
4
|
|
|
|
|
29
|
|
7
|
4
|
|
|
4
|
|
708
|
use Capture::Tiny qw /:all/;
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
447
|
|
8
|
4
|
|
|
4
|
|
438
|
use File::Which qw /which/;
|
|
4
|
|
|
|
|
858
|
|
|
4
|
|
|
|
|
150
|
|
9
|
4
|
|
|
4
|
|
20
|
use List::Util qw /uniq/;
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
2055
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.24';
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# adding to global {DY}LD_LIBRARY_PATH vars is icky but seems
|
14
|
|
|
|
|
|
|
# to be needed for utilities and downstream FFI
|
15
|
|
|
|
|
|
|
my %also;
|
16
|
|
|
|
|
|
|
my @alien_bins = (__PACKAGE__->bin_dir);
|
17
|
|
|
|
|
|
|
my @ld_lib_dirs;
|
18
|
|
|
|
|
|
|
foreach my $alien_lib (qw /Alien::libtiff Alien::sqlite/) {
|
19
|
|
|
|
|
|
|
if (eval "require $alien_lib" && $alien_lib->install_type eq 'share') {
|
20
|
|
|
|
|
|
|
$also{$alien_lib}++;
|
21
|
|
|
|
|
|
|
if ($alien_lib->install_type eq 'share') {
|
22
|
|
|
|
|
|
|
push @alien_bins, $alien_lib->bin_dir;
|
23
|
|
|
|
|
|
|
}
|
24
|
|
|
|
|
|
|
push @ld_lib_dirs, $alien_lib->dist_dir . q{/lib};
|
25
|
|
|
|
|
|
|
}
|
26
|
|
|
|
|
|
|
}
|
27
|
|
|
|
|
|
|
if (eval 'require Alien::curl' && 'Alien::curl'->install_type eq 'share') {
|
28
|
|
|
|
|
|
|
# we only compile in libcurl when there is a dynamic curl-config
|
29
|
|
|
|
|
|
|
if (-e 'Alien::curl'->dist_dir . '/dynamic/curl-config') {
|
30
|
|
|
|
|
|
|
$also{'Alien::curl'}++;
|
31
|
|
|
|
|
|
|
if (Alien::curl->install_type eq 'share') {
|
32
|
|
|
|
|
|
|
push @alien_bins, Alien::curl->dist_dir . '/dynamic';
|
33
|
|
|
|
|
|
|
push @ld_lib_dirs, Alien::curl->dist_dir . '/dynamic'
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
}
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
#if ($^O =~ /darwin/i) {
|
38
|
|
|
|
|
|
|
# @DYLD_LIBRARY_PATH = grep {defined} uniq (@DYLD_LIBRARY_PATH, @ld_lib_dirs);
|
39
|
|
|
|
|
|
|
#}
|
40
|
|
|
|
|
|
|
#elsif (not $^O =~ /mswin/i) {
|
41
|
|
|
|
|
|
|
# @LD_LIBRARY_PATH = grep {defined} uniq (@LD_LIBRARY_PATH, @ld_lib_dirs)
|
42
|
|
|
|
|
|
|
#}
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub bin_dirs {
|
46
|
2
|
|
|
2
|
0
|
4937
|
my $self = shift;
|
47
|
2
|
|
|
|
|
18
|
return @alien_bins;
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub dynamic_libs {
|
51
|
2
|
|
|
2
|
1
|
8096
|
my ($self) = @_;
|
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
21
|
my @libs = $self->SUPER::dynamic_libs;
|
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
|
|
15285
|
foreach my $lib (sort keys %also) {
|
56
|
2
|
|
|
|
|
18
|
push @libs, $lib->dynamic_libs;
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
5435
|
return @libs;
|
60
|
|
|
|
|
|
|
}
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub run_utility {
|
63
|
1
|
|
|
1
|
0
|
174
|
my ($self, $utility, @args) = @_;
|
64
|
|
|
|
|
|
|
|
65
|
1
|
50
|
33
|
|
|
13
|
if (__PACKAGE__->install_type eq 'system' && !which 'projinfo') {
|
66
|
0
|
|
|
|
|
0
|
warn __PACKAGE__ . " is a system install but lacks the utilities\n"
|
67
|
|
|
|
|
|
|
. "Perhaps try a share install.";
|
68
|
|
|
|
|
|
|
}
|
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
|
|
27
|
local $ENV{PATH} = $ENV{PATH};
|
71
|
1
|
|
|
|
|
4
|
unshift @PATH, $self->bin_dirs;
|
72
|
|
|
|
|
|
|
#if @alien_bins;
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# something of a hack
|
75
|
1
|
|
|
|
|
37
|
local $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH};
|
76
|
1
|
|
|
|
|
7
|
push @LD_LIBRARY_PATH, $self->dist_dir . '/lib';
|
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
341
|
local $ENV{DYLD_LIBRARY_PATH} = $ENV{DYLD_LIBRARY_PATH};
|
79
|
1
|
|
|
|
|
4
|
push @DYLD_LIBRARY_PATH, $self->dist_dir . '/lib';
|
80
|
|
|
|
|
|
|
|
81
|
1
|
50
|
|
|
|
224
|
if ($self->install_type eq 'share') {
|
82
|
1
|
|
|
|
|
24
|
my $bin = $self->bin_dir;
|
83
|
1
|
50
|
|
|
|
261
|
if (defined $bin) {
|
84
|
|
|
|
|
|
|
# should strip path from $utility
|
85
|
|
|
|
|
|
|
# if user specified one?
|
86
|
1
|
|
|
|
|
4
|
$utility = "$bin/$utility";
|
87
|
|
|
|
|
|
|
}
|
88
|
|
|
|
|
|
|
}
|
89
|
|
|
|
|
|
|
# handle spaces in path
|
90
|
1
|
50
|
|
|
|
6
|
if ($^O =~ /mswin/i) {
|
91
|
0
|
0
|
|
|
|
0
|
if ($utility =~ /\s/) {
|
92
|
0
|
|
|
|
|
0
|
$utility = qq{"$utility"};
|
93
|
|
|
|
|
|
|
}
|
94
|
|
|
|
|
|
|
}
|
95
|
|
|
|
|
|
|
else {
|
96
|
1
|
|
|
|
|
4
|
$utility =~ s|(\s)|\$1|g;
|
97
|
|
|
|
|
|
|
}
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# user gets the pieces if it breaks
|
101
|
1
|
|
|
1
|
|
25
|
capture {system $utility, @args};
|
|
1
|
|
|
|
|
9525
|
|
102
|
|
|
|
|
|
|
}
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1;
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
__END__
|