-
Notifications
You must be signed in to change notification settings - Fork 0
/
alienfile
49 lines (44 loc) · 1.08 KB
/
alienfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use alienfile;
plugin 'Probe::CommandLine' => (
command => 'go',
args => [ 'version' ],
match => qr/^go version go([0-9\.]+)\b/,
version => qr/^go version go([0-9\.]+)\b/,
);
share {
start_url 'https://go.dev/dl/';
my %os_mapping = (
'darwin' => { name => 'darwin', format => 'tar.gz' },
'linux' => { name => 'linux', format => 'tar.gz' },
'MSWin32' => { name => 'windows', format => 'zip' },
'freebsd' => { name => 'freebsd', format => 'tar.gz' },
);
my %arch_mapping = (
'x86' => '386',
'x86_64' => 'amd64',
'aarch64' => 'arm64',
# => 'armv6l',
# => 'ppc64le',
# => 's390x'
);
my $os = $^O;
my $meta_arch = meta->prop->{platform}{cpu}{arch}{name};
my $match = qr{
^
go([0-9\.]+)
\.
@{[ $os_mapping{$^O}{name} ]}
-
@{[ $arch_mapping{$meta_arch} ]}
\.
\Q@{[ $os_mapping{$^O}{format} ]}\E
$
}x;
plugin Download => (
filter => $match,
version => $match,
);
plugin Extract => $os_mapping{$^O}{format};
plugin 'Build::Copy';
plugin 'Gather::IsolateDynamic';
}