summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer-diff.json34
-rw-r--r--composer.json9
-rwxr-xr-xmakesrc.sh26
-rw-r--r--php-cs-fixer-autoload.patch3
-rw-r--r--php-cs-fixer.spec29
5 files changed, 89 insertions, 12 deletions
diff --git a/composer-diff.json b/composer-diff.json
new file mode 100644
index 0000000..49b712b
--- /dev/null
+++ b/composer-diff.json
@@ -0,0 +1,34 @@
+{
+ "name": "php-cs-fixer/diff",
+ "description": "sebastian/diff v2 backport support for PHP5.6",
+ "keywords": ["diff"],
+ "homepage": "https://github.com/PHP-CS-Fixer",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.4.3"
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "PhpCsFixer\\Diff\\v1_4\\Tests\\": "tests/v1_4",
+ "PhpCsFixer\\Diff\\v2_0\\Tests\\": "tests/v2_0"
+ }
+ }
+}
diff --git a/composer.json b/composer.json
index 340b3ca..2eac312 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"composer/semver": "^1.4",
"doctrine/annotations": "^1.2",
"gecko-packages/gecko-php-unit": "^2.0",
- "sebastian/diff": "^1.4",
+ "php-cs-fixer/diff": "^1.0",
"symfony/console": "^3.2",
"symfony/event-dispatcher": "^3.0",
"symfony/filesystem": "^3.0",
@@ -63,5 +63,10 @@
"autoload-dev": {
"psr-4": { "PhpCsFixer\\Tests\\": "tests/" }
},
- "bin": ["php-cs-fixer"]
+ "bin": ["php-cs-fixer"],
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7-dev"
+ }
+ }
}
diff --git a/makesrc.sh b/makesrc.sh
index c047df5..d5a6236 100755
--- a/makesrc.sh
+++ b/makesrc.sh
@@ -7,7 +7,7 @@ VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
SHORT=${COMMIT:0:7}
-echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT\n"
echo "Cloning..."
git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
@@ -24,4 +24,28 @@ tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
echo "Cleaning..."
rm -rf $PROJECT-$COMMIT
+PROJECT=diff
+OWNER=$(sed -n '/^%global gh_diff_owner/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^%global gh_diff_version/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_diff_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT\n"
+
+echo "Cloning..."
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer-diff.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$PROJECT-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
echo "Done."
+
diff --git a/php-cs-fixer-autoload.patch b/php-cs-fixer-autoload.patch
index 6e8261b..9ccd7e3 100644
--- a/php-cs-fixer-autoload.patch
+++ b/php-cs-fixer-autoload.patch
@@ -36,13 +36,14 @@ diff -up ./src/Console/Command/HelpCommand.php.rpm ./src/Console/Command/HelpCom
diff -up ./tests/AutoReview/ProjectCodeTest.php.rpm ./tests/AutoReview/ProjectCodeTest.php
--- ./tests/AutoReview/ProjectCodeTest.php.rpm 2017-10-02 16:03:56.000000000 +0200
+++ ./tests/AutoReview/ProjectCodeTest.php 2017-10-02 16:04:28.745937469 +0200
-@@ -383,8 +383,10 @@ final class ProjectCodeTest extends Test
+@@ -383,8 +383,11 @@ final class ProjectCodeTest extends Test
->files()
->name('*.php')
->in(__DIR__.'/../../src')
+ ->notName('autoload.php')
->exclude([
'Resources',
++ 'diff',
+ 'tests',
])
;
diff --git a/php-cs-fixer.spec b/php-cs-fixer.spec
index c0d6ef9..53b13a5 100644
--- a/php-cs-fixer.spec
+++ b/php-cs-fixer.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit a0484335b26a05b4353f7a0691a887b7a3706fe5
+%global gh_commit e4e93a120117e879cfc1f231fbf29274707cd834
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20150717
%global gh_owner FriendsOfPHP
@@ -14,8 +14,14 @@
%global php_home %{_datadir}/php
%global with_tests 0%{!?_without_tests:1}
+# Bundled this fork which is not designed for use outside of php-cs-fixer
+%global gh_diff_owner PHP-CS-Fixer
+%global gh_diff_version 1.1.0
+%global gh_diff_commit d068edadcb8f7bc2ea3d3769cdbaf609026ec4f4
+%global gh_diff_short %(c=%{gh_diff_commit}; echo ${c:0:7})
+
Name: php-cs-fixer
-Version: 2.6.1
+Version: 2.7.0
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}
Summary: A tool to automatically fix PHP code style
@@ -24,7 +30,8 @@ License: MIT
URL: https://github.com/%{gh_owner}/%{gh_project}
# git snapshot to get upstream test suite
Source0: %{name}-%{version}-%{gh_short}.tgz
-Source1: makesrc.sh
+Source1: %{name}-diff-%{gh_diff_version}-%{gh_diff_short}.tgz
+Source2: makesrc.sh
# Use our autoloader
Patch0: %{name}-autoload.patch
@@ -98,7 +105,8 @@ BuildRequires: php-fedora-autoloader-devel
# "composer/semver": "^1.4",
# "doctrine/annotations": "^1.2",
# "gecko-packages/gecko-php-unit": "^2.0",
-# "sebastian/diff": "^1.4",
+# Bundled
+# "php-cs-fixer/diff": "^1.0",
# "symfony/console": "^3.2",
# "symfony/event-dispatcher": "^3.0",
# "symfony/filesystem": "^3.0",
@@ -170,8 +178,10 @@ projects. This tool does not only detect them, but also fixes them for you.
%prep
-%setup -q -n %{gh_project}-%{gh_commit}
+%setup -q -n %{gh_project}-%{gh_commit} -a1
%patch0 -p1 -b .rpm
+mv diff-%{gh_diff_commit}/src src/diff
+
find src -name \*rpm -delete -print
# from composer.json, "autoload" / "classmap"
@@ -191,7 +201,7 @@ done
sed -e 's:../../../dev-tools/::' -i src/Console/Command/HelpCommand.php
cp -pr dev-tools/ci-integration.sh src/Console/Command/
-phpab --template fedora --output src/autoload.php src/tests
+phpab --template fedora --output src/autoload.php src/tests src/diff
cat << 'EOF' | tee -a src/autoload.php
@@ -207,7 +217,6 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/Symfony3/Component/OptionsResolver/autoload.php',
'%{php_home}/Symfony3/Component/Process/autoload.php',
'%{php_home}/Symfony3/Component/Stopwatch//autoload.php',
- '%{php_home}/SebastianBergmann/Diff/autoload.php',
'%{php_home}/Symfony/Polyfill/autoload.php',
]);
EOF
@@ -252,7 +261,7 @@ sed -e 's/listeners/nolistener/' phpunit.xml.dist >phpunit.xml
sed -e 's:%{php_home}:%{buildroot}%{php_home}:' -i %{name}
ret=0
-for cmd in php php56 php70 php71 php72; do
+for cmd in php php70 php71 php72; do
if which $cmd; then
$cmd -d memory_limit=1G %{_bindir}/phpunit || ret=1
fi
@@ -273,6 +282,10 @@ exit $ret
%changelog
+* Mon Oct 2 2017 Remi Collet <remi@remirepo.net> - 2.7.0-1
+- Update to 2.7.0
+- drop dependency on sebastian/diff, bundle fork instead
+
* Mon Oct 2 2017 Remi Collet <remi@remirepo.net> - 2.6.1-1
- Update to 2.6.1