ports/90877: [PATCH] security/p5-Digest-SHA2: unbreak on old perl
Yen-Ming Lee
leeym at FreeBSD.org
Sat Dec 24 13:30:18 UTC 2005
>Number: 90877
>Category: ports
>Synopsis: [PATCH] security/p5-Digest-SHA2: unbreak on old perl
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Dec 24 13:30:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Yen-Ming Lee
>Release: FreeBSD 6.0-STABLE i386
>Organization:
FreeBSD Taiwan
>Environment:
System: FreeBSD utopia.leeym.com 6.0-STABLE FreeBSD 6.0-STABLE #0: Thu Nov 17 09:15:19 CST 2005
>Description:
- unbreak on old perl
Added file(s):
- files/patch-SHA2.xs
Port maintainer (skv at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:
--- p5-Digest-SHA2-1.1.0.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/p5-Digest-SHA2/Makefile,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile
--- Makefile 11 Jun 2005 16:13:00 -0000 1.3
+++ Makefile 24 Dec 2005 13:25:33 -0000
@@ -26,7 +26,10 @@
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} < 500600
-IGNORE= Perl 5.6 or newer required. Install lang/perl5 or lang/perl5.8 and try again.
+post-patch:
+ ${PERL} -pi -e 's/^our\s+([\$$\@\%]\w+)/use vars qw($$1); $$1/;' ${WRKSRC}/SHA2.pm
+ ${PERL} -pi -e '$$_="" if m{warnings}' ${WRKSRC}/SHA2.pm ${WRKSRC}/t/*.t
+ ${PERL} -pi -e 's/\)/, char **env\)/ if m{int main}' ${WRKSRC}/_sha2.c
.endif
.include <bsd.port.post.mk>
Index: files/patch-SHA2.xs
===================================================================
RCS file: files/patch-SHA2.xs
diff -N files/patch-SHA2.xs
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-SHA2.xs 24 Dec 2005 13:25:33 -0000
@@ -0,0 +1,18 @@
+--- SHA2.xs.orig Sat Dec 24 21:15:29 2005
++++ SHA2.xs Sat Dec 24 21:16:10 2005
+@@ -4,6 +4,15 @@
+ #include "ppport.h"
+ #include "_sha2.c"
+
++/* try to be compatible with older perls */
++/* SvPV_nolen() macro first defined in 5.005_55 */
++/* this is slow, not threadsafe, but works */
++#include "patchlevel.h"
++#if (PATCHLEVEL == 4) || ((PATCHLEVEL == 5) && (SUBVERSION < 55))
++static STRLEN nolen_na;
++# define SvPV_nolen(sv) SvPV ((sv), nolen_na)
++#endif
++
+ typedef struct sha2 {
+ SHA256_CTX ctx256;
+ SHA384_CTX ctx384;
--- p5-Digest-SHA2-1.1.0.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list