This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Module-Build to CPAN version 0.4005
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Fri, 24 May 2013 20:43:09 +0000 (21:43 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Fri, 24 May 2013 20:43:09 +0000 (21:43 +0100)
  [DELTA]

0.4005 - Thu Apr 25 15:10:14 CEST 2013

  [ENHANCEMENTS]

  - Added --pureperl-only support

  [BUG FIXES]

  - #72176: pod2html will fail with an empty podpath in some cases. [Phillip Moore]

  - Fix links between modules in HTML docs output [Michael Wild, Leon Timmermans]

0.4004 - Fri Mar 29 15:05:00 CET 2013

  [BUG FIXES]

  - Minor VMS fix for @INC [Craig Berry]

  [ENHANCEMENTS]

  - test_requires support has been added [Matsuno Tokuhiro]

33 files changed:
Porting/Maintainers.pl
cpan/Module-Build/Changes
cpan/Module-Build/lib/Module/Build.pm
cpan/Module-Build/lib/Module/Build/API.pod
cpan/Module-Build/lib/Module/Build/Authoring.pod
cpan/Module-Build/lib/Module/Build/Base.pm
cpan/Module-Build/lib/Module/Build/Compat.pm
cpan/Module-Build/lib/Module/Build/Config.pm
cpan/Module-Build/lib/Module/Build/Cookbook.pm
cpan/Module-Build/lib/Module/Build/Dumper.pm
cpan/Module-Build/lib/Module/Build/ModuleInfo.pm
cpan/Module-Build/lib/Module/Build/Notes.pm
cpan/Module-Build/lib/Module/Build/PPMMaker.pm
cpan/Module-Build/lib/Module/Build/Platform/Amiga.pm
cpan/Module-Build/lib/Module/Build/Platform/Default.pm
cpan/Module-Build/lib/Module/Build/Platform/EBCDIC.pm
cpan/Module-Build/lib/Module/Build/Platform/MPEiX.pm
cpan/Module-Build/lib/Module/Build/Platform/MacOS.pm
cpan/Module-Build/lib/Module/Build/Platform/RiscOS.pm
cpan/Module-Build/lib/Module/Build/Platform/Unix.pm
cpan/Module-Build/lib/Module/Build/Platform/VMS.pm
cpan/Module-Build/lib/Module/Build/Platform/VOS.pm
cpan/Module-Build/lib/Module/Build/Platform/Windows.pm
cpan/Module-Build/lib/Module/Build/Platform/aix.pm
cpan/Module-Build/lib/Module/Build/Platform/cygwin.pm
cpan/Module-Build/lib/Module/Build/Platform/darwin.pm
cpan/Module-Build/lib/Module/Build/Platform/os2.pm
cpan/Module-Build/lib/Module/Build/PodParser.pm
cpan/Module-Build/lib/inc/latest.pm
cpan/Module-Build/lib/inc/latest/private.pm
cpan/Module-Build/t/install.t
cpan/Module-Build/t/metadata.t
cpan/Module-Build/t/xs.t

index 38d72b2..628cde7 100755 (executable)
@@ -1188,7 +1188,7 @@ use File::Glob qw(:case);
 
     'Module::Build' => {
         'MAINTAINER'   => 'kwilliams',
-        'DISTRIBUTION' => 'LEONT/Module-Build-0.4003.tar.gz',
+        'DISTRIBUTION' => 'LEONT/Module-Build-0.4005.tar.gz',
         'FILES'        => q[cpan/Module-Build],
         'EXCLUDED'     => [
             qw( t/par.t
index 5d79968..fc37e21 100644 (file)
@@ -1,5 +1,27 @@
 Revision history for Perl extension Module::Build.
 
+0.4005 - Thu Apr 25 15:10:14 CEST 2013
+
+  [ENHANCEMENTS]
+
+  - Added --pureperl-only support
+
+  [BUG FIXES]
+
+  - #72176: pod2html will fail with an empty podpath in some cases. [Phillip Moore]
+
+  - Fix links between modules in HTML docs output [Michael Wild, Leon Timmermans]
+
+0.4004 - Fri Mar 29 15:05:00 CET 2013
+
+  [BUG FIXES]
+
+  - Minor VMS fix for @INC [Craig Berry]
+
+  [ENHANCEMENTS]
+
+  - test_requires support has been added [Matsuno Tokuhiro]
+
 0.4003 - Sat Aug 18 11:17:49 CEST 2012
 
   [BUG FIXES]
index fd835fc..3c964e7 100644 (file)
@@ -16,7 +16,7 @@ use Module::Build::Base;
 
 use vars qw($VERSION @ISA);
 @ISA = qw(Module::Build::Base);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 
index 4980218..2810c2b 100644 (file)
@@ -72,6 +72,13 @@ An array reference of files to be cleaned up when the C<clean> action
 is performed. See also the L<add_to_cleanup()|/"add_to_cleanup(@files)">
 method.
 
+=item allow_pureperl
+
+[version 0.4005]
+
+A bool indicating the module is still functional without its xs parts.
+When an XS module is build with --pureperl_only, it will otherwise fail.
+
 =item auto_configure_requires
 
 [version 0.34]
@@ -175,6 +182,15 @@ See L</auto_configure_requires> for details.
 See the documentation for L<Module::Build::Authoring/"PREREQUISITES">
 for the details of how requirements can be specified.
 
+=item test_requires
+
+[version 0.4004]
+
+Modules listed in this section must be installed before testing the distribution.
+
+See the documentation for L<Module::Build::Authoring/"PREREQUISITES">
+for the details of how requirements can be specified.
+
 =item create_packlist
 
 [version 0.28]
@@ -1753,7 +1769,7 @@ Examples:
 
 Returns a reference to a hash describing all prerequisites.  The keys of the
 hash will be the various prerequisite types ('requires', 'build_requires',
-'configure_requires', 'recommends', or 'conflicts') and the values will be
+'test_requires', 'configure_requires', 'recommends', or 'conflicts') and the values will be
 references to hashes of module names and version numbers.  Only prerequisites
 types that are defined will be included.  The C<prereq_data> action is just a
 thin wrapper around the C<prereq_data()> method and dumps the hash as a string
@@ -1916,6 +1932,8 @@ accessor methods for the following properties:
 
 =item allow_mb_mismatch()
 
+=item allow_pureperl()
+
 =item auto_configure_requires()
 
 =item autosplit()
@@ -2016,6 +2034,8 @@ accessor methods for the following properties:
 
 =item program_name()
 
+=item pureperl_only()
+
 =item quiet()
 
 =item recommends()
@@ -2034,6 +2054,8 @@ accessor methods for the following properties:
 
 =item test_file_exts()
 
+=item test_requires()
+
 =item use_rcfile()
 
 =item use_tap_harness()
index b1dc584..7bbf562 100644 (file)
@@ -183,6 +183,10 @@ ways to use this distribution without having them installed.  You
 might also think of this as "can use" or "is aware of" or "changes
 behavior in the presence of".
 
+=item test_requires
+
+Items that are necessary for testing.
+
 =item conflicts
 
 Items that can cause problems with this distribution when installed.
index cf42cc0..5fb8506 100644 (file)
@@ -6,7 +6,7 @@ use strict;
 use vars qw($VERSION);
 use warnings;
 
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 BEGIN { require 5.006001 }
 
@@ -922,6 +922,8 @@ __PACKAGE__->add_property(test_file_exts => ['.t']);
 __PACKAGE__->add_property(use_tap_harness => 0);
 __PACKAGE__->add_property(cpan_client => 'cpan');
 __PACKAGE__->add_property(tap_harness_args => {});
+__PACKAGE__->add_property(pureperl_only => 0);
+__PACKAGE__->add_property(allow_pureperl => 0);
 __PACKAGE__->add_property(
   'installdirs',
   default => 'site',
@@ -942,7 +944,7 @@ __PACKAGE__->add_property(
 }
 
 {
-  my @prereq_action_types = qw(requires build_requires conflicts recommends);
+  my @prereq_action_types = qw(requires build_requires test_requires conflicts recommends);
   foreach my $type (@prereq_action_types) {
     __PACKAGE__->add_property($type => {});
   }
@@ -1812,7 +1814,7 @@ sub print_build_script {
 
   my @myINC = $self->_added_to_INC;
   for (@myINC, values %q) {
-    $_ = File::Spec->canonpath( $_ );
+    $_ = File::Spec->canonpath( $_ ) unless $self->is_vmsish;
     s/([\\\'])/\\$1/g;
   }
 
@@ -1915,6 +1917,7 @@ sub create_mymeta {
     # XXX refactor this mapping somewhere
     $mymeta->{prereqs}{runtime}{requires} = $prereqs->{requires};
     $mymeta->{prereqs}{build}{requires} = $prereqs->{build_requires};
+    $mymeta->{prereqs}{test}{requires} = $prereqs->{test_requires};
     $mymeta->{prereqs}{runtime}{recommends} = $prereqs->{recommends};
     $mymeta->{prereqs}{runtime}{conflicts} = $prereqs->{conflicts};
     # delete empty entries
@@ -2119,6 +2122,8 @@ sub _translate_option {
     use_tap_harness
     tap_harness_args
     cpan_client
+    pureperl_only
+    allow_pureperl
   ); # normalize only selected option names
 
   return $opt;
@@ -2159,6 +2164,8 @@ sub _optional_arg {
     debug
     sign
     use_tap_harness
+    pureperl_only
+    allow_pureperl
   );
 
   # inverted boolean options; eg --noverbose or --no-verbose
@@ -2968,7 +2975,9 @@ sub process_PL_files {
 
 sub process_xs_files {
   my $self = shift;
+  return if $self->pureperl_only && $self->allow_pureperl;
   my $files = $self->find_xs_files;
+  croak 'Can\'t build xs files under --pureperl-only' if %$files && $self->pureperl_only;
   while (my ($from, $to) = each %$files) {
     unless ($from eq $to) {
       $self->add_to_cleanup($to);
@@ -3301,6 +3310,7 @@ sub _find_pods {
       foreach my $regexp ( @{ $args{exclude} } ) {
         next FILE if $file =~ $regexp;
       }
+      $file = $self->localize_file_path($file);
       $files{$file} = File::Spec->abs2rel($file, $dir) if $self->contains_pod( $file )
     }
   }
@@ -3358,11 +3368,11 @@ sub htmlify_pods {
               : $self->original_prefix('core');
 
   my $htmlroot = $self->install_sets('core')->{libhtml};
-  my @podpath = (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d  }
+  my @podpath = ( (map { File::Spec->abs2rel($_ ,$podroot) } grep { -d  }
     ( $self->install_sets('core', 'lib'), # lib
       $self->install_sets('core', 'bin'), # bin
       $self->install_sets('site', 'lib'), # site/lib
-    ) ), File::Spec->rel2abs($self->blib);
+    ) ), File::Spec->rel2abs($self->blib) );
 
   my $podpath = $ENV{PERL_CORE}
               ? File::Spec->catdir($podroot, 'lib')
@@ -3427,7 +3437,7 @@ sub htmlify_pods {
       } or $self->log_warn("[$htmltool] pod2html (" .
         join(", ", map { "q{$_} => q{$opts{$_}}" } (keys %opts)) . ") failed: $@");
     } else {
-      my $path2root = join( '/', ('..') x (@rootdirs+@dirs) );
+      my $path2root = File::Spec->catdir(File::Spec->updir x @dirs);
       my $fh = IO::File->new($infile) or die "Can't read $infile: $!";
       my $abstract = Module::Build::PodParser->new(fh => $fh)->get_abstract();
 
@@ -4094,9 +4104,9 @@ sub ACTION_disttest {
 
         $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
           or die "Error executing 'Build.PL' in dist directory: $!";
-        $self->run_perl_script('Build')
-          or die "Error executing 'Build' in dist directory: $!";
-        $self->run_perl_script('Build', [], ['test'])
+        $self->run_perl_script($self->build_script)
+          or die "Error executing $self->build_script in dist directory: $!";
+        $self->run_perl_script($self->build_script, [], ['test'])
           or die "Error executing 'Build test' in dist directory";
       });
 }
@@ -4110,9 +4120,9 @@ sub ACTION_distinstall {
     sub {
       $self->run_perl_script('Build.PL')
         or die "Error executing 'Build.PL' in dist directory: $!";
-      $self->run_perl_script('Build')
-        or die "Error executing 'Build' in dist directory: $!";
-      $self->run_perl_script('Build', [], ['install'])
+      $self->run_perl_script($self->build_script)
+        or die "Error executing $self->build_script in dist directory: $!";
+      $self->run_perl_script($self->build_script, [], ['install'])
         or die "Error executing 'Build install' in dist directory";
     }
   );
index 79499a6..504c6f9 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Compat;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 
 use File::Basename ();
 use File::Spec;
index 88a3ff3..9bb5e54 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Config;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Config;
 
index e66020c..84ef43a 100644 (file)
@@ -1,7 +1,7 @@
 package Module::Build::Cookbook;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 
 
 =head1 NAME
index 73839c7..7db6262 100644 (file)
@@ -1,7 +1,7 @@
 package Module::Build::Dumper;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 
 # This is just a split-out of a wrapper function to do Data::Dumper
 # stuff "the right way".  See:
index b36cc38..9309fe8 100644 (file)
@@ -4,7 +4,7 @@ package Module::Build::ModuleInfo;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 require Module::Metadata;
index 0477322..bd1433d 100644 (file)
@@ -4,7 +4,7 @@ package Module::Build::Notes;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Data::Dumper;
 use IO::File;
index 34f5495..a996e59 100644 (file)
@@ -5,7 +5,7 @@ use Config;
 use vars qw($VERSION);
 use IO::File;
 
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 # This code is mostly borrowed from ExtUtils::MM_Unix 6.10_03, with a
index 0be3dde..a0bf3bd 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::Amiga;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index 53bffc0..db6a63d 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::Default;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index 8c4349b..3829f44 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::EBCDIC;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index 5688a99..60728bd 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::MPEiX;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index 8b56766..e72ee77 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::MacOS;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 use vars qw(@ISA);
index 6ed9d3d..16fc776 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::RiscOS;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index e3d7ff5..2b514e4 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::Unix;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index 7ff7e05..d447fbc 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::VMS;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 use Config;
index 2578e31..db94bf4 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::VOS;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Base;
 
index e35e28f..859d1fb 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::Windows;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 use Config;
index 3833ceb..e8928ac 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::aix;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Platform::Unix;
 
index 15d3e81..136e853 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::cygwin;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Platform::Unix;
 
index 45d68fd..2f939a1 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::darwin;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Platform::Unix;
 
index 52d6e17..40797fb 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::Platform::os2;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use Module::Build::Platform::Unix;
 
index 6605fd4..ab4f467 100644 (file)
@@ -2,7 +2,7 @@ package Module::Build::PodParser;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 use vars qw(@ISA);
 
index b794c4a..631a234 100644 (file)
@@ -1,7 +1,7 @@
 package inc::latest;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 use Carp;
index 2a62c57..d17ecc1 100644 (file)
@@ -1,7 +1,7 @@
 package inc::latest::private;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4003';
+$VERSION = '0.4005';
 $VERSION = eval $VERSION;
 
 use File::Spec;
index 2d487f6..261411c 100644 (file)
@@ -209,14 +209,6 @@ Simple Man <simple@example.com>
   is keys %$pods, 1;
   my $expect = $mb->localize_file_path('lib/Simple/Docs.pod');
 
-  # TODO:
-  # True for traditional VMS, but will need to be changed when ODS-5 support
-  # for case preserved filenames is active.
-  # The issue is that the keys to the $pods hash are currently being set to
-  # lowercase on VMS so can not be found in exact case.
-
-  $expect = lc($expect) if $^O eq 'VMS';
-
   is $pods->{$expect}, $expect;
 
   my $pms = $mb->_find_file_by_type('awefawef', 'lib');
index f9ce95e..d728a68 100644 (file)
@@ -2,7 +2,7 @@
 
 use strict;
 use lib 't/lib';
-use MBTest tests => 51;
+use MBTest tests => 52;
 
 blib_load('Module::Build');
 blib_load('Module::Build::ConfigData');
@@ -15,6 +15,9 @@ my %metadata =
    dist_version  => '3.14159265',
    dist_author   => [ 'Simple Simon <ss\@somewhere.priv>' ],
    dist_abstract => 'Something interesting',
+   test_requires => {
+       'Test::More' => 0.98,
+   },
    license       => 'perl',
    meta_add => {
                keywords  => [qw(super duper something)],
@@ -80,6 +83,9 @@ my $mb = Module::Build->new_from_context;
   is_deeply $node->{author}, $metadata{dist_author};
   is $node->{license}, $metadata{license};
   is_deeply $node->{configure_requires}, $mb_config_req, 'Add M::B to configure_requires';
+  is_deeply $node->{test_requires}, {
+      'Test::More' => '0.98',
+  }, 'Test::More was required by ->new';
   like $node->{generated_by}, qr{Module::Build};
   ok defined( $node->{'meta-spec'}{version} ),
       "'meta-spec' -> 'version' field present in META.yml";
index 84f82d9..6d81361 100644 (file)
@@ -19,7 +19,7 @@ blib_load('Module::Build');
   } elsif ( !$Config{usedl} ) {
     plan skip_all => 'Perl not compiled for dynamic loading'
   } else {
-    plan tests => 20;
+    plan tests => 22;
   }
   require Cwd;
   $tmp = MBTest->tmpdir( $tmp_exec ? () : (DIR => Cwd::cwd) );
@@ -117,6 +117,14 @@ is $@, '';
 stdout_stderr_of( sub { eval { $mb->dispatch('test') } } );
 is $@, '';
 
+eval { $mb->dispatch('clean') };
+
+eval { $mb->dispatch('build', 'pureperl_only' => 1) };
+like $@, qr/\ACan\'t build xs files under --pureperl-only/, 'Can\'t build xs under pureperl';
+
+eval { $mb->dispatch('build', pureperl_only => 1, allow_pureperl => 1) };
+is $@, '', 'Can\'t build xs under pureperl, unless allow_pureperl';
+
 eval { $mb->dispatch('realclean') };
 is $@, '';