From 02256e8086177313d6917dd6c67695eb270a52be Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 30 Jan 2006 15:20:54 +0000 Subject: - Fix build on old perl PR: ports/91862 Submitted by: leeym Approved by: maintainer timeout (14 days) --- textproc/p5-XML-LibXML-XPathContext/Makefile | 4 ++-- .../files/extrapatch-XPathContext.xs | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 textproc/p5-XML-LibXML-XPathContext/files/extrapatch-XPathContext.xs diff --git a/textproc/p5-XML-LibXML-XPathContext/Makefile b/textproc/p5-XML-LibXML-XPathContext/Makefile index c57fceda2826..75846ddfa386 100644 --- a/textproc/p5-XML-LibXML-XPathContext/Makefile +++ b/textproc/p5-XML-LibXML-XPathContext/Makefile @@ -24,8 +24,8 @@ MAN3= XML::LibXML::XPathContext.3 .include -.if ${PERL_LEVEL} < 500601 -IGNORE="Need at least perl 5.6.1 to build" +.if ${PERL_LEVEL} < 500600 +EXTRA_PATCHES= ${FILESDIR}/extrapatch-XPathContext.xs .endif .include diff --git a/textproc/p5-XML-LibXML-XPathContext/files/extrapatch-XPathContext.xs b/textproc/p5-XML-LibXML-XPathContext/files/extrapatch-XPathContext.xs new file mode 100644 index 000000000000..c7c70048dec1 --- /dev/null +++ b/textproc/p5-XML-LibXML-XPathContext/files/extrapatch-XPathContext.xs @@ -0,0 +1,18 @@ +--- XPathContext.xs.orig Mon Jan 16 11:27:29 2006 ++++ XPathContext.xs Mon Jan 16 11:28:54 2006 +@@ -11,6 +11,15 @@ + #include "XSUB.h" + #include "ppport.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 ++ + /* libxml2 stuff */ + #include + #include -- cgit v1.2.3