aboutsummaryrefslogtreecommitdiff
path: root/security/p5-Digest-Haval256
diff options
context:
space:
mode:
authorYen-Ming Lee <leeym@FreeBSD.org>2005-12-24 02:21:15 +0000
committerYen-Ming Lee <leeym@FreeBSD.org>2005-12-24 02:21:15 +0000
commit94b12440c8a59af1a86229a92817493aa4ae4c05 (patch)
tree1114dd88e8815d66f6413e1089742c0202858bcf /security/p5-Digest-Haval256
parent50b20c73632bf0e2bc0474e4eba57cb20e53ed3a (diff)
downloadports-94b12440c8a59af1a86229a92817493aa4ae4c05.tar.gz
ports-94b12440c8a59af1a86229a92817493aa4ae4c05.zip
- unbreak on old perl
Submitted by: leeym Approved by: maintainer via email
Notes
Notes: svn path=/head/; revision=151948
Diffstat (limited to 'security/p5-Digest-Haval256')
-rw-r--r--security/p5-Digest-Haval256/Makefile14
-rw-r--r--security/p5-Digest-Haval256/files/extrapatch-Haval256.xs18
2 files changed, 30 insertions, 2 deletions
diff --git a/security/p5-Digest-Haval256/Makefile b/security/p5-Digest-Haval256/Makefile
index eb9596e9f49f..482a7d6373a9 100644
--- a/security/p5-Digest-Haval256/Makefile
+++ b/security/p5-Digest-Haval256/Makefile
@@ -13,12 +13,22 @@ PKGNAMEPREFIX= p5-
MAINTAINER= gkovesdan@t-hosting.hu
COMMENT= Perl extension for Haval256 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::Haval256.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-Haval256.xs
+
+post-patch:
+ ${PERL} -pi -e 's/^our\s+([\$$\@\%]\w+)/use vars qw($$1); $$1/;' ${WRKSRC}/Haval256.pm
+ ${PERL} -pi -e '$$_="" if m{warnings}' ${WRKSRC}/Haval256.pm ${WRKSRC}/t/*.t
+ ${PERL} -pi -e 's/\)/, char **env\)/ if m{int main}' ${WRKSRC}/_haval.c
.endif
+
.include <bsd.port.post.mk>
diff --git a/security/p5-Digest-Haval256/files/extrapatch-Haval256.xs b/security/p5-Digest-Haval256/files/extrapatch-Haval256.xs
new file mode 100644
index 000000000000..142a4f326aae
--- /dev/null
+++ b/security/p5-Digest-Haval256/files/extrapatch-Haval256.xs
@@ -0,0 +1,18 @@
+--- Haval256.xs.orig Sat Dec 24 09:54:45 2005
++++ Haval256.xs Sat Dec 24 09:55:39 2005
+@@ -4,6 +4,15 @@
+ #include "ppport.h"
+ #include "_haval.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 haval {
+ haval_state state;
+ }* Digest__Haval256;