Alien-CPython3

 view release on metacpan or  search on metacpan

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

package Alien::CPython3;
$Alien::CPython3::VERSION = '0.01';
use strict;
use warnings;
use base qw( Alien::Base );
use 5.008004;

use Path::Tiny qw(path);

sub exe {
  my($class) = @_;
  $class->runtime_prop->{command};
}

sub bin_dir {
	my $class = shift;
  if($class->install_type('share') && defined $class->runtime_prop->{share_bin_dir_rel}) {
		my $prop = $class->runtime_prop;
		return
			map { path($_)->absolute($class->dist_dir)->stringify }
			ref $prop->{share_bin_dir_rel} ? @{ $prop->{share_bin_dir_rel} } : ($prop->{share_bin_dir_rel});
	} else {
		return $class->SUPER::bin_dir(@_);
	}
}

1;

=head1 NAME

Alien::CPython3 - Find or build Python

=head1 SYNOPSIS

From L<ExtUtils::MakeMaker>:

 use ExtUtils::MakeMaker;
 use Alien::Base::Wrapper ();

 WriteMakefile(
   Alien::Base::Wrapper->new('Alien::CPython3')->mm_args2(
     NAME => 'FOO::XS',
     ...
   ),
 );

From L<Module::Build>:

 use Module::Build;
 use Alien::Base::Wrapper qw( Alien::CPython3 !export );
 use Alien::CPython3;

 my $build = Module::Build->new(
   ...
   configure_requires => {
     'Alien::Base::Wrapper' => '0',
     'Alien::CPython3' => '0',
     ...
   },
   Alien::Base::Wrapper->mb_args,
   ...
 );

 $build->create_build_script;

From L<Inline::C> / L<Inline::CPP> script:

 use Inline 0.56 with => 'Alien::CPython3';

From L<Dist::Zilla>

 [@Filter]
 -bundle = @Basic
 -remove = MakeMaker

 [Prereqs / ConfigureRequires]
 Alien::CPython3 = 0

 [MakeMaker::Awesome]
 header = use Alien::Base::Wrapper qw( Alien::CPython3 !export );
 WriteMakefile_arg = Alien::Base::Wrapper->mm_args

Command line tool:



( run in 2.127 seconds using v1.01-cache-2.11-cpan-524268b4103 )