[packages/php-pecl-libsodium: 2/2] add patch to pass tests on php5.3

glen glen at pld-linux.org
Thu Jan 28 20:49:05 CET 2016


commit f3d673b7a61aa19af8ea2675395a03f6a13203af
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Jan 28 21:48:19 2016 +0200

    add patch to pass tests on php5.3

 php-pecl-libsodium.spec |  2 ++
 tests-php53.patch       | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
---
diff --git a/php-pecl-libsodium.spec b/php-pecl-libsodium.spec
index 596b878..3a93e30 100644
--- a/php-pecl-libsodium.spec
+++ b/php-pecl-libsodium.spec
@@ -17,6 +17,7 @@ Source0:	http://pecl.php.net/get/%{modname}-%{version}.tgz
 URL:		http://pecl.php.net/package/libsodium
 # See https://github.com/jedisct1/libsodium-php/pull/70
 Patch0:		%{modname}-pr70.patch
+Patch1:		tests-php53.patch
 BuildRequires:	%{php_name}-devel >= 4:5.3
 BuildRequires:	libsodium-devel >= 0.6.0
 BuildRequires:	pkgconfig
@@ -40,6 +41,7 @@ Documentation: https://paragonie.com/book/pecl-libsodium
 mv %{modname}-%{version}/* .
 
 %patch0 -p1
+%patch1 -p1
 
 # Sanity check, really often broken
 extver=$(sed -n '/#define PHP_LIBSODIUM_VERSION/{s/.* "//;s/".*$//;p}' php_libsodium.h)
diff --git a/tests-php53.patch b/tests-php53.patch
new file mode 100644
index 0000000..1dc8c6d
--- /dev/null
+++ b/tests-php53.patch
@@ -0,0 +1,28 @@
+--- php-pecl-libsodium-1.0.2/tests/utils.phpt	2016-01-28 21:43:00.641808352 +0200
++++ php-pecl-libsodium-1.0.2/tests/utils.phpt	2016-01-28 21:45:37.116534064 +0200
+@@ -11,15 +11,15 @@
+ $c = 'string';
+ var_dump(!\Sodium\memcmp($b, $c));
+ var_dump(!\Sodium\memcmp($b, 'String'));
+-$v = hex2bin('FFFF800102030405060708');
++$v = "\xFF\xFF\x80\x01\x02\x03\x04\x05\x06\x07\x08";
+ \Sodium\increment($v);
+ var_dump(bin2hex($v));
+ 
+ if (\Sodium\library_version_major() > 7 ||
+     (\Sodium\library_version_major() == 7 &&
+      \Sodium\library_version_minor() >= 6)) {
+-    $v_1 = hex2bin('0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
+-    $v_2 = hex2bin('0202030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F');
++    $v_1 = "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
++    $v_2 = "\x02\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
+     var_dump(\Sodium\compare($v_1, $v_2));
+     \Sodium\increment($v_1);
+     var_dump(\Sodium\compare($v_1, $v_2));
+@@ -32,5 +32,5 @@
+ $str = 'stdClass';
+ \Sodium\memzero($str);
+-$obj = json_decode(json_encode(['foo' => 'bar']));
++$obj = json_decode(json_encode(array('foo' => 'bar')));
+ var_dump($obj);
+ ?>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-libsodium.git/commitdiff/f3d673b7a61aa19af8ea2675395a03f6a13203af



More information about the pld-cvs-commit mailing list