Alien-uPB

 view release on metacpan or  search on metacpan

inc/AU/Build.pm  view on Meta::CPAN

my $commit = 'd0838c21ef7104e3dc4e4bad74676ed815aed981';

sub new {
    my $class = shift;
    my $protobuf_flags = Alien::ProtoBuf->cflags;
    my $protobuf_cxxflags = Alien::ProtoBuf->cxxflags;
    my $make_args = '';
    if ($^O eq 'freebsd') {
        $make_args = 'CXX=c++';
    }
    my $self = $class->SUPER::new(
        @_,
        alien_name            => 'uPB', # to stop Alien::Base warnings
        alien_bin_requires => {
            'Alien::gmake' => 0.11, # needed for %{gmake} helper
        },
        alien_build_commands => [
            "%{gmake} default googlepb CXXFLAGS=\"$protobuf_cxxflags\" USER_CPPFLAGS=\"$protobuf_flags -fPIC -DUPB_GOOGLEPB_NOREFLECTION\" $make_args",
        ],
        alien_install_commands => [
            "$^X ../../scripts/install.pl %s",

inc/AU/Build.pm  view on Meta::CPAN

    );

    die "It seems something went wrong while building uPB"
        unless $version;

    return $version;
}

sub alien_generate_manual_pkgconfig {
    my $self = shift;
    my $config = $self->SUPER::alien_generate_manual_pkgconfig(@_);

    # -DNDEBUG works around https://github.com/google/upb/issues/63
    $config->{keywords}{Cflags} = '-I${pcfiledir}/include -DNDEBUG';
    $config->{keywords}{Libs} =
        '-L${pcfiledir}/lib ' .
        join " ", map "-l$_", qw(
            upb.bindings.googlepb upb.pb upb.json upb.descriptor upb
        );

    return $config;



( run in 1.244 second using v1.01-cache-2.11-cpan-49f99fa48dc )