summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-09-04 10:06:56 +0200
committerRemi Collet <remi@php.net>2023-09-04 10:06:56 +0200
commit2c3c897ecfe1c4a6657446bbc48bffcbcb580aff (patch)
tree7449ba201701543b2d5aa5988b170f08ab8cf132
parentd073a413b8cadd5438e62073f202fb81c8fafeaf (diff)
build out of sources treeHEADmaster
add patch for test suite with PHP 8.3 from https://github.com/TysonAndre/pecl-teds/pull/204
-rw-r--r--php-pecl-teds.spec56
-rw-r--r--teds-php83.patch112
2 files changed, 142 insertions, 26 deletions
diff --git a/php-pecl-teds.spec b/php-pecl-teds.spec
index 20d7dfc..362be77 100644
--- a/php-pecl-teds.spec
+++ b/php-pecl-teds.spec
@@ -1,35 +1,35 @@
# remirepo spec file for php-pecl-teds
#
-# Copyright (c) 2021-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2021-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
-
-%if 0%{?scl:1}
-%scl_package php-pecl-teds
-%endif
+%{?scl:%scl_package php-pecl-teds}
%bcond_without tests
+
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name teds
%global ini_name 40-%{pecl_name}.ini
%global upstream_version 1.3.0
#global upstream_prever a1
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Tentative Extra Data Structures
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-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: BSD
+License: BSD-3-Clause
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
+
+Patch0: %{pecl_name}-php83.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -38,7 +38,6 @@ BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -55,14 +54,14 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/COPYING/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
+cd %{sources}
+%patch -P0 -p1 -b.pr204
# Check version as upstream often forget to update this
extver=$(sed -n '/define PHP_TEDS_VERSION/{s/.* "//;s/".*$//;p}' php_teds.h)
@@ -72,10 +71,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}
fi
cd ..
-
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -94,15 +92,16 @@ peclconf() {
--with-php-config=$1
}
-cd NTS
-%{_bindir}/phpize
-peclconf %{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+peclconf %{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-peclconf %{_bindir}/zts-php-config
+peclconf %{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -125,13 +124,13 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do [ -f NTS/$i ] && install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do [ -f %{sources}/$i ] && install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%check
: Minimal load test for NTS extension
-%{_bindir}/php --no-php-ini \
+%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
@@ -144,7 +143,7 @@ done
%endif
%if %{with tests}
-cd NTS
+cd %{sources}
: Run upstream test suite
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
%{__php} -n run-tests.php -q --show-diff %{?_smp_mflags}
@@ -172,7 +171,7 @@ fi
%files
-%{?_licensedir:%license NTS/COPYING}
+%{?_licensedir:%license %{sources}/COPYING}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -186,6 +185,11 @@ fi
%changelog
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 1.3.0-2
+- build out of sources tree
+- add patch for test suite with PHP 8.3 from
+ https://github.com/TysonAndre/pecl-teds/pull/204
+
* Thu Nov 10 2022 Remi Collet <remi@remirepo.net> - 1.3.0-1
- update to 1.3.0
diff --git a/teds-php83.patch b/teds-php83.patch
new file mode 100644
index 0000000..41d2662
--- /dev/null
+++ b/teds-php83.patch
@@ -0,0 +1,112 @@
+From 590af3d5af3a26b9a0159eac95f19028cfe4c45e Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 4 Sep 2023 09:59:13 +0200
+Subject: [PATCH] relax test expectations for 8.3
+
+---
+ tests/Map/toArray.phpt | 8 ++++----
+ tests/iterable/all_array.phpt | 6 +++---
+ tests/iterable/any_array.phpt | 6 +++---
+ tests/iterable/none_array.phpt | 4 ++--
+ 4 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/Map/toArray.phpt b/tests/Map/toArray.phpt
+index 11bce83..f0e43f1 100644
+--- a/tests/Map/toArray.phpt
++++ b/tests/Map/toArray.phpt
+@@ -26,7 +26,7 @@ foreach ([
+ test_to_array($class);
+ }
+ ?>
+---EXPECT--
++--EXPECTF--
+ Test Teds\StrictSortedVectorMap
+ array(2) {
+ ["def"]=>
+@@ -35,7 +35,7 @@ array(2) {
+ ["v_abc"]=>
+ string(3) "v_x"
+ }
+-Caught: Illegal offset type
++Caught: %s offset %s
+ Test Teds\StrictTreeMap
+ array(2) {
+ ["def"]=>
+@@ -44,7 +44,7 @@ array(2) {
+ ["v_abc"]=>
+ string(3) "v_x"
+ }
+-Caught: Illegal offset type
++Caught: %s offset %s
+ Test Teds\StrictHashMap
+ array(2) {
+ ["v_abc"]=>
+@@ -53,4 +53,4 @@ array(2) {
+ object(stdClass)#2 (0) {
+ }
+ }
+-Caught: Illegal offset type
+\ No newline at end of file
++Caught: %s offset %s
+diff --git a/tests/iterable/all_array.phpt b/tests/iterable/all_array.phpt
+index 3ef30e1..8d3df7b 100644
+--- a/tests/iterable/all_array.phpt
++++ b/tests/iterable/all_array.phpt
+@@ -51,9 +51,9 @@ echo "\nDone";
+ --EXPECTF--
+ *** Testing not enough or wrong arguments ***
+ Caught ArgumentCountError: Teds\all() expects at least 1 argument, 0 given
+-Caught TypeError: Teds\all(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\all(): Argument #1 ($iterable) must be of type %s, %s given
+ bool(true)
+-Caught TypeError: Teds\all(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\all(): Argument #1 ($iterable) must be of type %s, %s given
+ Caught TypeError: Teds\all(): Argument #2 ($callback) must be a valid callback%S, no array or string given
+
+ *** Testing basic functionality ***
+@@ -65,4 +65,4 @@ int(1)
+ *** Testing edge cases ***
+ bool(true)
+
+-Done
+\ No newline at end of file
++Done
+diff --git a/tests/iterable/any_array.phpt b/tests/iterable/any_array.phpt
+index 892c50c..09e28aa 100644
+--- a/tests/iterable/any_array.phpt
++++ b/tests/iterable/any_array.phpt
+@@ -60,9 +60,9 @@ echo "\nDone";
+ --EXPECTF--
+ *** Testing not enough or wrong arguments ***
+ Caught ArgumentCountError: Teds\any() expects at least 1 argument, 0 given
+-Caught TypeError: Teds\any(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\any(): Argument #1 ($iterable) must be of type %s, %s given
+ bool(false)
+-Caught TypeError: Teds\any(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\any(): Argument #1 ($iterable) must be of type %s, %s given
+ Caught TypeError: Teds\any(): Argument #2 ($callback) must be a valid callback%S, no array or string given
+
+ *** Testing basic functionality ***
+@@ -78,4 +78,4 @@ Caught ArgumentCountError: Too few arguments to function {closure}(), 1 passed a
+ bool(false)
+ bool(true)
+
+-Done
+\ No newline at end of file
++Done
+diff --git a/tests/iterable/none_array.phpt b/tests/iterable/none_array.phpt
+index a9f779d..5e69706 100644
+--- a/tests/iterable/none_array.phpt
++++ b/tests/iterable/none_array.phpt
+@@ -60,9 +60,9 @@ echo "\nDone";
+ --EXPECTF--
+ *** Testing not enough or wrong arguments ***
+ Caught ArgumentCountError: Teds\none() expects at least 1 argument, 0 given
+-Caught TypeError: Teds\none(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\none(): Argument #1 ($iterable) must be of type %s, %s given
+ bool(true)
+-Caught TypeError: Teds\none(): Argument #1 ($iterable) must be of type %s, bool given
++Caught TypeError: Teds\none(): Argument #1 ($iterable) must be of type %s, %s given
+ Caught TypeError: Teds\none(): Argument #2 ($callback) must be a valid callback%S, no array or string given
+
+ *** Testing basic functionality ***