Date: Sat, 24 Dec 2005 21:31:09 +0800 (CST) From: Yen-Ming Lee <leeym@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: skv@FreeBSD.org Subject: ports/90878: [PATCH] security/p5-Digest-SHA2: unbreak on old perl Message-ID: <20051224133109.63E3EB29CA8@utopia.leeym.com> Resent-Message-ID: <200512241340.jBODe1X0049695@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 90878 >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:40:00 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 (please ignore previous PR, the patch should go to extra patch) Added file(s): - files/extrapatch-SHA2.xs Port maintainer (skv@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:30:02 -0000 @@ -26,7 +26,12 @@ .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. +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 <bsd.port.post.mk> Index: files/extrapatch-SHA2.xs =================================================================== RCS file: files/extrapatch-SHA2.xs diff -N files/extrapatch-SHA2.xs --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/extrapatch-SHA2.xs 24 Dec 2005 13:30:02 -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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051224133109.63E3EB29CA8>