From 055e46cb03419e5a4fcff40a126ca3e5635f74f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Thu, 11 May 2017 13:35:30 +0200
Subject: Allow building against perl <= 5.25.5

---
 Storable-2.62-Provide-SvPVCLEAR-macro.patch | 34 +++++++++++++++++++++++++++++
 perl-Storable.spec                          |  6 +++--
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 Storable-2.62-Provide-SvPVCLEAR-macro.patch

diff --git a/Storable-2.62-Provide-SvPVCLEAR-macro.patch 
b/Storable-2.62-Provide-SvPVCLEAR-macro.patch
new file mode 100644
index 0000000..ba0b03f
--- /dev/null
+++ b/Storable-2.62-Provide-SvPVCLEAR-macro.patch
@@ -0,0 +1,34 @@
+From ccf6bcc1ea08403f9081ce608009322e1b5091f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
+Date: Thu, 11 May 2017 13:29:57 +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ř <[email protected]>
+---
+ Storable.xs | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Storable.xs b/Storable.xs
+index 9ba48be..f7d253c 100644
+--- a/Storable.xs
++++ b/Storable.xs
+@@ -26,6 +26,11 @@
+ #include "ppport.h"             /* handle old perls */
+ #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 0
+ #define DEBUGME /* Debug mode, turns assertions on as well */
+ #define DASSERT /* Assertion mode */
+-- 
+2.9.3
+
diff --git a/perl-Storable.spec b/perl-Storable.spec
index 0d6b062..1749642 100644
--- a/perl-Storable.spec
+++ b/perl-Storable.spec
@@ -14,14 +14,15 @@ Patch0:         Storable-2.51-Upgrade-to-2.53.patch
 Patch1:         Storable-2.53-Upgrade-to-2.56.patch
 # Unbundled from perl 5.25.12, requires SvPVCLEAR() added into perl after 
5.25.5
 Patch2:         Storable-2.56-Upgrade-to-2.62.patch
+# Allow building against perl <= 5.25.5,
+# required for Storable-2.56-Upgrade-to-2.62.patch
+Patch3:         Storable-2.62-Provide-SvPVCLEAR-macro.patch
 BuildRequires:  coreutils
 BuildRequires:  gcc
 BuildRequires:  make
 BuildRequires:  perl
 BuildRequires:  perl-devel
 BuildRequires:  perl-generators
-# For SvPVCLEAR()
-BuildRequires:  perl(:VERSION) > 5.25.5
 BuildRequires:  perl(Config)
 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.76
 BuildRequires:  sed
@@ -74,6 +75,7 @@ can be conveniently stored to disk and retrieved at a later 
time.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 # Remove bundled modules
 rm -rf t/compat
 sed -i -e '/^t\/compat\//d' MANIFEST
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-Storable.git/commit/?h=master&id=055e46cb03419e5a4fcff40a126ca3e5635f74f6
_______________________________________________
perl-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to