alienfile

filter: Statementstmt 88.8% 32 / 36 Branchbran 50.0% 5 / 10 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 80.0% 44 / 55 CC 7 SCAR 11.8
CC
7
Cov
79%
__ANON__
4.6
get_version_filter
4.2
BEGIN
1.0
CRAP 3.3
↑ Summary blib/lib/Alien/patchelf.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use alienfile;
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 1 my $on_windows = $^O eq 'MSWin32';
6
7 1 plugin 'Probe::CommandLine' => (
8 command => 'patchelf',
9 );
10
11 1 ▶share {
Subroutine __ANON__: called CC=4 SCAR=15.2
12
13 1 ▶ Alien::Build->log ('$ENV{ALIEN_BUILD_PRELOAD} = ' . ($ENV{ALIEN_BUILD_PRELOAD} // ''));
Condition50%1/2
$ENV{"ALIEN_BUILD_PRELOAD"} // ""
l!l
01
MC/DC0%0/1
$ENV{"ALIEN_BUILD_PRELOAD"} // ""
$ENV{"ALIEN_BUILD_PRELOAD"}
Truth table50%1/2
A
A= $ENV{"ALIEN_BUILD_PRELOAD"}
Aresult
11
00
14
15 #my $version_filter = have_cpp17() ? qr/^([0-9\.]+)$/ : qr/^(0.13.1)$/;
16 #Alien::Build->log("version filter: $version_filter");
17
18 1 meta->prop->{start_url} = 'https://github.com/NixOS/patchelf.git';
19 1 plugin 'Download::Git' =>(
20 filter => get_version_filter(),
21 version => qr/^([0-9\.]+)$/,
22 );
23
24 1 my $config_call = '%{configure}';
25 1 requires 'Alien::Autotools';
26 1 plugin 'Build::Autoconf';
27 1 ▶ if ($on_windows) {
Branch: 1 branch
BranchTrueFalseTotal
if ($on_windows) 0 1 1
28 0 plugin 'Build::MSYS';
29 }
30 1 ▶ if ($^O =~ /solaris/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /solaris/i) 0 1 1
31 0 plugin 'Build::Make' => 'gmake';
32 0 $config_call = "MAKE=gmake $config_call";
33 }
34 build [
35 1 'sh ./bootstrap.sh', # windows needs explicit shell call
36 $config_call,
37 '%{make}',
38 '%{make} install',
39 ];
40 1 };
41
42 # Compile a c++ file to see if we can support c++17.
43 # If not then fall back to an older version.
44 # We could use ExtUtils::CBuilder but it is not
45 # cooperating - patches welcome.
46 1 ▶sub get_version_filter {
Subroutine get_version_filter: called CC=4 SCAR=14.3
47 1 my $default_filter = qr/^([0-9\.]+)$/;
48
49 # compiler might not be called c++
50 1 ▶ use ExtUtils::CppGuess 0.25;
Subroutine BEGIN: called CC=1 SCAR=0.0
51
52 1 ▶ my $cppg = ExtUtils::CppGuess->new()
Branch: 1 branch
BranchTrueFalseTotal
my $cppg = "ExtUtils::CppGuess"->new or return $default_filter 1 0 1
53 or return $default_filter;
54 1 my $have_cpp_17 = eval {$cppg->cpp_standard_flag('C++17'); 1};
55
56 1 meta->prop->{my_have_cpp17} = $have_cpp_17;
57 1 ▶ if (!$have_cpp_17) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($have_cpp_17) 0 1 1
58 0 Alien::Build->log("The c++ compiler does not support -std=c++17, falling back to patchelf 0.13.1");
59 }
60 1 ▶ return $have_cpp_17 ? $default_filter : qr/^(0.13.1)$/
Branch: 1 branch
BranchTrueFalseTotal
$have_cpp_17 ? : 1 0 1
61 }
↑ Summary blib/lib/Alien/patchelf.pm »