@@ -1286,6 +1286,7 @@ sub Build {
12861286
12871287 # pack
12881288 my $APPPATH = " $TEMPDIR /" .basename($PERL_APE );
1289+ my $PERLPATH = " $TEMPDIR /perl" ;
12891290 my $packAPE = sub {
12901291 my $copyexe = sub {
12911292 my ($srcpath , $destpath ) = @_ ;
@@ -1309,6 +1310,8 @@ sub Build {
13091310 chdir ($ZIP_ROOT ) or die " failed to enter ziproot" ;
13101311 _command_or_die($zippath // _find_zip(), ' -r' , $APPPATH , @zipfiles );
13111312 }
1313+ $copyexe -> ($APPPATH , $PERLPATH );
1314+ _command_or_die($PERLPATH , ' --assimilate' );
13121315 };
13131316 $packAPE -> ();
13141317
@@ -1362,11 +1365,21 @@ sub Build {
13621365 my $perlbindir = " $TEMPDIR /perlbin" ;
13631366 print " mkdir -p $perlbindir \n " ;
13641367 make_path($perlbindir );
1368+ print " Mapping core scripts to run with $PERLPATH \n " ;
13651369 opendir (my $dh , $perlbin ) or die " failed to open perlbin" ;
13661370 while (my $file = readdir ($dh )) {
13671371 next if ($file eq ' .' || $file eq ' ..' );
1368- print " ln -s $APPPATH $perlbindir /$file \n " ;
1369- symlink ($APPPATH , " $perlbindir /$file " ) or die " failed to setup perlbins" ;
1372+ my $rdpath = " $perlbin /$file " ;
1373+ open (my $rh , ' <' , $rdpath ) or die " failed to open $rdpath " ;
1374+ <$rh >;
1375+ my $wrpath = " $perlbindir /$file " ;
1376+ open (my $wh , ' >' , $wrpath ) or die " failed to open $wrpath " ;
1377+ print $wh " #!$PERLPATH \n " ;
1378+ local $/ ;
1379+ my $script = <$rh >;
1380+ print $wh $script ;
1381+ print " chmod 755 $wrpath \n " ;
1382+ chmod (0755, $wrpath ) or die $! ;
13701383 }
13711384 local $ENV {PATH } = " $perlbindir :" .$ENV {PATH };
13721385 foreach my $module (@{$itemconfig -> {install_modules }}) {
0 commit comments