line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::LibMagic; |
2
|
|
|
|
|
|
|
$Alien::LibMagic::VERSION = '0.003'; |
3
|
2
|
|
|
2
|
|
1204
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1307
|
use Path::Tiny; |
|
2
|
|
|
|
|
18623
|
|
|
2
|
|
|
|
|
107
|
|
7
|
2
|
|
|
2
|
|
933
|
use parent 'Alien::Base'; |
|
2
|
|
|
|
|
476
|
|
|
2
|
|
|
|
|
10
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub cflags { |
10
|
1
|
|
|
1
|
1
|
33
|
my ($self) = @_; |
11
|
1
|
|
|
|
|
43
|
my $top_include = File::Spec->catfile( File::Spec->rel2abs($self->dist_dir), qw(include) ); |
12
|
1
|
|
|
|
|
582
|
return "-I$top_include"; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub libs { |
16
|
2
|
|
|
2
|
1
|
16739
|
my ($self) = @_; |
17
|
2
|
|
|
|
|
18
|
my $top_lib = File::Spec->catfile( File::Spec->rel2abs($self->dist_dir), qw(lib) ); |
18
|
2
|
|
|
|
|
500
|
my $la_file = path( File::Spec->catfile( $top_lib, 'libmagic.la' ) ); |
19
|
2
|
|
|
|
|
76
|
my ($deps) = $la_file->slurp_utf8 =~ /^dependency_libs=' (.*)'$/m; |
20
|
2
|
|
|
|
|
2800
|
return "-L$top_lib -lmagic $deps"; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub Inline { |
24
|
1
|
|
|
1
|
0
|
114175
|
my ($self, $lang) = @_; |
25
|
|
|
|
|
|
|
|
26
|
1
|
50
|
|
|
|
30
|
if( $lang eq 'C' ) { |
27
|
1
|
|
|
|
|
16
|
my $params = Alien::Base::Inline(@_); |
28
|
|
|
|
|
|
|
$params->{MYEXTLIB} .= ' ' . |
29
|
|
|
|
|
|
|
join( " ", |
30
|
1
|
|
|
|
|
12
|
map { File::Spec->catfile( |
|
1
|
|
|
|
|
8
|
|
31
|
|
|
|
|
|
|
File::Spec->rel2abs($self->dist_dir), |
32
|
|
|
|
|
|
|
'lib', $_ ) } |
33
|
|
|
|
|
|
|
qw(libmagic.a) |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
# Use static linking instead of dynamic linking on macOS. |
36
|
1
|
50
|
|
|
|
235
|
if( $^O eq 'darwin' ) { |
37
|
0
|
|
|
|
|
0
|
$params->{LIBS} =~ s/-lmagic//g; |
38
|
|
|
|
|
|
|
} |
39
|
1
|
|
|
|
|
5
|
return $params; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub inline_auto_include { |
44
|
2
|
|
|
2
|
1
|
17
|
return [ 'magic.h' ]; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=encoding UTF-8 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Alien::LibMagic - Alien package for the libmagic library |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 VERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
version 0.003 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 Inline support |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This module supports L. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L, L, L |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Zakariyya Mughal |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Zakariyya Mughal. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
78
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |