Base.pm (Module-Build-0.4232) | : | Base.pm (Module-Build-0.4234) | ||
---|---|---|---|---|
# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- | # -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- | |||
# vim:ts=8:sw=2:et:sta:sts=2 | # vim:ts=8:sw=2:et:sta:sts=2 | |||
package Module::Build::Base; | package Module::Build::Base; | |||
use 5.006; | use 5.006; | |||
use strict; | use strict; | |||
use warnings; | use warnings; | |||
our $VERSION = '0.4232'; | our $VERSION = '0.4234'; | |||
$VERSION = eval $VERSION; | $VERSION = eval $VERSION; | |||
use Carp; | use Carp; | |||
use Cwd (); | use Cwd (); | |||
use File::Copy (); | use File::Copy (); | |||
use File::Find (); | use File::Find (); | |||
use File::Path (); | use File::Path (); | |||
use File::Basename (); | use File::Basename (); | |||
use File::Spec 0.82 (); | use File::Spec 0.82 (); | |||
use File::Compare (); | use File::Compare (); | |||
skipping to change at line 1521 | skipping to change at line 1521 | |||
my ($self) = @_; | my ($self) = @_; | |||
my $p = $self->{properties}; | my $p = $self->{properties}; | |||
# If needs_compiler is not explicitly set, automatically set it | # If needs_compiler is not explicitly set, automatically set it | |||
# If set, we need ExtUtils::CBuilder (and a compiler) | # If set, we need ExtUtils::CBuilder (and a compiler) | |||
my $xs_files = $self->find_xs_files; | my $xs_files = $self->find_xs_files; | |||
if ( ! defined $p->{needs_compiler} ) { | if ( ! defined $p->{needs_compiler} ) { | |||
if ( $self->pureperl_only && $self->allow_pureperl ) { | if ( $self->pureperl_only && $self->allow_pureperl ) { | |||
$self->needs_compiler( 0 ); | $self->needs_compiler( 0 ); | |||
} else { | } else { | |||
$self->needs_compiler( keys %$xs_files || defined $self->c_source ); | $self->needs_compiler( keys %$xs_files || | |||
( defined $self->c_source && | ||||
( ref($self->c_source) ne 'ARRAY' || @{$self->c_source} ) | ||||
) | ||||
); | ||||
} | } | |||
} | } | |||
if ($self->needs_compiler) { | if ($self->needs_compiler) { | |||
$self->_add_prereq('build_requires', 'ExtUtils::CBuilder', 0); | $self->_add_prereq('build_requires', 'ExtUtils::CBuilder', 0); | |||
if ( ! $self->have_c_compiler ) { | if ( ! $self->have_c_compiler ) { | |||
$self->log_warn(<<'EOM'); | $self->log_warn(<<'EOM'); | |||
Warning: ExtUtils::CBuilder not installed or no compiler detected | Warning: ExtUtils::CBuilder not installed or no compiler detected | |||
Proceeding with configuration, but compilation may fail during Build | Proceeding with configuration, but compilation may fail during Build | |||
EOM | EOM | |||
skipping to change at line 3220 | skipping to change at line 3224 | |||
exclude => [ $self->file_qr('\.bat$') ] ); | exclude => [ $self->file_qr('\.bat$') ] ); | |||
next unless %$files; | next unless %$files; | |||
my $sub = $self->can("manify_${type}_pods"); | my $sub = $self->can("manify_${type}_pods"); | |||
$self->$sub( %extra_manify_args ) if defined( $sub ); | $self->$sub( %extra_manify_args ) if defined( $sub ); | |||
} | } | |||
} | } | |||
sub manify_bin_pods { | sub manify_bin_pods { | |||
my $self = shift; | my $self = shift; | |||
my %podman_args = (section => 1, @_); # binaries go in section 1 | my $section = $self->config('man1ext'); | |||
my %podman_args = (section => $section, @_); | ||||
my $files = $self->_find_pods( $self->{properties}{bindoc_dirs}, | my $files = $self->_find_pods( $self->{properties}{bindoc_dirs}, | |||
exclude => [ $self->file_qr('\.bat$') ] ); | exclude => [ $self->file_qr('\.bat$') ] ); | |||
return unless keys %$files; | return unless keys %$files; | |||
my $mandir = File::Spec->catdir( $self->blib, 'bindoc' ); | my $mandir = File::Spec->catdir( $self->blib, 'bindoc' ); | |||
File::Path::mkpath( $mandir, 0, oct(777) ); | File::Path::mkpath( $mandir, 0, oct(777) ); | |||
require Pod::Man; | require Pod::Man; | |||
foreach my $file (sort keys %$files) { | foreach my $file (sort keys %$files) { | |||
skipping to change at line 3247 | skipping to change at line 3252 | |||
next if $self->up_to_date( $file, $outfile ); | next if $self->up_to_date( $file, $outfile ); | |||
$self->log_verbose("Manifying $file -> $outfile\n"); | $self->log_verbose("Manifying $file -> $outfile\n"); | |||
eval { $parser->parse_from_file( $file, $outfile ); 1 } | eval { $parser->parse_from_file( $file, $outfile ); 1 } | |||
or $self->log_warn("Error creating '$outfile': $@\n"); | or $self->log_warn("Error creating '$outfile': $@\n"); | |||
$files->{$file} = $outfile; | $files->{$file} = $outfile; | |||
} | } | |||
} | } | |||
sub manify_lib_pods { | sub manify_lib_pods { | |||
my $self = shift; | my $self = shift; | |||
my %podman_args = (section => 3, @_); # libraries go in section 3 | my $section = $self->config('man3ext'); | |||
my %podman_args = (section => $section, @_); | ||||
my $files = $self->_find_pods($self->{properties}{libdoc_dirs}); | my $files = $self->_find_pods($self->{properties}{libdoc_dirs}); | |||
return unless keys %$files; | return unless keys %$files; | |||
my $mandir = File::Spec->catdir( $self->blib, 'libdoc' ); | my $mandir = File::Spec->catdir( $self->blib, 'libdoc' ); | |||
File::Path::mkpath( $mandir, 0, oct(777) ); | File::Path::mkpath( $mandir, 0, oct(777) ); | |||
require Pod::Man; | require Pod::Man; | |||
foreach my $file (sort keys %$files) { | foreach my $file (sort keys %$files) { | |||
# Pod::Simple based parsers only support one document per instance. | # Pod::Simple based parsers only support one document per instance. | |||
skipping to change at line 4941 | skipping to change at line 4947 | |||
} | } | |||
sub make_tarball { | sub make_tarball { | |||
my ($self, $dir, $file) = @_; | my ($self, $dir, $file) = @_; | |||
$file ||= $dir; | $file ||= $dir; | |||
$self->log_info("Creating $file.tar.gz\n"); | $self->log_info("Creating $file.tar.gz\n"); | |||
if ($self->{args}{tar}) { | if ($self->{args}{tar}) { | |||
my $tar_flags = $self->verbose ? 'cvf' : 'cf'; | my $tar_flags = $self->verbose ? 'cvf' : 'cf'; | |||
# See ExtUtils::MM_Darwin | ||||
# 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE. | ||||
# 10.5 wants COPYFILE_DISABLE. | ||||
# So just set both. | ||||
local $ENV{COPY_EXTENDED_ATTRIBUTES_DISABLE} = 1 if $^O eq 'darwin'; | ||||
local $ENV{COPYFILE_DISABLE} = 1 if $^O eq 'darwin'; | ||||
$self->do_system($self->split_like_shell($self->{args}{tar}), $tar_flags, "$ file.tar", $dir); | $self->do_system($self->split_like_shell($self->{args}{tar}), $tar_flags, "$ file.tar", $dir); | |||
$self->do_system($self->split_like_shell($self->{args}{gzip}), "$file.tar") if $self->{args}{gzip}; | $self->do_system($self->split_like_shell($self->{args}{gzip}), "$file.tar") if $self->{args}{gzip}; | |||
} else { | } else { | |||
eval { require Archive::Tar && Archive::Tar->VERSION(1.09); 1 } | eval { require Archive::Tar && Archive::Tar->VERSION(1.09); 1 } | |||
or die "You must install Archive::Tar 1.09+ to make a distribution tarball \n". | or die "You must install Archive::Tar 1.09+ to make a distribution tarball \n". | |||
"or specify a binary tar program with the '--tar' option.\n". | "or specify a binary tar program with the '--tar' option.\n". | |||
"See the documentation for the 'dist' action.\n"; | "See the documentation for the 'dist' action.\n"; | |||
my $files = $self->rscan_dir($dir); | my $files = $self->rscan_dir($dir); | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 18 lines changed or added |