From 04694e2f888d7666c78b86d982eee741e92ccb0c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Jul 2020 11:44:56 +0200 Subject: rebuild for 8.0.0alpha3 using patch from https://github.com/php/pecl-file_formats-yaml/pull/53 --- 53.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-yaml.spec | 13 ++++++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 53.patch diff --git a/53.patch b/53.patch new file mode 100644 index 0000000..25cb671 --- /dev/null +++ b/53.patch @@ -0,0 +1,59 @@ +From ebc51a7314881805f9b8fda2ac19285465f48d3e Mon Sep 17 00:00:00 2001 +From: Andy Postnikov +Date: Sat, 11 Jul 2020 19:43:18 +0300 +Subject: [PATCH] Fix build on PHP 8 alpha 2 + +call_user_function_ex() no longer defined +--- + emit.c | 4 ++-- + parse.c | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/emit.c b/emit.c +index 234a64e..cc5134b 100644 +--- a/emit.c ++++ b/emit.c +@@ -722,8 +722,8 @@ y_write_object_callback ( + zend_string *str_key; + + /* call the user function */ +- if (FAILURE == call_user_function_ex(EG(function_table), NULL, +- callback, &zret, 1, argv, 0, NULL) || ++ if (FAILURE == call_user_function(EG(function_table), NULL, ++ callback, &zret, 1, argv) || + Z_TYPE_P(&zret) == IS_UNDEF) { + php_error_docref(NULL, E_WARNING, + "Failed to apply callback for class '%s'" +diff --git a/parse.c b/parse.c +index 71eb4f2..2405c58 100644 +--- a/parse.c ++++ b/parse.c +@@ -643,7 +643,7 @@ apply_filter(zval *zp, yaml_event_t event, HashTable *callbacks) + ZVAL_LONG(&callback_args[2], 0); + + /* call the user function */ +- callback_result = call_user_function_ex(EG(function_table), NULL, callback, &retval, 3, callback_args, 0, NULL); ++ callback_result = call_user_function(EG(function_table), NULL, callback, &retval, 3, callback_args); + + /* cleanup our temp variables */ + zval_ptr_dtor(&callback_args[1]); +@@ -846,7 +846,7 @@ void eval_scalar_with_callbacks(yaml_event_t event, + ZVAL_STRINGL(&argv[1], tag, strlen(tag)); + ZVAL_LONG(&argv[2], event.data.scalar.style); + +- if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, retval, 3, argv, 0, NULL) || Z_TYPE_P(retval) == IS_UNDEF) { ++ if (FAILURE == call_user_function(EG(function_table), NULL, callback, retval, 3, argv) || Z_TYPE_P(retval) == IS_UNDEF) { + php_error_docref(NULL, E_WARNING, + "Failed to evaluate value for tag '%s'" + " with user defined function", tag); +@@ -898,8 +898,8 @@ eval_timestamp(zval **zpp, const char *ts, size_t ts_len) + ZVAL_STRINGL(&arg, ts, ts_len); + argv[0] = arg; + +- if (FAILURE == call_user_function_ex(EG(function_table), NULL, func, +- &retval, 1, argv, 0, NULL) || Z_TYPE_P(&retval) == IS_UNDEF) { ++ if (FAILURE == call_user_function(EG(function_table), NULL, func, ++ &retval, 1, argv) || Z_TYPE_P(&retval) == IS_UNDEF) { + php_error_docref(NULL, E_WARNING, + "Failed to evaluate string '%s' as timestamp", ts); + if (func != NULL) { diff --git a/php-pecl-yaml.spec b/php-pecl-yaml.spec index 2bd4e75..0bcda8e 100644 --- a/php-pecl-yaml.spec +++ b/php-pecl-yaml.spec @@ -22,13 +22,14 @@ Summary: PHP Bindings for yaml Name: %{?sub_prefix}php-pecl-yaml Version: 2.1.0 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: https://pecl.php.net/package/yaml 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 +Patch1: https://patch-diff.githubusercontent.com/raw/php/pecl-file_formats-yaml/pull/53.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.1 @@ -48,7 +49,7 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{relea Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} %endif -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} # Other third party repo stuff Obsoletes: php56u-pecl-%{pecl_name} <= %{version} Obsoletes: php56w-pecl-%{pecl_name} <= %{version} @@ -68,6 +69,9 @@ Obsoletes: php73w-pecl-%{pecl_name} <= %{version} Obsoletes: php74-pecl-%{pecl_name} <= %{version} Obsoletes: php74w-pecl-%{pecl_name} <= %{version} %endif +%if "%{php_version}" > "8.0" +Obsoletes: php74-pecl-%{pecl_name} <= %{version} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -97,6 +101,7 @@ sed -e 's/role="test"/role="src"/' \ cd NTS %patch0 -p1 -b .pr45 +%patch1 -p1 -b .pr52 # Check upstream version (often broken) extver=$(sed -n '/#define PHP_YAML_VERSION/{s/.* "//;s/".*$//;p}' php_yaml.h) @@ -245,6 +250,10 @@ fi %changelog +* Wed Jul 22 2020 Remi Collet - 2.1.0-2 +- rebuild for 8.0.0alpha3 using patch from + https://github.com/php/pecl-file_formats-yaml/pull/53 + * Thu Apr 23 2020 Remi Collet - 2.1.0-1 - update to 2.1.0 - raise dependency on PHP 7.1 -- cgit