1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +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 15:45:48 +00:00
parent ed6e46d17d
commit 0b21f76825
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=151968
2 changed files with 30 additions and 2 deletions

View File

@ -13,12 +13,22 @@ PKGNAMEPREFIX= p5-
MAINTAINER= gkovesdan@t-hosting.hu
COMMENT= Perl extension for Whirlpool hash algorithm
BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64
PERL_CONFIGURE= yes
MAN3= Digest::Whirlpool.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-Whirlpool.xs
post-patch:
${PERL} -pi -e 's/^our\s+([\$$\@\%]\w+)/use vars qw($$1); $$1/;' ${WRKSRC}/Whirlpool.pm
${PERL} -pi -e '$$_="" if m{warnings}' ${WRKSRC}/Whirlpool.pm ${WRKSRC}/t/*.t
${PERL} -pi -e 's/\)/, char **env\)/ if m{int main}' ${WRKSRC}/_whirlpool.c
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,18 @@
--- Whirlpool.xs.orig Sat Dec 24 23:41:30 2005
+++ Whirlpool.xs Sat Dec 24 23:42:16 2005
@@ -4,6 +4,15 @@
#include "ppport.h"
#include "_whirlpool.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 whirlpool {
NESSIEstruct state;
}* Digest__Whirlpool;