-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalienfile
52 lines (42 loc) · 1.3 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
50
51
52
use alienfile;
use Config;
plugin 'Probe::CommandLine' => (
command => 'unzip',
args => [ '-v' ],
match => qr/UnZip.*Info-ZIP/,
version => qr/UnZip ([0-9\.]+)/,
);
share {
# start_url 'ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz';
# start_url 'https://sourceforge.net/projects/infozip/files/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz',
# Sourceforge sucks, and github has a world class CDN
start_url 'https://alienfile.org/mirror/unzip60.tar.gz';
plugin 'Download';
plugin Extract => 'tar.gz';
if($^O eq 'MSWin32')
{
meta->before_hook(build => sub {
my($build) = @_;
my $prefix = $build->install_prop->{prefix};
$prefix =~ s{/}{\\}g;
meta->interpolator->add_helper(prefix_win => sub { $prefix });
});
plugin 'Build::Make' => 'gmake';
if($Config{ptrsize} == 4)
{
patch [ 'patch --binary -p1 < %{.install.patch}/windows-32-bit.diff' ];
}
build [
[ '%{make}', -f => 'win32/Makefile.gcc', 'CC_CPU_OPT=', 'NOASM=1' ],
[ 'mkdir', '%{prefix_win}\\bin' ],
'copy *.exe %{prefix_win}\\bin',
];
}
else
{
build [
[ '%{make}', -f => 'unix/Makefile', 'generic', 'prefix=%{.install.prefix}' ],
[ '%{make}', -f => 'unix/Makefile', 'install', 'prefix=%{.install.prefix}' ],
];
}
}