-
Notifications
You must be signed in to change notification settings - Fork 0
/
alienfile
64 lines (49 loc) · 1.23 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
53
54
55
56
57
58
59
60
61
62
63
64
use alienfile;
requires 'Path::Tiny' => 0;
plugin 'PkgConfig' => (
pkg_name => 'igraph',
);
share {
my $version_re = qr/igraph-([\w\.]+)\.tar\.gz/;
plugin Download => (
url => 'https://igraph.org/c/',
version => $version_re,
prefer => sub {
my $res_list = [
grep {
$_->{url} =~ $version_re;
} map {
# modifying
$_->{url} =~ s/\n//g;
$_;
}
@{ $_[1]->{list} }
];
return +{ list => $res_list, type => 'list' };
}
);
plugin Extract => 'tar.gz';
patch sub {
if( $^O eq 'MSWin32' ) {
my ($s_paus) = Path::Tiny->new('src/f2c/s_paus.c');
$s_paus->edit_lines(sub {
s{\Qpause();\E}{}g;
});
}
};
plugin 'Build::Autoconf';
my $extra_configure = '';
# Need to add -DUSE_CLOCK to CFLAGS because MSWin32 MinGW does not have
# `#include <sys/times.h>`.
$extra_configure .= " CFLAGS='-DUSE_CLOCK'" if $^O eq 'MSWin32';
build [
"%{configure}$extra_configure",
'%{make}',
# Skip `make check` on MSWin32.
# MSWin32 requires a patch to change `$at_diff` in
# `tests/testsuite` to `diff -u --strip-trailing-cr` because the
# programs output a CR which needs to be ignored.
( '%{make} check' ) x!!( $^O ne 'darwin' && $^O ne 'MSWin32' ),
'%{make} install',
];
};