Alien-Libarchive3

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.30      2021-05-20 09:45:09 -0600
  - More reliable system installs on macOS
  - More reliable share installs on windows

0.29      2017-08-24 08:20:55 -0400
  - production release identical to 0.028_06 release

0.28_06   2017-07-30 21:40:07 -0400
  - Bump Alien::Build version for parallel make fix
  - Tweak netbsd flags

0.28_05   2017-07-17 19:31:10 -0400
  - Drop support for _macro on non-linux

0.28_04   2017-06-10 13:35:10 -0400
  - Update alienfile to remove deprecation

0.28_03   2017-06-10 06:36:13 -0400
  - Build dynamic libraries separately

alienfile  view on Meta::CPAN

  }
  else
  {
    @deps = qw( Alien::Nettle Alien::xz Alien::LZO Alien::Libbz2 Alien::Libxml2 );
  }

  plugin 'Build::SearchDep' => (
    aliens => \@deps,
  );

  my $configure_flags = '--with-lzo2';
  $configure_flags .= ' --without-iconv' if $^O eq 'darwin';

  if($^O eq 'MSWin32')
  {
    plugin 'Build::Autoconf' => ( ffi => 1 );

    build [
      "%{configure} --disable-shared --enable-static $configure_flags",
      '%{make}',
      '%{make} install',
    ];

    ffi {
      build [
        "%{configure} --enable-shared --disable-static --libdir=%{.install.autoconf_prefix}/dynamic $configure_flags",
        '%{make}',
        '%{make} install',
      ];
    };
  }
  else
  {
    plugin 'Build::Autoconf' => ( ffi => 0 );

    build [
      "%{configure} --enable-shared --enable-static --enable-bsdtar=static --enable-bsdcpio=static --enable-bsdcat=static $configure_flags",
      '%{make}',
      '%{make} install',
    ];

    plugin 'Gather::IsolateDynamic';
  }
};

if($^O eq 'netbsd')
{
  meta->after_hook(
    gather_system => sub {
      my($build) = @_;
      foreach my $flag (qw( libs libs_static))
      {
        if(defined $build->runtime_prop->{$flag} && $build->runtime_prop->{$flag} =~ m{-L/usr/pkg/lib})
        {
          $build->runtime_prop->{$flag} = '-Wl,-rpath,/usr/pkg/lib ' . $build->runtime_prop->{$flag};
        }
      }
    },
  );
}

dist.ini  view on Meta::CPAN

diag_preamble = |     diag '';
diag_preamble = |     diag '';
diag_preamble = |   }

diag_preamble = |   foreach my $alien (qw( Alien::Nettle Alien::xz Alien::LZO Alien::Libbz2 Alien::Libxml2 Alien::Libarchive3 )) {
diag_preamble = |     eval qq{ require $alien; 1 };
diag_preamble = |     next if $@;
diag_preamble = |     diag "[$alien]";
diag_preamble = |     diag "install_type   = ", $alien->install_type;
diag_preamble = |     diag "version        = ", $alien->version if defined $alien->version;
diag_preamble = |     diag "cflags         = ", $alien->cflags;
diag_preamble = |     diag "cflags_static  = ", $alien->cflags_static;
diag_preamble = |     diag "libs           = ", $alien->libs;
diag_preamble = |     diag "libs_static    = ", $alien->libs_static;
diag_preamble = |     diag "bin_dir        = ", $_ for $alien->bin_dir;
diag_preamble = |     diag "dynamic_libs   = ", $_ for $alien->dynamic_libs;
diag_preamble = |     diag '';
diag_preamble = |     diag '';
diag_preamble = |   }

diag_preamble = | };

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

# ABSTRACT: Legacy alien for libarchive
our $VERSION = '0.33'; # VERSION


sub new
{
  my($class) = @_;
  bless {}, $class;
}

sub cflags
{
  wantarray   ## no critic (Community::Wantarray)
    ? shellwords(Alien::Libarchive3->cflags)
    : Alien::Libarchive3->cflags;
}

sub libs
{
  wantarray   ## no critic (Community::Wantarray)
    ? shellwords(Alien::Libarchive3->libs)
    : Alien::Libarchive3->libs;
}

sub dlls

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


sub pkg_config_name
{
  'libarchive';
}

sub _macro_list
{
  require Config;

  my $cc = "$Config::Config{ccname} $Config::Config{ccflags} " . Alien::Libarchive3->cflags;

  my $tempdir = Path::Tiny->tempdir;
  my $file = path($tempdir, 'test.c');
  $file->spew(
    "#include <archive.h>\n#include <archive_entry.h>\n"
  );

  my @list;
  my $cmd = "$cc -E -dM $file";
  foreach my $line (`$cmd`)

t/00_diag.t  view on Meta::CPAN

    diag "dynamic_libs   = ", $_ for $alien->dynamic_libs;
    diag '';
    diag '';
  }
  foreach my $alien (qw( Alien::Nettle Alien::xz Alien::LZO Alien::Libbz2 Alien::Libxml2 Alien::Libarchive3 )) {
    eval qq{ require $alien; 1 };
    next if $@;
    diag "[$alien]";
    diag "install_type   = ", $alien->install_type;
    diag "version        = ", $alien->version if defined $alien->version;
    diag "cflags         = ", $alien->cflags;
    diag "cflags_static  = ", $alien->cflags_static;
    diag "libs           = ", $alien->libs;
    diag "libs_static    = ", $alien->libs_static;
    diag "bin_dir        = ", $_ for $alien->bin_dir;
    diag "dynamic_libs   = ", $_ for $alien->dynamic_libs;
    diag '';
    diag '';
  }
};

my @modules = sort keys %modules;

t/archive_libarchive.t  view on Meta::CPAN

use Test2::V0 -no_srand => 1;
use Alien::Libarchive;

# this test doesn't look too closely at what the compat layer
# is returning.  it mostly makes sure that it doesn't blow up.

subtest 'main' => sub {

  subtest 'scalar' => sub {

    note "cflags: ", scalar Alien::Libarchive->cflags;
    note "libs:   ", scalar Alien::Libarchive->libs;
    note "dlls:   ", scalar Alien::Libarchive->dlls;

    ok 1;

  };

  subtest 'list' => sub {

    note "cflags: ", $_ for Alien::Libarchive->cflags;
    note "libs:   ", $_ for Alien::Libarchive->libs;
    note "dlls:   ", $_ for Alien::Libarchive->dlls;

    ok 1;
  };

};

subtest 'version' => sub {



( run in 6.209 seconds using v1.01-cache-2.11-cpan-94b05bcf43c )