Commits

Burak Gürsoy  committed f77fdb5

Make the hook wrapper on-demand again.
Accidentally included to each distro after previous refactoring.

  • Participants
  • Parent commits 15c83ab

Comments (0)

Files changed (3)

File builder/builder/lib/Build.pm

 sub _vanilla_makefile_pl {
     my $self = shift;
     my $hook = $self->initialization_hook;
+
+    if ( $hook ) {
+        $hook = $self->_compile_template(
+                    'tools/Makefile.PL.hook' => {
+                        hook => $hook,
+                    },
+                ),
+    }
+
     return join q{},
                 $self->_automatic_build_file_header,
                 $self->_compile_template(
                     'tools/Makefile.PL' => {
-                        hook     => $hook,
-                        has_hook => $hook ? 1 : 0,
+                        hook => $hook || q{},
                     },
                 ),
             ;

File builder/builder/templates/tools/Makefile.PL

 
 my %spec = mm_spec;
 
-if ([%HAS_HOOK%]) {
-    my $eok = eval <<'THIS_IS_SOME_IDENTIFIER';
 [%HOOK%]
-THIS_IS_SOME_IDENTIFIER
-
-    die "Error compiling initialization_hook: $@\n" if $@;
-}
 
 WriteMakefile(
     NAME         => $spec{module_name},

File builder/builder/templates/tools/Makefile.PL.hook

+my $eok = eval <<'THIS_IS_SOME_IDENTIFIER';
+[%HOOK%]
+THIS_IS_SOME_IDENTIFIER
+
+die "Error compiling initialization_hook: $@\n" if $@;