CPAN-Plugin-Sysdeps

 view release on metacpan or  search on metacpan

lib/CPAN/Plugin/Sysdeps.pm  view on Meta::CPAN


=over

=item * Minimal requirements

CPAN.pm supports the plugin system since 2.07. If the CPAN.pm is
older, then still the C<cpan-sysdeps> script can be used.

It is assumed that some system dependencies are still installed: a
C<make>, a suitable C compiler, maybe C<sudo>, C<patch> (e.g. if there
are distroprefs using patch files) and of course C<perl>. On linux
systems, the file F</etc/os-release> is required, otherwise fallbacks
using C<lsb-release> and F</etc/redhat-release> and F</etc/issue> are
trued.. On Mac OS X systems C<homebrew> has to be installed.

=item * Batch mode

Make sure to configure the plugin with the C<batch> keyword (but read
also L</Conflicting packages>). In F<CPAN/MyConfig.pm>:

  'plugin_list' => [q[CPAN::Plugin::Sysdeps=batch]],

lib/CPAN/Plugin/Sysdeps/Mapping.pm  view on Meta::CPAN

       [package => 'libzbar-dev']],
      [like_fedora,
       [package => 'zbar-devel']],
      [os_darwin,
       [package => 'zbar']], # but tests fails (Barcode-ZBar-0.04)
     ],

     [cpanmod => ['BerkeleyDB', 'BDB'],
      [os_freebsd,
       # FreeBSD has libdb in the base system, but this version is too old.
       # Make sure that a corresponding distroprefs file matches this library.
       [package => 'db18']],
      [like_debian,
       [linuxdistrocodename => 'squeeze',
	[package => 'libdb4.8-dev']],
       [linuxdistrocodename => ['wheezy', 'precise'],
	[package => 'libdb5.1-dev']],
       [package => 'libdb5.3-dev']], # e.g. jessie, stretch, trusty, xenial, yakkety, zesty
      [os_darwin,
       # Make sure that a corresponding distroprefs file matches this library (see srezic-cpan-distroprefs).
       [package => 'berkeley-db']],
      [like_fedora,
       [package => 'libdb-devel']],
     ],

     [cpanmod => 'Bio::HTS',
      [os_freebsd,
       # htslib exists, but does not seem to be compatible with the perl module
       [package => 'htslib']],
      [like_debian,

lib/CPAN/Plugin/Sysdeps/Mapping.pm  view on Meta::CPAN

      [os_openbsd,
       [package => 'xz']],
      [like_debian,
       [package => 'liblzma-dev']],
      [os_darwin,
       [package => 'xz']],
     ],

     # Try also the patches listed in
     # https://rt.cpan.org/Ticket/Display.html?id=86115
     # (or the corresponding srezic-cpan-distroprefs file)
     [cpanmod => 'Compress::LZO',
      [os_freebsd,
       [package => 'lzo2']],
      [like_debian,
       [package => 'liblzo2-dev']],
      [like_fedora,
       [package => 'lzo-devel']],
      [os_darwin,
       [package => 'lzo']],
     ],

lib/CPAN/Plugin/Sysdeps/Mapping.pm  view on Meta::CPAN

     
     [cpanmod => 'DNS::LDNS',
      [os_freebsd,
       [package => 'ldns']],
      [os_dragonfly,
       [package => 'ldns']],
      [like_debian,
       [package => 'libldns-dev']],
      [like_fedora,
       [package => 'ldns-devel']],
      # additionally needs to be patched, see https://github.com/eserte/srezic-cpan-distroprefs/blob/master/DNS-LDNS.yml
      [os_darwin,
       [package => 'ldns']]],

     [cpanmod => ['DNS::Unbound', 'Net::DNS::Resolver::Unbound'],
     #[cpandist => qr{^DNS-Unbound-\d},
      [os_freebsd,
       [package => 'unbound']], # build problems with DNS::Unbound: port's pkg-config file references ssl & crypto, but these are already in base system
      [like_debian,
       [package => 'libunbound-dev']],
      [like_fedora,

lib/CPAN/Plugin/Sysdeps/Mapping.pm  view on Meta::CPAN

      [os_freebsd,
       [package => 'fftw3']],
      [like_debian,
       [package => 'libfftw3-dev']],
      [like_fedora,
       [package => 'fftw-devel']],
     ],

     [cpanmod => 'Math::GammaFunction',
      [os_freebsd,
       # NOTE there's an entry in .cpan/prefs/01.DISABLED.yml
       [package => 'libRmath']],
      [like_debian,
       # not for small disks, installs about ~85MB
       [package => 'r-mathlib']],
      [like_fedora,
       [package => 'libRmath-devel']],
     ],

     [cpanmod => 'Math::GAP',
      [package => 'gap'], # needs 1-1.2GB of disk space

script/test-sysdeps-roundtrip  view on Meta::CPAN

use Getopt::Long;

defined $ENV{PERL_LOCAL_LIB_ROOT}
    or die <<"EOF";
Please make sure local::lib is in effect, e.g. by running

    eval \$($^X -Mlocal::lib)

EOF

my $nodistroprefs;
GetOptions(
	   'distroprefs!' => sub {
	       $nodistroprefs = 1 if !$_[1];
	   },
	   'pre=s@' => \my @pre,
	   'debug' => \my $debug,
	  )
    or die "usage?";

my @mod_or_dist = @ARGV;
if (!@mod_or_dist) {
    die "Please specify one or more modules or dists!\n";
}

script/test-sysdeps-roundtrip  view on Meta::CPAN

system('make', 'install');

my $srezic_misc_dir = "$ENV{HOME}/src/srezic-misc/scripts";

for my $mod_or_dist (@mod_or_dist) {
    {
	my @cmd = (
		   ($debug ? ('env', 'CPAN_PLUGIN_SYSDEPS_DEBUG=1') : ()),
		   "$srezic_misc_dir/sudo_keeper", "$srezic_misc_dir/cpan_smoke_modules",
		   "-notypescript", # because of sudo
		   ($nodistroprefs ? '-nodistroprefs' : ()),
		   (map { ('-pre', $_) } @pre),
		   "-perl", $^X, $mod_or_dist,
		  );
	warn "INFO: @cmd\n";
	system @cmd;
	if ($? != 0) {
	    warn "ERROR: No success running @cmd.\n";
	}
    }

t/cpan_dot.t  view on Meta::CPAN


isa_ok $p, 'CPAN::Plugin::Sysdeps';
my $cpandist = CPAN::Distribution->new(
    "CALLED_FOR" => "/home/user/src/CPAN/XML-Parser/.",
    "CONTAINSMODS" => {},
    "ID" => "/home/user/src/CPAN/XML-Parser/.",
    "archived" => "local_directory",
    "build_dir" => "/home/user/src/CPAN/XML-Parser/.",
    "incommandcolor" => 1,
    "mandatory" => !!1,
    "negative_prefs_cache" => 0,
    "prefs" => {},
    "reqtype" => "c",
    "unwrapped" => bless( {
	"COMMANDID" => 0,
	"FAILED" => !!0,
	"TEXT" => "YES -- local_directory",
	"TIME" => 1777023381
    }, 'CPAN::Distrostatus'),
);
is_deeply $p->{_mapper_ran}, {}, 'mapper did not yet ran';
{



( run in 1.109 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )