Skip to content

Commit

Permalink
register XS DLLs extracted into $PAR_TEMP/inc with %PAR::Heavy::FullC…
Browse files Browse the repository at this point in the history
…ache

This solves the problems mentioned in GitHub PR #8
("Special case Gtk related dlls to dl_load from the unpacked inc dir")
with applications using modules GTK2, Pango, Cairo and othes (this is
a Windows only problem)
  • Loading branch information
rschupp committed Nov 1, 2023
1 parent 1bc8b6d commit 7626a9c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/PAR.pm
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,20 @@ sub _extract_inc {
Archive::Zip::setChunkSize(64 * 1024);
}

for ( $zip->memberNames() ) {
s{^/}{};
my $outfile = File::Spec->catfile($inc, $_);
foreach my $name ($zip->memberNames()) {
$name =~ s{^/}{};
my $outfile = File::Spec->catfile($inc, $name);
next if -e $outfile and not -w _;
$zip->extractMember($_, $outfile);
$zip->extractMember($name, $outfile);
# Unfortunately Archive::Zip doesn't have an option
# NOT to restore member timestamps when extracting, hence set
# it to "now" (making it younger than the canary file).
utime(undef, undef, $outfile);

if (my ($xs_dll) = $name =~ m{^lib/(auto/.*\.\Q$dlext\E)$}) {
$PAR::Heavy::FullCache{$outfile} = $xs_dll;
$PAR::Heavy::FullCache{$xs_dll} = $outfile;
}
}
}

Expand Down

0 comments on commit 7626a9c

Please sign in to comment.