diff options
Diffstat (limited to 'psysh.spec')
-rw-r--r-- | psysh.spec | 112 |
1 files changed, 72 insertions, 40 deletions
@@ -2,7 +2,7 @@ # # Fedora spec file for psysh # -# Copyright (c) 2016-2019 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2016-2020 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,34 +12,47 @@ %global github_owner bobthecow %global github_name psysh -%global github_version 0.9.11 -%global github_commit 75d9ac1c16db676de27ab554a4152b594be4748e +%global github_version 0.10.4 +%global github_commit a8aec1b2981ab66882a01cce36a49b6317dc3560 %global composer_vendor psy %global composer_project psysh -# "php": ">=5.4.0" -%global php_min_ver 5.4.0 -# "dnoegel/php-xdg-base-dir": "0.1" +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 +%global with_symfony2 0 +%else +%global with_symfony2 1 +%endif + +# "php": "^8.0 || ^7.0 || ^5.5.9" +%global php_min_ver 5.5.9 +# "dnoegel/php-xdg-base-dir": "0.1.*" %global php_xdg_base_dir_min_ver 0.1 %global php_xdg_base_dir_max_ver 0.2 -# "jakub-onderka/php-console-highlighter": "0.3.*|0.4.*" -%global php_console_highlighter_min_ver 0.3.0 -%global php_console_highlighter_max_ver 0.5.0 # "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0" -# NOTE: Min version not 1.2.1 to force 2.x so 1.x is not -# a dependency so it could possibly be retired -%global php_parser_min_ver 2.0 +# NOTE: Forcing minimum version 4 +%global php_parser_min_ver 4.0 %global php_parser_max_ver 5.0 -# "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0|~5.0" -# "symfony/var-dumper": "~2.7|~3.0|~4.0|~5.0" +# "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10" +# "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" +%if %{with_symfony2} # NOTE: Min version not 2.7.0 because autoloader required %global symfony_min_ver 2.7.1 +%else +%global symfony_min_ver 3.0 +%endif %global symfony_max_ver 6.0 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} +# Range dependencies supported? +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global with_range_dependencies 1 +%else +%global with_range_dependencies 0 +%endif + %{!?phpdir: %global phpdir %{_datadir}/php} Name: psysh @@ -48,8 +61,12 @@ Release: 1%{?github_release}%{?dist} Summary: A runtime developer console, interactive debugger and REPL for PHP License: MIT -URL: http://psysh.org -Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +URL: https://psysh.org + +# GitHub export does not include tests +# Run psysh-get-source.sh to create full source +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh # Update bin script to use generated autoloader Patch0: %{name}-bin-autoload.patch @@ -61,18 +78,16 @@ BuildRequires: php-cli ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) +%if %{with_range_dependencies} +BuildRequires: (php-composer(dnoegel/php-xdg-base-dir) >= %{php_xdg_base_dir_min_ver} with php-composer(dnoegel/php-xdg-base-dir) < %{php_xdg_base_dir_max_ver}) +BuildRequires: (php-composer(nikic/php-parser) >= %{php_parser_min_ver} with php-composer(nikic/php-parser) < %{php_parser_max_ver}) +BuildRequires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +BuildRequires: (php-composer(symfony/var-dumper) >= %{symfony_min_ver} with php-composer(symfony/var-dumper) < %{symfony_max_ver}) +%else BuildRequires: php-composer(dnoegel/php-xdg-base-dir) < %{php_xdg_base_dir_max_ver} BuildRequires: php-composer(dnoegel/php-xdg-base-dir) >= %{php_xdg_base_dir_min_ver} -BuildRequires: php-composer(jakub-onderka/php-console-highlighter) < %{php_console_highlighter_max_ver} -BuildRequires: php-composer(jakub-onderka/php-console-highlighter) >= %{php_console_highlighter_min_ver} BuildRequires: php-composer(nikic/php-parser) < %{php_parser_max_ver} BuildRequires: php-composer(nikic/php-parser) >= %{php_parser_min_ver} -%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 -BuildRequires: php-composer(symfony/console) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver} -BuildRequires: php-composer(symfony/var-dumper) < %{symfony_max_ver} -BuildRequires: php-composer(symfony/var-dumper) >= %{symfony_min_ver} -%else BuildRequires: php-symfony3-console BuildRequires: php-symfony3-var-dumper %endif @@ -83,7 +98,7 @@ BuildRequires: php-pcntl BuildRequires: php-posix BuildRequires: php-readline BuildRequires: php-sqlite3 -## phpcompatinfo (computed from version 0.9.11) +## phpcompatinfo (computed from version 0.10.4) BuildRequires: php-date BuildRequires: php-dom BuildRequires: php-pcre @@ -97,18 +112,16 @@ BuildRequires: php-composer(fedora/autoloader) Requires: php-cli # composer.json Requires: php(language) >= %{php_min_ver} +%if %{with_range_dependencies} +Requires: (php-composer(dnoegel/php-xdg-base-dir) >= %{php_xdg_base_dir_min_ver} with php-composer(dnoegel/php-xdg-base-dir) < %{php_xdg_base_dir_max_ver}) +Requires: (php-composer(nikic/php-parser) >= %{php_parser_min_ver} with php-composer(nikic/php-parser) < %{php_parser_max_ver}) +Requires: (php-composer(symfony/console) >= %{symfony_min_ver} with php-composer(symfony/console) < %{symfony_max_ver}) +Requires: (php-composer(symfony/var-dumper) >= %{symfony_min_ver} with php-composer(symfony/var-dumper) < %{symfony_max_ver}) +%else Requires: php-composer(dnoegel/php-xdg-base-dir) < %{php_xdg_base_dir_max_ver} Requires: php-composer(dnoegel/php-xdg-base-dir) >= %{php_xdg_base_dir_min_ver} -Requires: php-composer(jakub-onderka/php-console-highlighter) < %{php_console_highlighter_max_ver} -Requires: php-composer(jakub-onderka/php-console-highlighter) >= %{php_console_highlighter_min_ver} Requires: php-composer(nikic/php-parser) < %{php_parser_max_ver} Requires: php-composer(nikic/php-parser) >= %{php_parser_min_ver} -%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 -Requires: php-composer(symfony/console) < %{symfony_max_ver} -Requires: php-composer(symfony/console) >= %{symfony_min_ver} -Requires: php-composer(symfony/var-dumper) < %{symfony_max_ver} -Requires: php-composer(symfony/var-dumper) >= %{symfony_min_ver} -%else Requires: php-symfony3-console Requires: php-symfony3-var-dumper %endif @@ -119,7 +132,7 @@ Requires: php-pcntl Requires: php-posix Requires: php-readline Requires: php-sqlite3 -# phpcompatinfo (computed from version 0.9.11) +# phpcompatinfo (computed from version 0.10.4) Requires: php-date Requires: php-pcre Requires: php-pdo @@ -161,7 +174,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; require_once __DIR__.'/functions.php'; \Fedora\Autoloader\Dependencies::required([ - '%{phpdir}/JakubOnderka/PhpConsoleHighlighter/autoload.php', + '%{phpdir}/PhpParser4/autoload.php', '%{phpdir}/XdgBaseDir/autoload.php', [ '%{phpdir}/Symfony5/Component/Console/autoload.php', @@ -175,11 +188,6 @@ require_once __DIR__.'/functions.php'; '%{phpdir}/Symfony3/Component/VarDumper/autoload.php', '%{phpdir}/Symfony/Component/VarDumper/autoload.php', ], - [ - '%{phpdir}/PhpParser4/autoload.php', - '%{phpdir}/PhpParser3/autoload.php', - '%{phpdir}/PhpParser2/autoload.php', - ], ]); AUTOLOAD @@ -212,6 +220,23 @@ sed 's/function testFormat/function SKIP_testFormat/' \ -i test/Formatter/CodeFormatterTest.php sed 's/function testWriteReturnValue/function SKIP_testWriteReturnValue/' \ -i test/ShellTest.php +sed 's/function testMoreUnclosedStatements/function SKIP_testMoreUnclosedStatements/' \ + -i test/CodeCleanerTest.php +sed 's/function testEnumerateUserFunctions/function SKIP_testEnumerateUserFunctions/' \ + -i test/Command/ListCommand/FunctionEnumeratorTest.php +sed 's/function testEnumerate/function SKIP_testEnumerate/' \ + -i test/Command/ListCommand/GlobalVariableEnumeratorTest.php +sed 's/function testEnumerateEnumerates/function SKIP_testEnumerateEnumerates/' \ + -i test/Command/ListCommand/VariableEnumeratorTest.php +sed 's/function testEnumerateAllEnumeratesEvenMore/function SKIP_testEnumerateAllEnumeratesEvenMore/' \ + -i test/Command/ListCommand/VariableEnumeratorTest.php +: Skip test failing with php 7.3 +sed -e 's/function testConfigurationFromInput/function SKIP_testConfigurationFromInput/' \ + -e 's/function testConfigurationFromInputSpecificity/function SKIP_testConfigurationFromInputSpecificity/' \ + -e 's/function testConfigurationFromInputVerbosityLevels/function SKIP_testConfigurationFromInputVerbosityLevels/' \ + -e 's/function testConfigurationFromInputShortOptions/function SKIP_testConfigurationFromInputShortOptions/' \ + -i test/ConfigurationTest.php + : Drop unneeded test as readline is always there rm test/Readline/HoaConsoleTest.php @@ -241,6 +266,13 @@ exit $RETURN_CODE %changelog +* Sun Aug 16 2020 Shawn Iwinski <shawn@iwin.ski> - 0.10.4-1 +- Update to 0.10.4 (RHBZ #1782258) +- Fix FTBFS (RHBZ #1865260) +- Conditionally use range dependencies +- Conditionally drop Symfony 2 interoperability +- Force "nikic/php-parser" minimum version 4 + * Sun Dec 01 2019 Shawn Iwinski <shawn@iwin.ski> - 0.9.11-1 - Update to 0.9.11 (RHBZ #1529814) |