From 456b1b06f69e92224ecc5783900b2e39b0a4db6b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 15 Nov 2016 12:41:09 +0100 Subject: php-pecl-pq: upstream patch --- php-pecl-pq-php7.spec | 12 +++++--- pq-upstream.patch | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 pq-upstream.patch diff --git a/php-pecl-pq-php7.spec b/php-pecl-pq-php7.spec index d718722..f0df2ef 100644 --- a/php-pecl-pq-php7.spec +++ b/php-pecl-pq-php7.spec @@ -41,13 +41,15 @@ Version: 2.1.1 Release: 0.5.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif License: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} +Patch0: %{pecl_name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: postgresql-devel > 9 BuildRequires: %{?scl_prefix}php-devel > 7 @@ -126,6 +128,7 @@ sed -e '/role="test"/d' \ -i package.xml cd NTS +%patch0 -p1 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_PQ_VERSION/{s/.* "//;s/".*$//;p}' php_pq.h) @@ -213,9 +216,6 @@ if ! pkg-config libpq --atleast-version=9.3; then : ignore some tests only because of "diag" content rm ?TS/tests/{async003,async004,async005,async006,cancel001}.phpt fi -%if "%{php_version}" > "7.1" - rm ?TS/tests/conv001.phpt -%endif OPT="-n" [ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so" @@ -305,6 +305,10 @@ rm -rf %{buildroot} %changelog +* Tue Nov 15 2016 Remi Collet - 2.1.1-3 +- add upstream patch for 7.1 + https://github.com/m6w6/ext-pq/issues/23 + * Wed Sep 14 2016 Remi Collet - 2.1.1-2 - rebuild for PHP 7.1 new API version diff --git a/pq-upstream.patch b/pq-upstream.patch new file mode 100644 index 0000000..6581539 --- /dev/null +++ b/pq-upstream.patch @@ -0,0 +1,82 @@ +From ef9b34bc5ae76a1a961108085e5d21e8ad679b18 Mon Sep 17 00:00:00 2001 +From: Michael Wallner +Date: Tue, 15 Nov 2016 09:53:42 +0100 +Subject: [PATCH] fix issue #23 (PHP-7.1 JSON compat) + +--- + src/php_pq_params.c | 3 +++ + tests/conv001.phpt | 12 ++++++------ + 2 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/php_pq_params.c b/src/php_pq_params.c +index 0f7ba50..5a5156f 100644 +--- a/src/php_pq_params.c ++++ b/src/php_pq_params.c +@@ -83,6 +83,9 @@ static zend_string *object_param_to_string(php_pq_params_t *p, zval *zobj, Oid t + case PHP_PQ_OID_JSONB: + # endif + case PHP_PQ_OID_JSON: ++# if PHP_VERSION_ID >= 70100 ++ JSON_G(encode_max_depth) = PHP_JSON_PARSER_DEFAULT_DEPTH; ++# endif + php_json_encode(&str, zobj, PHP_JSON_UNESCAPED_UNICODE); + smart_str_0(&str); + return str.s; +diff --git a/tests/conv001.phpt b/tests/conv001.phpt +index 8533753..b24da0e 100644 +--- a/tests/conv001.phpt ++++ b/tests/conv001.phpt +@@ -328,7 +328,7 @@ array(1) { + ["format"]=> + string(11) "Y-m-d H:i:s" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -339,7 +339,7 @@ array(1) { + ["format"]=> + string(13) "Y-m-d H:i:s.u" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(3) + ["timezone"]=> +@@ -350,7 +350,7 @@ array(1) { + ["format"]=> + string(14) "Y-m-d H:i:s.uO" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -372,7 +372,7 @@ array(1) { + ["format"]=> + string(11) "Y-m-d H:i:s" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> +@@ -383,7 +383,7 @@ array(1) { + ["format"]=> + string(13) "Y-m-d H:i:s.u" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(3) + ["timezone"]=> +@@ -394,7 +394,7 @@ array(1) { + ["format"]=> + string(14) "Y-m-d H:i:s.uO" + ["date"]=> +- string(26) "%d-%d-%d %d:%d:%d.000000" ++ string(26) "%d-%d-%d %d:%d:%d.%d" + ["timezone_type"]=> + int(1) + ["timezone"]=> -- cgit