forked from rsimoes/Alien-LibYAML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalienfile
60 lines (46 loc) · 1.1 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
use alienfile;
plugin 'PkgConfig' => 'yaml-0.1';
configure {
requires 'Alien::Build::Plugin::Decode::Mojo';
};
share {
plugin Download => (
url => 'https://pyyaml.org/download/libyaml/',
version => qr/^yaml-([0-9\.]+)\.tar\.gz$/,
decoder => 'Decode::Mojo',
);
plugin Extract => 'tar.gz';
requires 'Path::Tiny' => '0.077';
patch sub {
my($build) = @_;
my $pc = Path::Tiny->new('yaml-0.1.pc.in');
if(-f $pc)
{
$pc->edit_lines(sub {
s/^Cflags:\s*$/Cflags: -I\${includedir}\n/;
});
}
};
plugin 'Build::Autoconf' => ();
ffi {
build [
'%{configure} --enable-shared --disable-static --libdir=%{.install.autoconf_prefix}/dynamic',
'%{make}',
'%{make} install',
];
};
meta->after_hook(
gather_share => sub {
my($build) = @_;
$build->runtime_prop->{$_} .= ' -DYAML_DECLARE_STATIC ' for qw( cflags cflags_static );
},
);
};
sys {
meta->after_hook(
gather_system => sub {
my($build) = @_;
$build->runtime_prop->{ffi_checklib}->{system} = [ try_linker_script => 1 ];
},
);
};