From 28d728beaf94d939b1ad2333f3b13f852132d7f4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Jan 31 2024 09:47:47 +0000 Subject: add upstream patch for PHP 8.2 add patch for PHP 8.3 from https://github.com/zetacomponents/ConsoleTools/pull/26 fix FTBFS #2261516 --- diff --git a/.gitignore b/.gitignore index e1ecb72..0733c1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ clog /ConsoleTools-1.7.2-97fb074.tar.gz /ConsoleTools-1.7.3-fbc31f1.tar.gz +/php-zetacomponents-console-tools-1.7.3-fbc31f1.tar.gz diff --git a/php-zetacomponents-console-tools-php82.patch b/php-zetacomponents-console-tools-php82.patch new file mode 100644 index 0000000..f843466 --- /dev/null +++ b/php-zetacomponents-console-tools-php82.patch @@ -0,0 +1,36 @@ +From 6b79adc263902c881df80e5872125a43a05dfe36 Mon Sep 17 00:00:00 2001 +From: Derick Rethans +Date: Tue, 19 Jul 2022 16:33:29 +0100 +Subject: [PATCH] PHP 8.2: Do not rely on dynamic properties in tests + +--- + tests/input_test.php | 2 ++ + tests/table_test.php | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/tests/input_test.php b/tests/input_test.php +index c694b82..86b1203 100644 +--- a/tests/input_test.php ++++ b/tests/input_test.php +@@ -189,6 +189,8 @@ class ezcConsoleInputTest extends ezcTestCase + ), + ); + ++ private $input = null; ++ + public static function suite() + { + return new PHPUnit\Framework\TestSuite( "ezcConsoleInputTest" ); +diff --git a/tests/table_test.php b/tests/table_test.php +index c862ee5..a4697a2 100644 +--- a/tests/table_test.php ++++ b/tests/table_test.php +@@ -68,6 +68,8 @@ class ezcConsoleTableTest extends ezcTestCase + array( 'Nön UTF-8 cölümn 1', 'Nön UTF-8 cölümn 2', 'Löng löng löng löng löng löng löng nön UTF-8 cölümn' ), + ); + ++ private $output = null; ++ + public static function suite() + { + return new PHPUnit\Framework\TestSuite( "ezcConsoleTableTest" ); diff --git a/php-zetacomponents-console-tools-php83.patch b/php-zetacomponents-console-tools-php83.patch new file mode 100644 index 0000000..b9ddacb --- /dev/null +++ b/php-zetacomponents-console-tools-php83.patch @@ -0,0 +1,28 @@ +From ca4d4776e533fc4cef68890c03ef53667f0386e8 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 31 Jan 2024 10:31:52 +0100 +Subject: [PATCH] Drop unused arg, fix Increment on type bool + +--- + src/input/help_generators/standard.php | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/input/help_generators/standard.php b/src/input/help_generators/standard.php +index b979927..614aaa7 100644 +--- a/src/input/help_generators/standard.php ++++ b/src/input/help_generators/standard.php +@@ -276,13 +276,12 @@ private function getOptionHelpRow( $long, ezcConsoleOption $param ) + public function generateSynopsis( array $optionFilter = null ) + { + $usedOptions = array( 'short' => array(), 'long' => array() ); +- $allowsArgs = true; + $synopsis = '$ ' . ( isset( $argv ) && sizeof( $argv ) > 0 ? $argv[0] : $_SERVER['argv'][0] ) . ' '; + foreach ( $this->input->getOptions() as $option ) + { + if ( $optionFilter === null || in_array( $option->short, $optionFilter ) || in_array( $option->long, $optionFilter ) ) + { +- $synopsis .= $this->createOptionSynopsis( $option, $usedOptions, $allowsArgs ); ++ $synopsis .= $this->createOptionSynopsis( $option, $usedOptions ); + } + } + if ( $this->input->argumentDefinition === null ) diff --git a/php-zetacomponents-console-tools.spec b/php-zetacomponents-console-tools.spec index 2d53533..afe0acb 100644 --- a/php-zetacomponents-console-tools.spec +++ b/php-zetacomponents-console-tools.spec @@ -1,7 +1,7 @@ # remirepo/fedora spec file for php-zetacomponents-console-tools # -# Copyright (c) 2015-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2015-2024 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -26,11 +26,14 @@ Version: 1.7.3 Release: 8%{?dist} Summary: Zeta %{gh_project} Component -License: ASL 2.0 +License: Apache-2.0 URL: http://zetacomponents.org/ -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz Source1: autoloader.php +Patch0: %{name}-php82.patch +Patch1: %{name}-php83.patch + BuildArch: noarch %if %{with phpab} BuildRequires: %{_bindir}/phpab @@ -41,7 +44,7 @@ BuildRequires: (php-composer(%{gh_owner}/base) >= 1.8 with php-composer(%{gh_o # "phpunit/phpunit": "~8.0", # "zetacomponents/unit-test": "*" BuildRequires: phpunit9 -BuildRequires: php-composer(%{gh_owner}/unit-test) >= 1.2.0 +BuildRequires: php-composer(%{gh_owner}/unit-test) >= 1.2.4 %endif # From composer.json, "require": { @@ -76,6 +79,8 @@ Requires: %{name} = %{version}-%{release} %prep %setup -q -n %{gh_project}-%{gh_commit} +%patch -P0 -p1 +%patch -P1 -p1 %build @@ -116,12 +121,10 @@ EOF : Drop assertion which rely on path in sources dir sed -e '/realpath/d' -i tests/statusbar_test.php -: Not ready for phpunit9 -rm tests/option_test.php tests/arguments_test.php : Run test test suite -for cmd in php php74 php80 php81 +for cmd in php php81 php82 php83 do if which $cmd; then @@ -145,6 +148,11 @@ done %changelog +* Wed Jan 31 2024 Remi Collet - 1.7.3-8 +- add upstream patch for PHP 8.2 +- add patch for PHP 8.3 from https://github.com/zetacomponents/ConsoleTools/pull/26 +- fix FTBFS #2261516 + * Thu Jan 25 2024 Fedora Release Engineering - 1.7.3-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 11a63f8..7c38b3d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ConsoleTools-1.7.3-fbc31f1.tar.gz) = 33b20a9f8752bfe95672bd2aecae9b40a4bff24eb7dbaa528e534ce6327814f91ef2c41ae4c64c73d1cd345c3278f1893bb405ee16a1104a2b45b96a55996016 +SHA512 (php-zetacomponents-console-tools-1.7.3-fbc31f1.tar.gz) = 33b20a9f8752bfe95672bd2aecae9b40a4bff24eb7dbaa528e534ce6327814f91ef2c41ae4c64c73d1cd345c3278f1893bb405ee16a1104a2b45b96a55996016