Allow building against perl <= 5.25.5

This commit is contained in:
Petr Písař 2017-05-11 13:48:12 +02:00
parent 1232e70686
commit 07a6e21d50
2 changed files with 38 additions and 2 deletions

View File

@ -0,0 +1,34 @@
From c38b7faa8bb565553bf125da7244f013822735ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 11 May 2017 13:44:14 +0200
Subject: [PATCH] Provide SvPVCLEAR() macro
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To build with perl <= 5.25.5.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
Dumper.xs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Dumper.xs b/Dumper.xs
index 0e7142e..5a21721 100644
--- a/Dumper.xs
+++ b/Dumper.xs
@@ -8,6 +8,11 @@
# include "ppport.h"
#endif
+/* SvPVCLEAR was added after 5.25.5 and ppport.h does not provide it */
+#if !defined SvPVCLEAR
+#define SvPVCLEAR(x) sv_setpvs((x), "")
+#endif
+
#if PERL_VERSION < 8
# define DD_USE_OLD_ID_FORMAT
#endif
--
2.9.3

View File

@ -8,14 +8,15 @@ URL: http://search.cpan.org/dist/Data-Dumper/
Source0: http://www.cpan.org/authors/id/S/SM/SMUELLER/Data-Dumper-%{cpan_version}.tar.gz
# Unbundled from perl-5.25.12, requires perl > 5.25.5
Patch0: Data-Dumper-2.161-Upgrade-to-2.167.patch
# Allow building against perl <= 5.25.5,
# required for Data-Dumper-2.161-Upgrade-to-2.167.patch
Patch1: Data-Dumper-2.167-Provide-SvPVCLEAR-macro.patch
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: make
BuildRequires: perl
BuildRequires: perl-devel
BuildRequires: perl-generators
# The XS implementation calls SvPVCLEAR() added into perl after 5.25.5
BuildRequires: perl(:VERSION) > 5.25.5
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
BuildRequires: sed
# perl-Test-Simple is in cycle with perl-Data-Dumper
@ -57,6 +58,7 @@ structures correctly.
%prep
%setup -q -n Data-Dumper-%{cpan_version}
%patch0 -p1
%patch1 -p1
sed -i '/MAN3PODS/d' Makefile.PL
%build