From 76b016e212ad5dc2458d876e6991201e296a405e Mon Sep 17 00:00:00 2001 From: skv Date: Thu, 29 Dec 2005 12:42:14 +0000 Subject: * unbreak on old perl. * change MAINTAINER to perl@ PR: ports/90878 Submitted by: leeym --- security/p5-Digest-SHA2/Makefile | 9 +++++++-- security/p5-Digest-SHA2/files/extrapatch-SHA2.xs | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 security/p5-Digest-SHA2/files/extrapatch-SHA2.xs (limited to 'security') diff --git a/security/p5-Digest-SHA2/Makefile b/security/p5-Digest-SHA2/Makefile index ca3b71188b6..1f2c385c9bf 100644 --- a/security/p5-Digest-SHA2/Makefile +++ b/security/p5-Digest-SHA2/Makefile @@ -12,7 +12,7 @@ MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= Digest PKGNAMEPREFIX= p5- -MAINTAINER= skv@FreeBSD.org +MAINTAINER= perl@FreeBSD.org COMMENT= Perl interface to the SHA-2 algorithms BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64 \ @@ -26,7 +26,12 @@ MAN3= Digest::SHA2.3 .include .if ${PERL_LEVEL} < 500600 -IGNORE= Perl 5.6 or newer required. Install lang/perl5 or lang/perl5.8 and try again. +EXTRA_PATCHES= ${PATCHDIR}/extrapatch-SHA2.xs + +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 diff --git a/security/p5-Digest-SHA2/files/extrapatch-SHA2.xs b/security/p5-Digest-SHA2/files/extrapatch-SHA2.xs new file mode 100644 index 00000000000..714688236e0 --- /dev/null +++ b/security/p5-Digest-SHA2/files/extrapatch-SHA2.xs @@ -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; -- cgit