Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"JSON::Fast"
],
"depends": [
"Resource::Wrangler:ver<1.1.1+>"
],
"description": "OpenSSL bindings",
"license": "MIT",
Expand Down
17 changes: 4 additions & 13 deletions lib/OpenSSL/NativeLib.rakumod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
unit module OpenSSL::NativeLib;

use Resource::Wrangler;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also full dependency please :-)


BEGIN my %libraries = Rakudo::Internals::JSON.from-json: %?RESOURCES<libraries.json>.slurp(:close);

sub ssl-lib is export {
Expand Down Expand Up @@ -28,20 +30,9 @@ sub crypto-lib is export {
# and use it if it exists, otherwise copy the name mangled file to this location but using the
# original unmangled name.
# XXX: This should be removed when CURI/%?RESOURCES gets a mechanism to bypass name mangling
use nqp;
sub dll-resource($resource-name) {
my $content-id = nqp::sha1($resource-name);
my $dll-directory = $*TMPDIR.add($content-id);
my $dll-resource = $dll-directory.add($resource-name);

unless $dll-resource.e {
mkdir $dll-directory unless $dll-directory.e;
my $resource = %?RESOURCES{$resource-name};
my $resource-data := %?RESOURCES{$resource-name}.slurp(:bin, :close);
$dll-resource.spurt($resource-data, :bin, :close);
}

$dll-resource.absolute
my $prefix = $*TMPDIR.add($?DISTRIBUTION.Str);
load-resource-to-path($resource-name, :$prefix, :filename($resource-name)).absolute
}

# vim: expandtab shiftwidth=4
Loading