Alien-Libbz2

 view release on metacpan or  search on metacpan

lib/Alien/Libbz2.pm  view on Meta::CPAN

package Alien::Libbz2;

use strict;
use warnings;
use 5.008001;
use base 'Alien::Base';

# ABSTRACT: Build and make available bz2
our $VERSION = '0.24'; # VERSION




sub alien_helper
{
  return {
    bzip2 => sub { 'bzip2' },
  };
}

# TODO: this should eventually be correctly handled by
# Alien::Build
sub config {
  my($class, $key) = @_;
  return 'bz2' if $key eq 'name' || $key eq 'ffi_name';
  return $class->SUPER::config($key);
}


1;

__END__

=pod

=encoding UTF-8

=head1 NAME

Alien::Libbz2 - Build and make available bz2

=head1 VERSION

version 0.24

=head1 SYNOPSIS

In your Build.PL:

 use Module::Build;
 use Alien::Libbz2;
 my $builder = Module::Build->new(
   ...
   configure_requires => {
     'Alien::Libbz2' => '0',
     ...
   },
   extra_compiler_flags => Alien::Libbz2->cflags,
   extra_linker_flags   => Alien::Libbz2->libs,
   ...
 );
 
 $build->create_build_script;

In your Makefile.PL:

 use ExtUtils::MakeMaker;
 use Config;
 use Alien::Libbz2;
 
 WriteMakefile(
   ...
   CONFIGURE_REQUIRES => {
     'Alien::Libbz2' => '0',
   },
   CCFLAGS => Alien::Libbz2->cflags . " $Config{ccflags}",
   LIBS    => [ Alien::Libbz2->libs ],
   ...
 );

In your L<FFI::Platypus> script or module:

 use FFI::Platypus;
 use Alien::Libbz2;
 
 my $ffi = FFI::Platypus->new(



( run in 1.060 second using v1.01-cache-2.11-cpan-df04353d9ac )