Patch off svn.perl.org\...\Module-Build\trunk attached.
Note that this patch makes t\compat.t fail if the MB_TEST_EXPERIMENTAL
environment variable is defined. My assumption as to why would be that
t\compat.t does not know how to make a bundled environment to test the
new 'bundled' Makefile.PL type. Maybe others would like to add that in -
but I know that we at least should start thinking about how to test
the ability.
You may wish to only apply the lib\Module\Build\Compat.pm portion of
the patch because of this at the moment.
('bundled' is what I called the type. You may wish to use a different
name. The patch adds the code and documentation to
lib\Module\Build\Compat.pm, and starts adding testing code to
t\compat.t.)
Index: lib/Module/Build/Compat.pm
===================================================================
--- lib/Module/Build/Compat.pm (revision 13768)
+++ lib/Module/Build/Compat.pm (working copy)
@@ -97,7 +97,7 @@
my ($package, $type, $build, %args) = @_;
die "Don't know how to build Makefile.PL of type '$type'"
- unless $type =~ /^(small|passthrough|traditional)$/;
+ unless $type =~ /^(small|passthrough|traditional|bundled)$/;
if ($type eq 'passthrough') {
$build->log_warn(<<"HERE");
@@ -161,6 +161,15 @@
Module::Build::Compat->write_makefile(build_class => '%s');
EOF
+ } elsif ($type eq 'bundled') {
+ printf {$fh} <<'EOF', $subclass_load, ref($build), ref($build);
+ use inc::latest Module::Build::Compat 0.02;
+ %s
+ Module::Build::Compat->run_build_pl(args => \@ARGV);
+ use inc::latest %s;
+ Module::Build::Compat->write_makefile(build_class => '%s');
+EOF
+
} elsif ($type eq 'passthrough') {
printf {$fh} <<'EOF', $subclass_load, ref($build), ref($build);
@@ -505,6 +514,13 @@
already have C<Module::Build> installed in order to use this, or else
they'll get a module-not-found error.
+=item bundled (NEW)
+
+A small F<Makefile.PL> will be created that passes all functionality
+through to the F<Build.PL> script in the same directory. The user must
+bundle C<Module::Build> with C<inc::latest> in order to use this, or else
+they'll get a module-not-found error.
+
=item passthrough (DEPRECATED)
This is just like the C<small> option above, but if C<Module::Build> is
Index: t/compat.t
===================================================================
--- t/compat.t (revision 13768)
+++ t/compat.t (working copy)
@@ -13,6 +13,7 @@
delete @ENV{@makefile_keys};
my @makefile_types = qw(small passthrough traditional);
+push @makefile_types, 'bundled' if defined $ENV{MB_TEST_EXPERIMENTAL};
my $tests_per_type = 15;
#find_in_path does not understand VMS.