Alien-LibYAML
view release on metacpan or search on metacpan
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 ];
},
);
};
( run in 0.859 second using v1.01-cache-2.11-cpan-119454b85a5 )