From dcef13ee1e4e097043565e7e7ec7f8d04269ff94 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 19 Nov 2018 16:24:19 +0100 Subject: update to 0.11.4 raise minimal PHP version to 5.6 add dependency on league/container 2.4 add dependency on league/flysystem 1.0 add dependency on symfony/console 3.4 --- composer.json | 31 ++++++++++---- zephir-rpm.patch | 71 +++++++++++++++++-------------- zephir.spec | 127 ++++++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 166 insertions(+), 63 deletions(-) diff --git a/composer.json b/composer.json index cb4f925..b8e242a 100644 --- a/composer.json +++ b/composer.json @@ -21,38 +21,53 @@ } ], "require": { - "php": ">=5.5", + "php": ">=5.6.0 <8.0", + "ext-SPL": "*", "ext-ctype": "*", "ext-hash": "*", "ext-json": "*", + "ext-mbstring": "*", + "ext-pcre": "*", "ext-xml": "*", - "ext-mbstring": "*" + "league/container": "^2.4 || ^3.2", + "league/flysystem": "1.0.*", + "symfony/console": "3.4.*" }, "require-dev": { "ext-gmp": "*", "ext-pdo": "*", "ext-pdo_sqlite": "*", - "phpunit/phpunit": "^4.8 || ^5.7", - "squizlabs/php_codesniffer": "^3.2" + "phpunit/phpunit": "~5.7", + "squizlabs/php_codesniffer": "~3.2" + }, + "config": { + "optimize-autoloader": true, + "platform": {}, + "preferred-install": "dist", + "sort-packages": true }, "autoload": { "psr-4": { "Zephir\\": "Library" - } + }, + "files": [ + "Library/functions.php" + ] }, "autoload-dev": { "psr-4": { - "Zephir\\Stubs\\": "unit-tests/Zephir/Stubs/", "Zephir\\Test\\": "unit-tests/Zephir/Test/", "Zephir\\Support\\": "unit-tests/Zephir/Support/", "Extension\\": "unit-tests/Extension/" }, "classmap": [ - "unit-tests/Data/" + "unit-tests/fixtures/mocks/" ] }, + "minimum-stability": "dev", + "prefer-stable": true, "bin": [ - "bin/zephir" + "zephir" ], "support": { "issues": "https://github.com/phalcon/zephir/issues?state=open", diff --git a/zephir-rpm.patch b/zephir-rpm.patch index 9598e20..45e07cb 100644 --- a/zephir-rpm.patch +++ b/zephir-rpm.patch @@ -1,33 +1,42 @@ -diff -up ./bin/zephir.rpm ./bin/zephir ---- ./bin/zephir.rpm 2017-10-23 07:02:31.781050845 +0200 -+++ ./bin/zephir 2017-10-23 07:04:04.955553874 +0200 -@@ -1,26 +1,10 @@ - #!/bin/sh - if [ -z "$ZEPHIRDIR" ]; then -- ZEPHIRDIR="%ZEPHIRDIR%" -- if [ "$ZEPHIRDIR" = "%""ZEPHIRDIR""%" ]; then -- if [ -h $0 ]; then -- REALPATH="`dirname $0`/`readlink $0`" -- CURDIR=`dirname $REALPATH` -- else -- CURDIR=`dirname $0` -- fi -- PARENTDIR=`cd $CURDIR/..; pwd` +diff -up ./zephir.rpm ./zephir +--- ./zephir.rpm 2018-11-18 10:28:31.000000000 +0100 ++++ ./zephir 2018-11-19 15:44:52.976871411 +0100 +@@ -1,4 +1,3 @@ +-#!/usr/bin/env php + add(new Zephir\Command\InitCommand()); + $app->add(new Zephir\Command\GenerateCommand()); diff --git a/zephir.spec b/zephir.spec index 3b7c8fe..2557a16 100644 --- a/zephir.spec +++ b/zephir.spec @@ -21,7 +21,7 @@ # Get commit from PHP_PHALCON_ZEPVERSION in # https://github.com/phalcon/cphalcon/blob/master/ext/php_phalcon.h -%global gh_commit ab3551da612b837cbeb2dc228052a6d35bec5778 +%global gh_commit d0a6a8af0b78240a0f3e1f05d39baf73699a5570 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) #global gh_date 20161126 %global gh_owner phalcon @@ -30,7 +30,7 @@ %global parser_ver 1.1.1 Name: %{?scl_prefix}%{gh_project} -Version: 0.11.1 +Version: 0.11.4 Release: 1%{?gh_date:.%{gh_date}.%{gh_short}}%{?dist} Summary: Zephir language for creation of extensions for PHP. @@ -43,46 +43,71 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit Patch0: %{gh_project}-rpm.patch BuildArch: noarch -BuildRequires: %{?scl_prefix}php-devel > 5.5 +BuildRequires: %{?scl_prefix}php-devel > 5.6 BuildRequires: %{?scl_prefix}php-zephir-parser >= %{parser_ver} %if %{with_tests} BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-hash BuildRequires: %{?scl_prefix}php-ctype +BuildRequires: %{?scl_prefix}php-psr +BuildRequires: %{_bindir}/phpab +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(league/container) >= 2.4 with php-composer(league/container) < 3) +BuildRequires: (php-composer(league/flysystem) >= 1.0 with php-composer(league/flysystem) < 1.1) +BuildRequires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 4) +%else +BuildRequires: php-league-flysystem +BuildRequires: php-league-container +BuildRequires: php-symfony3-console +%endif # From composer.json, "require-dev" # "ext-gmp": "*", # "ext-pdo": "*", # "ext-pdo_sqlite": "*", -# "phpunit/phpunit": "^4.8 || ^5.7, -# "squizlabs/php_codesniffer": "^3.2" +# "phpunit/phpunit": "~5.7", +# "squizlabs/php_codesniffer": "~3.2" BuildRequires: %{?scl_prefix}php-gmp BuildRequires: %{?scl_prefix}php-pdo BuildRequires: %{?scl_prefix}php-pdo_sqlite -BuildRequires: %{?scl_prefix}php-composer(phpunit/phpunit) >= 4.8 +BuildRequires: %{?scl_prefix}php-composer(phpunit/phpunit) >= 5.7 %endif Requires: %{?scl_prefix}php-cli Requires: %{?scl_prefix}php-zephir-parser >= %{parser_ver} # From composer.json, "require" -# "php": ">=5.5", +# "php": ">=5.6.0 <8.0", +# "ext-SPL": "*", # "ext-ctype": "*", # "ext-hash": "*", # "ext-json": "*", +# "ext-mbstring": "*", +# "ext-pcre": "*", # "ext-xml": "*" -# "ext-mbstring": "*" -Requires: %{?scl_prefix}php(language) >= 5.5 +# "league/container": "^2.4 || ^3.2", +# "league/flysystem": "1.0.*", +# "symfony/console": "3.4.*" +Requires: %{?scl_prefix}php(language) >= 5.6 +Requires: %{?scl_prefix}php-spl Requires: %{?scl_prefix}php-ctype Requires: %{?scl_prefix}php-hash Requires: %{?scl_prefix}php-json -Requires: %{?scl_prefix}php-xml Requires: %{?scl_prefix}php-mbstring +Requires: %{?scl_prefix}php-pcre +Requires: %{?scl_prefix}php-xml +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(league/container) >= 2.4 with php-composer(league/container) < 3) +Requires: (php-composer(league/flysystem) >= 1.0 with php-composer(league/flysystem) < 1.1) +Requires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 4) +%else +Requires: php-league-flysystem +Requires: php-league-container +Requires: php-symfony3-console +%endif # From phpcompatinfo Requires: %{?scl_prefix}php-reflection Requires: %{?scl_prefix}php-date Requires: %{?scl_prefix}php-gmp -Requires: %{?scl_prefix}php-pcre Requires: %{?scl_prefix}php-pdo -Requires: %{?scl_prefix}php-spl Provides: %{?scl_prefix}php-composer(%{gh_owner}/%{gh_project}) = %{version} @@ -111,14 +136,43 @@ Compiler design goals: %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p0 -b .rpm + sed -e 's:@DATADIR@:%{_datadir}:;s:@BINDIR@:%{_bindir}:' \ - -i bin/%{gh_project} + -i %{gh_project} + +sed -e 's/\$Id\$/%{gh_short}/' \ + -e 's/0.11.5/0.11.4/' \ + -i Library/Zephir.php find . -name \*.php -exec chmod -x {} \; +cat << 'EOF' >autoload.php + bin/%{gh_project}.test -sh ./bin/%{gh_project}.test version -sh ./bin/%{gh_project}.test version | grep %{version} +sed -e 's:%{_datadir}:%{buildroot}%{_datadir}:' \ + %{gh_project}.php > %{gh_project}.test +%{_bindir}/php %{gh_project}.test --version +%{_bindir}/php %{gh_project}.test --version | grep %{version}-%{gh_short} + +%{_bindir}/php %{_bindir}/phpab -o bs.php unit-tests/fixtures/mocks +cat << 'EOF' | tee -a bs.php +require '%{buildroot}%{_datadir}/%{gh_project}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Zephir\\Test\\', __DIR__ . '/unit-tests/Zephir/Test/'); +\Fedora\Autoloader\Autoload::addPsr4('Zephir\\Support\\', __DIR__ . '/unit-tests/Zephir/Support/'); +\Fedora\Autoloader\Autoload::addPsr4('Extension\\', __DIR__ . '/unit-tests/Extension/'); +require __DIR__ . '/unit-tests/bootstrap.php'; +EOF %if %{with_tests} : Run test suite -%{_bindir}/php -d extension=zephir_parser.so \ - %{_bindir}/phpunit \ - --bootstrap %{buildroot}%{_datadir}/%{gh_project}/bootstrap.php \ - --verbose unit-tests/Zephir +%{_bindir}/php \ + -d extension=zephir_parser.so \ + -d extension=ext/modules/test.so \ + %{_bindir}/phpunit \ + --bootstrap bs.php \ + --no-coverage \ + --verbose unit-tests/Zephir +%{_bindir}/php \ + -d extension=zephir_parser.so \ + -d extension=ext/modules/test.so \ + %{_bindir}/phpunit \ + --bootstrap bs.php \ + --no-coverage \ + --verbose unit-tests/Extension %else : Test suite disabled %endif @@ -162,6 +234,13 @@ sh ./bin/%{gh_project}.test version | grep %{version} %changelog +* Mon Nov 19 2018 Remi Collet - 0.11.4-1 +- update to 0.11.4 +- raise minimal PHP version to 5.6 +- add dependency on league/container 2.4 +- add dependency on league/flysystem 1.0 +- add dependency on symfony/console 3.4 + * Sat Oct 20 2018 Remi Collet - 0.11.1-1 - update to 0.11.1 -- cgit