1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

- unbreak on old perl

Submitted by:	leeym
Approved by:	maintainer via email
This commit is contained in:
Yen-Ming Lee 2005-12-24 02:50:55 +00:00
parent f167e2a43e
commit 76b50962d0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=151951
2 changed files with 27 additions and 3 deletions

View File

@ -13,12 +13,18 @@ PKGNAMEPREFIX= p5-
MAINTAINER= gkovesdan@t-hosting.hu
COMMENT= Perl extension for D.J Bernstein's hash algorithm
PERL_CONFIGURE= yes
PERL_CONFIGURE= yes
MAN3= Digest::DJB.3
.include <bsd.port.pre.mk>
.if ${PERL_LEVEL} <= 500503
IGNORE= requires Perl 5.6. Intall lang/perl5 or lang/perl5.8, and try again
.if ${PERL_LEVEL} < 500600
EXTRA_PATCHES= ${PATCHDIR}/extrapatch-DJB.xs
post-patch:
${PERL} -pi -e 's/^our\s+([\$$\@\%]\w+)/use vars qw($$1); $$1/;' ${WRKSRC}/DJB.pm
${PERL} -pi -e '$$_="" if m{5.006|warnings}' ${WRKSRC}/DJB.pm
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,18 @@
--- DJB.xs.orig Sat Dec 24 10:44:54 2005
+++ DJB.xs Sat Dec 24 10:45:41 2005
@@ -2,6 +2,15 @@
#include "perl.h"
#include "XSUB.h"
+/* 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
+
#define UCHAR unsigned char
size_t