[packages/php-pecl-expect] Up to 0.4.0; add php8 fixes from git master

arekm arekm at pld-linux.org
Thu Feb 19 13:14:51 CET 2026


commit 3549f950ae9a264a17b218adf297ceda5758e011
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Feb 19 13:14:45 2026 +0100

    Up to 0.4.0; add php8 fixes from git master

 master.patch         | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 php-pecl-expect.spec | 10 ++++----
 2 files changed, 74 insertions(+), 4 deletions(-)
---
diff --git a/php-pecl-expect.spec b/php-pecl-expect.spec
index cb9d6c5..fa87f26 100644
--- a/php-pecl-expect.spec
+++ b/php-pecl-expect.spec
@@ -4,13 +4,14 @@
 Summary:	%{modname} - PHP extension for expect library
 Summary(pl.UTF-8):	%{modname} - rozszerzenie PHP dla biblioteki expect
 Name:		%{php_name}-pecl-%{modname}
-Version:	0.3.3
+Version:	0.4.0
 Release:	1
 License:	PHP 3.01
 Group:		Development/Languages/PHP
-Source0:	http://pecl.php.net/get/%{modname}-%{version}.tgz
-# Source0-md5:	a657a640e7e4e7cb1540b9706ffe1219
-URL:		http://pecl.php.net/package/expect/
+Source0:	https://pecl.php.net/get/%{modname}-%{version}.tgz
+# Source0-md5:	f4cfd4ff3a1ff5ee29ff833a9e5df1cb
+Patch0:		master.patch
+URL:		https://pecl.php.net/package/expect/
 BuildRequires:	%{php_name}-devel >= 3:5.0.4
 BuildRequires:	expect-devel
 BuildRequires:	rpmbuild(macros) >= 1.650
@@ -34,6 +35,7 @@ To rozszerzenie ma w PECL status: %{status}.
 %prep
 %setup -qc
 mv %{modname}-%{version}/* .
+%patch -P0 -p1
 
 %build
 phpize
diff --git a/master.patch b/master.patch
new file mode 100644
index 0000000..35d31f9
--- /dev/null
+++ b/master.patch
@@ -0,0 +1,68 @@
+diff -Naur -x .git -x package.xml expect-0.4.0/expect.c pecl-expect-master/expect.c
+--- expect-0.4.0/expect.c	2020-01-13 19:27:49.000000000 +0100
++++ pecl-expect-master/expect.c	2026-02-19 13:13:01.974248497 +0100
+@@ -1,6 +1,6 @@
+ /*
+   +----------------------------------------------------------------------+
+-  | PHP Version 5 and 7                                                  |
++  | PHP Version 5, 7 and 8                                               |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2004 The PHP Group                                |
+   +----------------------------------------------------------------------+
+@@ -318,7 +318,7 @@
+ 	
+ 	if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3) { WRONG_PARAM_COUNT; }
+ 
+-	if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ra|z", &z_stream, &z_cases, &z_match) == FAILURE) {
++	if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ra|z/", &z_stream, &z_cases, &z_match) == FAILURE) {
+ 		return;
+ 	}
+ 
+@@ -452,11 +452,15 @@
+ 		if (z_match && exp_match && exp_match_len > 0) {
+ 			char *tmp = (char *)emalloc (sizeof(char) * (exp_match_len + 1));
+ 			strlcpy (tmp, exp_match, exp_match_len + 1);
+-			zval_dtor (z_match);
+-			array_init(z_match);
+ #if PHP_MAJOR_VERSION >= 7
++            z_match = zend_try_array_init(z_match);
++			if (!z_match) {
++				return;
++			}
+             add_index_string(z_match, 0, tmp);
+ #else
++			zval_dtor (z_match);
++			array_init(z_match);
+ 			add_index_string(z_match, 0, tmp, 1);
+ #endif
+ 			/* Get case that was matched */
+diff -Naur -x .git -x package.xml expect-0.4.0/php_expect.h pecl-expect-master/php_expect.h
+--- expect-0.4.0/php_expect.h	2020-01-13 19:27:49.000000000 +0100
++++ pecl-expect-master/php_expect.h	2026-02-19 13:13:01.974248497 +0100
+@@ -1,6 +1,6 @@
+ /*
+   +----------------------------------------------------------------------+
+-  | PHP Version 5 and 7                                                  |
++  | PHP Version 5, 7 and 8                                               |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2004 The PHP Group                                |
+   +----------------------------------------------------------------------+
+@@ -68,6 +68,18 @@
+ #include "TSRM.h"
+ #endif /* ZTS */
+ 
++
++#if ZEND_MODULE_API_NO >= 20190128
++#ifndef TSRMLS_CC
++#define TSRMLS_CC
++#endif
++#ifndef TSRMLS_DC
++#define TSRMLS_DC
++#endif
++#ifndef TSRMLS_FETCH
++#define TSRMLS_FETCH()
++#endif
++#endif
+ #endif /* PHP_EXPECT_H */
+ 
+ /*
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-expect.git/commitdiff/3549f950ae9a264a17b218adf297ceda5758e011



More information about the pld-cvs-commit mailing list