From 76041d5500368be3096a4821310d0523dfaa98ae Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 23 Apr 2020 08:32:40 +0200 Subject: update to 2.1.0 raise dependency on PHP 7.1 fix 32-bit build using patch from https://github.com/php/pecl-file_formats-yaml/pull/45 --- 45.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ PHPINFO | 4 ++-- REFLECTION | 30 ++++++++++++++--------------- php-pecl-yaml.spec | 24 +++++++++++++++-------- 4 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 45.patch diff --git a/45.patch b/45.patch new file mode 100644 index 0000000..f2b9593 --- /dev/null +++ b/45.patch @@ -0,0 +1,56 @@ +From eb11e4e425d3d6e703c824fb891b1b0701d683ef Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 23 Apr 2020 08:16:30 +0200 +Subject: [PATCH 1/2] fix [-Wformat=] issue on 32-bit + +--- + emit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/emit.c b/emit.c +index 0fd2ebc..234a64e 100644 +--- a/emit.c ++++ b/emit.c +@@ -506,9 +506,9 @@ static int y_write_array( + recursive_idx = y_search_recursive(state, (zend_ulong) ht); + if (-1 != recursive_idx) { + /* create anchor to refer to this structure */ +- anchor_size = snprintf(anchor, 0, "refid%ld", recursive_idx + 1); ++ anchor_size = snprintf(anchor, 0, "refid" ZEND_LONG_FMT, recursive_idx + 1); + anchor = (char*) emalloc(anchor_size + 1); +- snprintf(anchor, anchor_size + 1, "refid%ld", recursive_idx + 1); ++ snprintf(anchor, anchor_size + 1, "refid" ZEND_LONG_FMT, recursive_idx + 1); + + #if PHP_VERSION_ID >= 70300 + if (!(GC_FLAGS(ht) & GC_IMMUTABLE) && GC_IS_RECURSIVE(ht)) { + +From a5a7f14f37c1d530e8e9868945f4c08af26ba8a9 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 23 Apr 2020 08:16:55 +0200 +Subject: [PATCH 2/2] relax test on 32-bit (overflow to float) + +--- + tests/bug_79494.phpt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/bug_79494.phpt b/tests/bug_79494.phpt +index d388bd8..f4f8b48 100644 +--- a/tests/bug_79494.phpt ++++ b/tests/bug_79494.phpt +@@ -22,13 +22,13 @@ $data = array ( + + print yaml_emit($data); + ?> +---EXPECT-- ++--EXPECTF-- + --- + audio: + audioEnabled: +- - 132317787432502136 ++ - 13231778%s + - 0 + eveampGain: +- - 132316833510704299 ++ - 13231683%s + - 0.250000 + ... diff --git a/PHPINFO b/PHPINFO index 6619988..5bf8961 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,8 +2,8 @@ yaml LibYAML Support => enabled -Module Version => 2.0.4 -LibYAML Version => 0.2.1 +Module Version => 2.1.0 +LibYAML Version => 0.2.2 Directive => Local Value => Master Value yaml.decode_binary => 0 => 0 diff --git a/REFLECTION b/REFLECTION index 514ae5e..926851c 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #177 yaml version 2.0.4 ] { +Extension [ extension #101 yaml version 2.1.0 ] { - Dependencies { Dependency [ date (Optional) ] @@ -26,12 +26,12 @@ Extension [ extension #177 yaml version 2.0.4 ] { } - Constants [25] { - Constant [ integer YAML_ANY_SCALAR_STYLE ] { 0 } - Constant [ integer YAML_PLAIN_SCALAR_STYLE ] { 1 } - Constant [ integer YAML_SINGLE_QUOTED_SCALAR_STYLE ] { 2 } - Constant [ integer YAML_DOUBLE_QUOTED_SCALAR_STYLE ] { 3 } - Constant [ integer YAML_LITERAL_SCALAR_STYLE ] { 4 } - Constant [ integer YAML_FOLDED_SCALAR_STYLE ] { 5 } + Constant [ int YAML_ANY_SCALAR_STYLE ] { 0 } + Constant [ int YAML_PLAIN_SCALAR_STYLE ] { 1 } + Constant [ int YAML_SINGLE_QUOTED_SCALAR_STYLE ] { 2 } + Constant [ int YAML_DOUBLE_QUOTED_SCALAR_STYLE ] { 3 } + Constant [ int YAML_LITERAL_SCALAR_STYLE ] { 4 } + Constant [ int YAML_FOLDED_SCALAR_STYLE ] { 5 } Constant [ string YAML_NULL_TAG ] { tag:yaml.org,2002:null } Constant [ string YAML_BOOL_TAG ] { tag:yaml.org,2002:bool } Constant [ string YAML_STR_TAG ] { tag:yaml.org,2002:str } @@ -43,14 +43,14 @@ Extension [ extension #177 yaml version 2.0.4 ] { Constant [ string YAML_PHP_TAG ] { !php/object } Constant [ string YAML_MERGE_TAG ] { tag:yaml.org,2002:merge } Constant [ string YAML_BINARY_TAG ] { tag:yaml.org,2002:binary } - Constant [ integer YAML_ANY_ENCODING ] { 0 } - Constant [ integer YAML_UTF8_ENCODING ] { 1 } - Constant [ integer YAML_UTF16LE_ENCODING ] { 2 } - Constant [ integer YAML_UTF16BE_ENCODING ] { 3 } - Constant [ integer YAML_ANY_BREAK ] { 0 } - Constant [ integer YAML_CR_BREAK ] { 1 } - Constant [ integer YAML_LN_BREAK ] { 2 } - Constant [ integer YAML_CRLN_BREAK ] { 3 } + Constant [ int YAML_ANY_ENCODING ] { 0 } + Constant [ int YAML_UTF8_ENCODING ] { 1 } + Constant [ int YAML_UTF16LE_ENCODING ] { 2 } + Constant [ int YAML_UTF16BE_ENCODING ] { 3 } + Constant [ int YAML_ANY_BREAK ] { 0 } + Constant [ int YAML_CR_BREAK ] { 1 } + Constant [ int YAML_LN_BREAK ] { 2 } + Constant [ int YAML_CRLN_BREAK ] { 3 } } - Functions { diff --git a/php-pecl-yaml.spec b/php-pecl-yaml.spec index e0ddf03..2bd4e75 100644 --- a/php-pecl-yaml.spec +++ b/php-pecl-yaml.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-yaml # -# Copyright (c) 2012-2019 Remi Collet +# Copyright (c) 2012-2020 Remi Collet # Fedora spec file for php-pecl-yaml # @@ -21,15 +21,17 @@ Summary: PHP Bindings for yaml Name: %{?sub_prefix}php-pecl-yaml -Version: 2.0.4 -Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 2.1.0 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT -URL: http://pecl.php.net/package/yaml +URL: https://pecl.php.net/package/yaml -Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Source: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz + +Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-file_formats-yaml/pull/45.patch BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7 +BuildRequires: %{?scl_prefix}php-devel >= 7.1 BuildRequires: %{?scl_prefix}php-pear BuildRequires: libyaml-devel @@ -52,10 +54,8 @@ Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} Obsoletes: php70u-pecl-%{pecl_name} <= %{version} Obsoletes: php70w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "7.1" Obsoletes: php71u-pecl-%{pecl_name} <= %{version} Obsoletes: php71w-pecl-%{pecl_name} <= %{version} -%endif %if "%{php_version}" > "7.2" Obsoletes: php72u-pecl-%{pecl_name} <= %{version} Obsoletes: php72w-pecl-%{pecl_name} <= %{version} @@ -96,6 +96,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr45 + # Check upstream version (often broken) extver=$(sed -n '/#define PHP_YAML_VERSION/{s/.* "//;s/".*$//;p}' php_yaml.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -243,6 +245,12 @@ fi %changelog +* Thu Apr 23 2020 Remi Collet - 2.1.0-1 +- update to 2.1.0 +- raise dependency on PHP 7.1 +- fix 32-bit build using patch from + https://github.com/php/pecl-file_formats-yaml/pull/45 + * Tue Sep 03 2019 Remi Collet - 2.0.4-4 - rebuild for 7.4.0RC1 -- cgit