Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix p5helper.so not found after installation with current panda
  • Loading branch information
niner committed Mar 30, 2015
1 parent 6ea4165 commit 2576145
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/Inline/Perl5.pm6
Expand Up @@ -11,13 +11,22 @@ use NativeCall;

sub native(Sub $sub) {
my $so = $*VM.config<dll>;
$so ~~ s/^.*\%s/p5helper/;
$so ~~ s!^.*\%s!p5helper!;
my $base = "lib/Inline/$so";
state Str $path;
unless $path {
for @*INC {
if "$_/Inline/$so".IO ~~ :f {
$path = "$_/Inline/$so";
last;
if my @files = ($_.files($base) || $_.files("blib/$base")) {
my $files = @files[0]<files>;
my $tmp = $files{$base} || $files{"blib/$base"};

# copy to a temp dir
#
# This is required because CompUnitRepo::Local::Installation stores the file
# with a different filename (a number with no extension) that NativeCall doesn't
# know how to load. We do this copy to fix the filename.
$tmp.IO.copy($*SPEC.tmpdir ~ '/' ~ $so);
$path = $*SPEC.tmpdir ~ '/' ~ $so;
}
}
}
Expand Down

0 comments on commit 2576145

Please sign in to comment.