| 1 | 1 | ▶ | use alienfile; | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Path::Tiny qw( path ); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use File::Which qw( which ); | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | configure { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | requires 'Path::Tiny'; | |||||||||||||||||||||||||||||||||||||||
| 7 | 1 | requires 'File::Which'; | |||||||||||||||||||||||||||||||||||||||
| 8 | 1 | }; | |||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | plugin 'Probe::CommandLine' => ( | |||||||||||||||||||||||||||||||||||||||
| 11 | command => 'ghostunnel', | ||||||||||||||||||||||||||||||||||||||||
| 12 | args => '--version', | ||||||||||||||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | share { | ||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=15 SCAR=42.8
| |||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | my $asset_name; | |||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | my $cpu = meta->prop->{platform}->{cpu}->{arch}->{name}; | |||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | if($^O eq 'linux' && $cpu eq 'x86_64') | ||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition33%1/3
$^O eq "linux" and $cpu eq "x86_64"
MC/DC0%0/2
$^O eq "linux" and $cpu eq "x86_64"
$^O eq "linux"
$cpu eq "x86_64"
Truth table33%1/3
A and B
A= $^O eq "linux"B= $cpu eq "x86_64"
| |||||||||||||||||||||||||||||||||||||||||
| 22 | { | ||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | $asset_name = 'ghostunnel-linux-amd64'; | |||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||
| 25 | ▶ | elsif($^O eq 'darwin' && $cpu eq 'x86_64') | |||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$^O eq "darwin" and $cpu eq "x86_64"
MC/DC0%0/2
$^O eq "darwin" and $cpu eq "x86_64"
$^O eq "darwin"
$cpu eq "x86_64"
Truth table0%0/3
A and B
A= $^O eq "darwin"B= $cpu eq "x86_64"
| |||||||||||||||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $asset_name = 'ghostunnel-darwin-amd64'; | |||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||
| 29 | ▶ | elsif($^O eq 'darwin' && $cpu eq 'aarch64') | |||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$^O eq "darwin" and $cpu eq "aarch64"
MC/DC0%0/2
$^O eq "darwin" and $cpu eq "aarch64"
$^O eq "darwin"
$cpu eq "aarch64"
Truth table0%0/3
A and B
A= $^O eq "darwin"B= $cpu eq "aarch64"
| |||||||||||||||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $asset_name = 'ghostunnel-darwin-arm64'; | |||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||
| 33 | ▶ | elsif($^O eq 'MSWin32' && $cpu eq 'x86_64') | |||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$^O eq "MSWin32" and $cpu eq "x86_64"
MC/DC0%0/2
$^O eq "MSWin32" and $cpu eq "x86_64"
$^O eq "MSWin32"
$cpu eq "x86_64"
Truth table0%0/3
A and B
A= $^O eq "MSWin32"B= $cpu eq "x86_64"
| |||||||||||||||||||||||||||||||||||||||||
| 34 | { | ||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | $asset_name = 'ghostunnel-windows-amd64'; | |||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | ▶ | undef $asset_name if $ENV{ALIEN_GHOSTUNNEL_SOURCE}; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | ▶ | plugin 'Download::GitHub' => ( | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 41 | github_user => 'ghostunnel', | ||||||||||||||||||||||||||||||||||||||||
| 42 | github_repo => 'ghostunnel', | ||||||||||||||||||||||||||||||||||||||||
| 43 | $asset_name ? (asset => 1, asset_name => qr/^$asset_name$/, asset_format => 'f') : (), | ||||||||||||||||||||||||||||||||||||||||
| 44 | ); | ||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | ▶ | if($asset_name) | ||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | my $exe = "ghostunnel"; | |||||||||||||||||||||||||||||||||||||||
| 49 | 1 | ▶ | $exe .= ".exe" if $^O eq 'MSWin32'; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | my @build = ( | |||||||||||||||||||||||||||||||||||||||
| 52 | '%{make_path} %{.install.prefix}/bin', | ||||||||||||||||||||||||||||||||||||||||
| 53 | "%{cp} %{.install.extract}/$asset_name %{.install.prefix}/bin/$exe", | ||||||||||||||||||||||||||||||||||||||||
| 54 | ); | ||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | ▶ | push @build, "chmod +x %{.install.prefix}/bin/$exe" unless $^O eq 'MSWin32'; | ||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | build \@build; | |||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||
| 59 | elsif(my $go = which('go')) | ||||||||||||||||||||||||||||||||||||||||
| 60 | { | ||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | plugin 'Build::Make' => 'umake'; | |||||||||||||||||||||||||||||||||||||||
| 62 | 0 | Alien::Build->log("no binary for your platform must build from source"); | |||||||||||||||||||||||||||||||||||||||
| 63 | 0 | build [ | |||||||||||||||||||||||||||||||||||||||
| 64 | '%{make} ghostunnel', | ||||||||||||||||||||||||||||||||||||||||
| 65 | '%{make_path} %{.install.prefix}/bin', | ||||||||||||||||||||||||||||||||||||||||
| 66 | '%{cp} %{.install.extract}/ghostunnel %{.install.prefix}/bin/ghostunnel', | ||||||||||||||||||||||||||||||||||||||||
| 67 | ]; | ||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||
| 69 | else | ||||||||||||||||||||||||||||||||||||||||
| 70 | { | ||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | Alien::Build->log("no binary for your platform and no Go compiler"); | |||||||||||||||||||||||||||||||||||||||
| 72 | 0 | die "no binary for your platform and no Go compiler"; | |||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | }; | |||||||||||||||||||||||||||||||||||||||