Subject: | Module::Build::Compat generates a Makefile.PL without EXE_FILES == script_files |
Module::Build::Compat generates a Makefile.PL (under traditional mode) which doesn't contain EXE_FILES corresponding to the $build->script_files parameter, should the latter exist.
This results in the executable files not being installed when using Makefile.PL
Attached is a qnd patch to allow that.
I think the writing of the makefile shouldn't be atomical though, and should allow easier addition of more parameters, should the need for them arise.
Use of some kind of serializer, possibly Data::Dumper, wrapped in some constant strings, is probably more of a Good Thing.
Perhaps something like
print Data::Dumper::Dumper($makemaker_params), <<EOF;
use ExtUtils::MakeMaker;
WriteMakefile(%$VAR1);
EOF;
Only in Module-Build-0.22-Makefile.PL-traditional-EXE_FILES/: Build
Only in Module-Build-0.22-Makefile.PL-traditional-EXE_FILES/: _build
diff -ur Module-Build-0.22/lib/Module/Build/Compat.pm Module-Build-0.22-Makefile.PL-traditional-EXE_FILES/lib/Module/Build/Compat.pm
--- Module-Build-0.22/lib/Module/Build/Compat.pm Sun Jan 11 06:19:59 2004
+++ Module-Build-0.22-Makefile.PL-traditional-EXE_FILES/lib/Module/Build/Compat.pm Sat Jan 17 13:55:03 2004
@@ -84,7 +84,22 @@
: (VERSION => $build->dist_version)
);
- printf {$fh} <<'EOF', $name_key, $name, %v, $id, $prereq;
+ my $extra = ""; # anything extra going into the makefile
+ if ($build->script_files){ # if there are script files, executables, to be installed in the path, add the data for them
+
+ $extra .= sprintf(
+ " %-12s => [ %s ],\n", # that's the format
+ "EXE_FILES", # the key of the parameter for ExtUtils::MakeMaker
+ join(", ", map { "'$_'" } # quote the strings, and join them together
+ ( $build->script_files =~ /ARRAY/ # script_files can be a hash ref
+ ? @{ $build->script_files }
+ : keys %{ $build->script_files } # Module::Build says: 'or as a hash reference whose keys are the files (and whose values will currently be ignored)'
+ )
+ )
+ );
+ }
+
+ printf {$fh} <<'EOF', $name_key, $name, %v, $id, $prereq, $extra;
# Generated by Module::Build::Compat->create_makefile_pl
use ExtUtils::MakeMaker;
@@ -97,7 +112,7 @@
PREREQ_PM => {
%s
},
- );
+%s );
EOF
}
}