-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalienfile
More file actions
67 lines (53 loc) · 1.63 KB
/
Copy pathalienfile
File metadata and controls
67 lines (53 loc) · 1.63 KB
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
65
66
67
use alienfile;
use Config;
use Carp;
sub isAtLeastFreeBSDv8 {
# FreeBSD 8+ ships with a native libusb-1.0 compatible library
return 0 unless $Config{osname} =~ qr/freebsd/i;
if ($Config{osvers} =~ qr/^(\d+).*/) {
croak 'FreeBSD versions below 8.x is not supported' if $1 < 8;
return 1
}
carp 'Could not determine FreeBSD major version';
0
}
if (isAtLeastFreeBSDv8) {
probe sub { 1 };
gather sub {
my ($build) = @_;
$build->runtime_prop->{version} = '1.0.9';
$build->runtime_prop->{cflags} = '-I/usr/include';
$build->runtime_prop->{libs} = '-L/usr/lib -lusb';
$build->runtime_prop->{libs_static} = '-L/usr/lib -lusb';
};
}
plugin 'PkgConfig' => 'libusb-1.0';
my ($cppflags, $ldflags) = ('', '');
share {
requires 'Alien::autoconf' => '0.03';
requires 'Alien::automake' => '0.05';
requires 'Alien::libtool' => '0.02';
requires 'Alien::m4' => '0.11';
if ($^O eq 'linux') {
plugin 'Build::SearchDep' => (
aliens => { 'Alien::libudev' => '0.1' },
);
}
plugin Download => (
# Archive::Tar chokes on the symlink, even with $Archive::Tar::FOLLOW_SYMLINK=1
# So extracting the zip instead.
url => 'https://github.com/libusb/libusb/releases',
filter => qr/^v .* \.zip$/x,
version => qr/([0-9\.]+)/,
);
plugin Extract => 'zip';
plugin 'Build::Autoconf' => ();
$ENV{NOCONFIGURE} = 1;
build [
'./autogen.sh',
'%{configure}',
'%{make}',
'%{make} install',
];
plugin 'Gather::IsolateDynamic' => ();
};