diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm | 74 |
1 files changed, 54 insertions, 20 deletions
diff --git a/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm b/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm index 4422b686ce7..be9624e389e 100644 --- a/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm +++ b/Master/tlpkg/tlperl/lib/ExtUtils/MakeMaker.pm @@ -18,7 +18,7 @@ our @Overridable; my @Prepend_parent; my %Recognized_Att_Keys; -our $VERSION = '6.56'; +our $VERSION = '6.57_05'; # Emulate something resembling CVS $Revision$ (our $Revision = $VERSION) =~ s{_}{}; @@ -52,6 +52,8 @@ sub WriteMakefile { require ExtUtils::MY; my %att = @_; + _convert_compat_attrs(\%att); + _verify_att(\%att); my $mm = MM->new(\%att); @@ -66,6 +68,7 @@ sub WriteMakefile { # scalar. my %Att_Sigs; my %Special_Sigs = ( + AUTHOR => 'ARRAY', C => 'ARRAY', CONFIG => 'ARRAY', CONFIGURE => 'CODE', @@ -111,6 +114,19 @@ my %Special_Sigs = ( @Att_Sigs{keys %Recognized_Att_Keys} = ('') x keys %Recognized_Att_Keys; @Att_Sigs{keys %Special_Sigs} = values %Special_Sigs; +sub _convert_compat_attrs { + my($att) = @_; + if (exists $att->{AUTHOR}) { + if ($att->{AUTHOR}) { + if (!ref($att->{AUTHOR})) { + my $t = $att->{AUTHOR}; + $att->{AUTHOR} = [$t]; + } + } else { + $att->{AUTHOR} = []; + } + } +} sub _verify_att { my($att) = @_; @@ -257,8 +273,8 @@ sub full_setup { INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES CONFIGURE_REQUIRES - MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE - PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE + MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NO_MYMETA NORECURS NO_VC OBJECT + OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE PERL_SRC PERM_DIR PERM_RW PERM_RWX PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ @@ -409,7 +425,7 @@ sub new { } print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose; - if (-f "MANIFEST" && ! -f "Makefile"){ + if (-f "MANIFEST" && ! -f "Makefile" && ! $ENV{PERL_CORE}){ check_manifest(); } @@ -467,14 +483,16 @@ END if (!$installed_file) { warn sprintf "Warning: prerequisite %s %s not found.\n", $prereq, $required_version - unless $self->{PREREQ_FATAL}; + unless $self->{PREREQ_FATAL} + or $ENV{PERL_CORE}; $unsatisfied{$prereq} = 'not installed'; } elsif ($pr_version < $required_version ){ warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n", $prereq, $required_version, ($pr_version || 'unknown version') - unless $self->{PREREQ_FATAL}; + unless $self->{PREREQ_FATAL} + or $ENV{PERL_CORE}; $unsatisfied{$prereq} = $required_version ? $required_version : 'unknown version' ; } @@ -494,6 +512,7 @@ END if (defined $self->{CONFIGURE}) { if (ref $self->{CONFIGURE} eq 'CODE') { %configure_att = %{&{$self->{CONFIGURE}}}; + _convert_compat_attrs(\%configure_att); $self = { %$self, %configure_att }; } else { Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n"; @@ -998,16 +1017,23 @@ sub flush { or die "Unable to open MakeMaker.tmp: $!"; for my $chunk (@{$self->{RESULT}}) { - print $fh "$chunk\n"; + print $fh "$chunk\n" + or die "Can't write to MakeMaker.tmp: $!"; } - close $fh; + close $fh + or die "Can't write to MakeMaker.tmp: $!"; _rename("MakeMaker.tmp", $finalname) or warn "rename MakeMaker.tmp => $finalname: $!"; chmod 0644, $finalname unless $Is_VMS; - my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE); + unless ($self->{NO_MYMETA}) { + # Write MYMETA.yml to communicate metadata up to the CPAN clients + print STDOUT "Writing MYMETA.yml\n"; + $self->write_mymeta( $self->mymeta ); + } + my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE); if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) { foreach (keys %$self) { # safe memory delete $self->{$_} unless $keep{$_}; @@ -1017,7 +1043,6 @@ sub flush { system("$Config::Config{eunicefix} $finalname") unless $Config::Config{eunicefix} eq ":"; } - # This is a rename for OS's where the target must be unlinked first. sub _rename { my($src, $dest) = @_; @@ -1465,8 +1490,9 @@ the first line in the "=head1 NAME" section. $2 becomes the abstract. =item AUTHOR -String containing name (and email address) of package author(s). Is used -in PPD (Perl Package Description) files for PPM (Perl Package Manager). +Array of strings containing name (and email address) of package author(s). +Is used in META.yml and PPD (Perl Package Description) files for PPM (Perl +Package Manager). =item BINARY_LOCATION @@ -1940,7 +1966,7 @@ may hold a name for that binary. Defaults to perl A hashrefs of items to add to the F<META.yml>. They differ in how they behave if they have the same key as the -default metadata. META_ADD will override the default value with it's +default metadata. META_ADD will override the default value with its own. META_MERGE will merge its value with the default. Unless you want to override the defaults, prefer META_MERGE so as to @@ -1990,6 +2016,13 @@ the META.yml module meta-data file during 'make distdir'. Defaults to false. +=item NO_MYMETA + +When true, suppresses the generation of MYMETA.yml module meta-data file +during 'perl Makefile.PL'. + +Defaults to false. + =item NO_VC In general, any generated Makefile checks for the current version of @@ -2225,18 +2258,17 @@ will C<die> instead of simply informing the user of the missing dependencies. It is I<extremely> rare to have to use C<PREREQ_FATAL>. Its use by module authors is I<strongly discouraged> and should never be used lightly. + Module installation tools have ways of resolving umet dependencies but to do that they need a F<Makefile>. Using C<PREREQ_FATAL> breaks this. That's bad. -The only situation where it is appropriate is when you have -dependencies that are indispensible to actually I<write> a -F<Makefile>. For example, MakeMaker's F<Makefile.PL> needs L<File::Spec>. -If its not available it cannot write the F<Makefile>. +Assuming you have good test coverage, your tests should fail with +missing dependencies informing the user more strongly that something +is wrong. You can write a F<t/00compile.t> test which will simply +check that your code compiles and stop "make test" prematurely if it +doesn't. See L<Test::More/BAIL_OUT> for more details. -Note: see L<Test::Harness> for a shortcut for stopping tests early -if you are missing dependencies and are afraid that users might -use your module with an incomplete environment. =item PREREQ_PM @@ -2796,6 +2828,8 @@ generated Makefile along with your report. For more up-to-date information, see L<http://www.makemaker.org>. +Repository available at L<http://github.com/schwern/extutils-makemaker>. + =head1 LICENSE This program is free software; you can redistribute it and/or |