Skip to content

Commit d759d22

Browse files
committed
fix DynaLoader test, start on File::ShareDir for loading patches
1 parent ce7ef1b commit d759d22

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

Makefile.PL

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ use 5.010;
22
use strict;
33
use warnings;
44
use ExtUtils::MakeMaker;
5+
use File::ShareDir::Install;
6+
7+
install_share 'share';
58

69
my %WriteMakefileArgs = (
710
NAME => 'Perl::Dist::APPerl',
@@ -12,11 +15,13 @@ my %WriteMakefileArgs = (
1215
MIN_PERL_VERSION => '5.010',
1316
CONFIGURE_REQUIRES => {
1417
'ExtUtils::MakeMaker' => '0',
18+
"File::ShareDir::Install" => "0.13"
1519
},
1620
PREREQ_PM => {
1721
'JSON::PP' => '2.0104',
1822
'File::Path' => '2.07',
1923
'version' => '0.77',
24+
"File::ShareDir" => 0,
2025
},
2126
TEST_REQUIRES => {
2227
'Test::Pod::LinkCheck::Lite' => '0',
@@ -73,3 +78,9 @@ sub MY::postamble {
7378
return "authortest: test\n\tAUTHOR_TESTING=1 "
7479
. $_[0]->test_via_harness( '$(FULLPERLRUN)', 'xt/author/*.t' );
7580
}
81+
82+
{
83+
package
84+
MY;
85+
use File::ShareDir::Install qw(postamble);
86+
}

lib/Perl/Dist/APPerl.pm

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,14 +710,15 @@ my %defconfig = (
710710
desc => "For developing cosmo platform perl without apperl additions",
711711
base => 'full',
712712
perl_id => 'cosmo',
713-
patches => ['../Perl-Dist-APPerl/5.36-cosmo.patch']
713+
patches => ['../Perl-Dist-APPerl/share/5.36-cosmo.patch']
714714
},
715715
perl_cosmo3_dev => {
716716
desc => "For developing cosmo platform perl without apperl additions",
717717
base => 'full',
718718
perl_id => 'v5.36.3',
719719
perl_url => undef,
720-
patches => ['../Perl-Dist-APPerl/5.36-cosmo3.patch']
720+
patches => ['../Perl-Dist-APPerl/share/5.36-cosmo3.patch'],
721+
install_modules => ['File-ShareDir-1.118.tar.gz']
721722
},
722723
perl_cosmo_dev_on_vista => {
723724
desc => "For developing cosmo platform perl without apperl additions on vista",
@@ -1132,7 +1133,9 @@ sub Build {
11321133
my $perllib = "$TEMPDIR$proxyConfig{installprivlib}";
11331134
my $perlarchlib = "$TEMPDIR$proxyConfig{installarchlib}";
11341135
my $mmopt = sub {
1135-
my @mmopt = ("PERL_LIB=$perllib", "PERL_ARCHLIB=$perlarchlib", "MAP_TARGET=perl.com.dbg",
1136+
my @mmopt = ("PERL_LIB=$perllib", "PERL_ARCHLIB=$perlarchlib",
1137+
#"MAP_TARGET=perl.com.dbg",
1138+
"MAP_TARGET=perl.com",
11361139
"INSTALLDIRS=perl",
11371140
"INSTALLARCHLIB=$perlarchlib",
11381141
"INSTALLPRIVLIB=$perllib",
@@ -1198,8 +1201,9 @@ sub Build {
11981201
# install into the src tree
11991202
_command_or_die('make', 'install');
12001203
# build a new perl binary, convert to APE, and repack zip
1201-
_command_or_die('make', 'perl.com.dbg');
1202-
_command_or_die(dirname($proxyConfig{cc})."/x86_64-linux-musl-objcopy", '-S', '-O', 'binary', 'perl.com.dbg', 'perl.com');
1204+
#_command_or_die('make', 'perl.com.dbg');
1205+
#_command_or_die(dirname($proxyConfig{cc})."/x86_64-linux-musl-objcopy", '-S', '-O', 'binary', 'perl.com.dbg', 'perl.com');
1206+
_command_or_die('make', 'perl.com');
12031207
$PERL_APE = abs_path('./perl.com');
12041208
}
12051209
else {
@@ -1503,14 +1507,23 @@ sub _load_apperl_config {
15031507
defined($thispath) or die(__FILE__.'issues?');
15041508
push @{$itemconfig{zip_extra_files}{"__perllib__/Perl/Dist"}}, $thispath;
15051509
my $apperlm = $0;
1510+
my $patchdir;
15061511
if(basename($0) ne 'apperlm') {
15071512
$apperlm = dirname($thispath)."/../../../script/apperlm";
15081513
}
1514+
$patchdir = dirname($thispath)."/../../../share";
15091515
$apperlm = abs_path($apperlm);
15101516
defined($apperlm) or die "error getting path to apperlm";
15111517
my @additionalfiles = ($apperlm);
15121518
-e $_ or die("$_ $!") foreach @additionalfiles;
15131519
push @{$itemconfig{zip_extra_files}{bin}}, @additionalfiles;
1520+
$patchdir = abs_path($patchdir);
1521+
defined($patchdir) or die "error getting path to patchdir";
1522+
opendir(my $dh, $patchdir) or die "error opening patch dir";
1523+
while(my $file = readdir $dh) {
1524+
next if(($file eq '.') || ($file eq '..'));
1525+
push @{$itemconfig{zip_extra_files}{"__perllib__/auto/share/dist/Perl-Dist-APPerl"}}, "$patchdir/$file";
1526+
}
15141527
}
15151528

15161529
# verify apperl config sanity
File renamed without changes.
File renamed without changes.

5.36-cosmo3.patch renamed to share/5.36-cosmo3.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,19 @@ index f0d451af3c..63dce797fa 100644
523523
PERL_FPU_POST_EXEC
524524
S_exec_failed(aTHX_ PL_sh_path, fd, do_report);
525525
goto leave;
526+
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
527+
index 11b37b5c4e..7cd7769d38 100644
528+
--- a/ext/DynaLoader/t/DynaLoader.t
529+
+++ b/ext/DynaLoader/t/DynaLoader.t
530+
@@ -119,7 +119,7 @@ SKIP: {
531+
# (not at least by that name) that the dl_findfile()
532+
# could find.
533+
skip( "dl_findfile test not appropriate on $^O", 1 )
534+
- if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|vos|os390)/i;
535+
+ if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|vos|os390|cosmo)/i;
536+
# Play safe and only try this test if this system
537+
# looks pretty much Unix-like.
538+
skip( "dl_findfile test not appropriate on $^O", 1 )
526539
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
527540
index ee2f4a3a92..e5902fa53c 100644
528541
--- a/ext/Errno/Errno_pm.PL

0 commit comments

Comments
 (0)