Skip to content

Commit

Permalink
lib key to Platypus takes a single string
Browse files Browse the repository at this point in the history
On my machine (macOS), dynamic_lib returns more than one, although they are the same names:

```
$ perl -MAlien::Sodium -le 'print join qq(\n), Alien::Sodium->dynamic_libs'
/usr/local/perls/perl-5.38.2/lib/site_perl/5.38.2/darwin-2level/auto/share/dist/Alien-Sodium/dynamic/libsodium.dylib
/usr/local/perls/perl-5.38.2/lib/site_perl/5.38.2/darwin-2level/auto/share/dist/Alien-Sodium/dynamic/libsodium.26.dylib
```

We only need one of them to do away with:

    Odd number of elements in hash assignment at /usr/local/perls/perl-5.38.2/lib/site_perl/5.38.2/darwin-2level/FFI/Platypus.pm line 35.
  • Loading branch information
briandfoy authored Jan 14, 2024
1 parent 96afd6b commit 30597cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sodium/FFI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ push @EXPORT_OK, qw(

our $ffi;
BEGIN {
$ffi = FFI::Platypus->new(api => 1, lib => Alien::Sodium->dynamic_libs);
$ffi = FFI::Platypus->new(api => 1, lib => (Alien::Sodium->dynamic_libs)[0]);
$ffi->bundle();
}
# All of these functions don't need to be gated by version.
Expand Down

0 comments on commit 30597cc

Please sign in to comment.