Subject: | Switch Digest::SHA to XSLoader |
p5p has recently switched all CORE modules to XSLoader
for performance reasons during the 5.27 development cycle.
This case is about switching Digest::SHA CPAN module.
Note, XSLoader is a problem for Perl versions earlier than 5.6,
which at this point can get alternate support, as mentioned
in the upstream case.
Upstream-Case: RT #132080
Upstream-URL: https://rt.perl.org/SelfService/Display.html?id=132080
Subject: | 0001-Switch-Digest-SHA-to-XSLoader.patch |
From f8893032a631cdbe8192acb4120d6a98534ea94f Mon Sep 17 00:00:00 2001
From: Nicolas Rochelemagne <rochelemagne@cpanel.net>
Date: Tue, 14 Nov 2017 09:58:48 -0600
Subject: [PATCH] Switch Digest::SHA to XSLoader
p5p has recently switched all CORE modules to XSLoader
for performance reasons during the 5.27 development cycle.
This case is about switching Digest::SHA CPAN module.
Note, XSLoader is a problem for Perl versions earlier than 5.6,
which at this point can get alternate support, as mentioned
in the upstream case.
Upstream-Case: RT #132080
Upstream-URL: https://rt.perl.org/SelfService/Display.html?id=132080
---
lib/Digest/SHA.pm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/Digest/SHA.pm b/lib/Digest/SHA.pm
index 6a60926..432a42a 100644
--- a/lib/Digest/SHA.pm
+++ b/lib/Digest/SHA.pm
@@ -11,8 +11,10 @@ use integer;
$VERSION = '5.98';
require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+
+use XSLoader ();
+
+@ISA = qw(Exporter);
@EXPORT_OK = qw(
hmac_sha1 hmac_sha1_base64 hmac_sha1_hex
hmac_sha224 hmac_sha224_base64 hmac_sha224_hex
@@ -236,7 +238,7 @@ sub load {
$class->putstate($str);
}
-Digest::SHA->bootstrap($VERSION);
+XSLoader::load( 'Digest::SHA', $VERSION );
1;
__END__
--
2.13.6 (Apple Git-96)