#! perl

use v5.012;
use strict;
use warnings;

use alienfile;
use Path::Tiny;

our $VERSION = '0.04';

use constant PKG_NAME    => 'cxcparam';
use constant PKG_VERSION => '4.12.0.10';
use constant PKG_TARBALL => PKG_NAME . q{-} . PKG_VERSION . '.tar.gz';

my $pkg_name = 'cxcparam';

plugin 'Gather::IsolateDynamic';

plugin PkgConfig => (
    pkg_name        => PKG_NAME,
    atleast_version => PKG_VERSION,
);

share {
    start_url 'inc/' . PKG_TARBALL;

    plugin 'Download';

    plugin Extract => 'tar.gz';

    plugin 'Build::Autoconf' => ( with_pic => 1 );
    build [ '%{configure}', '%{make}', '%{make} install', ];
};

gather [
    [ "pkg-config --modversion $pkg_name", \'%{.runtime.version}' ],
    [ "pkg-config --cflags     $pkg_name", \'%{.runtime.cflags}' ],
    [ "pkg-config --libs       $pkg_name", \'%{.runtime.libs}' ],
];
