summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-scrypt.spec9
-rw-r--r--scrypt-pr47.patch39
2 files changed, 46 insertions, 2 deletions
diff --git a/php-pecl-scrypt.spec b/php-pecl-scrypt.spec
index a63d15f..233817c 100644
--- a/php-pecl-scrypt.spec
+++ b/php-pecl-scrypt.spec
@@ -32,6 +32,8 @@ Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: %{pecl_name}-pr47.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel > 5.3
BuildRequires: %{?scl_prefix}php-pear
@@ -93,6 +95,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .pr47
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_SCRYPT_VERSION/{s/.* "//;s/".*$//;p}' php_scrypt.h)
@@ -189,7 +192,7 @@ TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php
+%{__php} -n run-tests.php --show-diff
%if %{with_zts}
@@ -204,7 +207,7 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php
+%{__ztsphp} -n run-tests.php --show-diff
%endif
@@ -230,6 +233,8 @@ rm -rf %{buildroot}
%changelog
* Wed May 18 2016 Remi Collet <remi@fedoraproject.org> - 1.4-1
- Update to 1.4 (php 5 and 7, stable)
+- open https://github.com/DomBlack/php-scrypt/issues/46 failed test
+- add patch from https://github.com/DomBlack/php-scrypt/pull/47
* Tue Mar 8 2016 Remi Collet <remi@fedoraproject.org> - 1.3-2
- adapt for F24
diff --git a/scrypt-pr47.patch b/scrypt-pr47.patch
new file mode 100644
index 0000000..459c153
--- /dev/null
+++ b/scrypt-pr47.patch
@@ -0,0 +1,39 @@
+From 52f0b3dbc28a2acbcce356ee657081ff12acd20d Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Wed, 18 May 2016 14:59:34 +0200
+Subject: [PATCH] fix zend_parse_parameters call, fix #46
+
+---
+ php_scrypt.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/php_scrypt.c b/php_scrypt.c
+index 97c38f1..df1f04f 100644
+--- a/php_scrypt.c
++++ b/php_scrypt.c
+@@ -43,6 +43,12 @@
+
+ #include "math.h"
+
++#if PHP_MAJOR_VERSION >= 7
++typedef size_t strsize_t;
++#else
++typedef int strsize_t;
++#endif
++
+ /* {{{ arginfo */
+ ZEND_BEGIN_ARG_INFO_EX(scrypt_arginfo, 0, 0, 6)
+ ZEND_ARG_INFO(0, password)
+@@ -115,10 +121,10 @@ PHP_FUNCTION(scrypt)
+ {
+ /* Variables for PHP's parameters */
+ unsigned char *password;
+- int password_len;
++ strsize_t password_len;
+
+ unsigned char *salt;
+- int salt_len;
++ strsize_t salt_len;
+
+ long phpN;
+ long phpR;