summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-07-24 07:20:55 +0200
committerRemi Collet <fedora@famillecollet.com>2016-07-24 07:20:55 +0200
commit2422affa57066013e35395842dbae22d85b7fa56 (patch)
treed7f3a602c1765a20d7203f7fc4fa9db2a903b0cc
parent1094ca3f13271d39d3750c7da72ebd395844d35e (diff)
php-patchwork-utf8: 1.3.1 (backported from Fedora)
-rw-r--r--composer.json5
-rwxr-xr-xphp-patchwork-utf8-get-source.sh2
-rw-r--r--php-patchwork-utf8-pr59-modified-for-1-2.patch53
-rw-r--r--php-patchwork-utf8.spec43
4 files changed, 30 insertions, 73 deletions
diff --git a/composer.json b/composer.json
index 4b35276..6e0e64b 100644
--- a/composer.json
+++ b/composer.json
@@ -25,9 +25,12 @@
"psr-4": {"Patchwork\\": "src/Patchwork/"},
"classmap": ["src/Normalizer.php"]
},
+ "autoload-dev": {
+ "files": ["tests/bootstrap.php"]
+ },
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.3-dev"
}
}
}
diff --git a/php-patchwork-utf8-get-source.sh b/php-patchwork-utf8-get-source.sh
index 2e978ed..3bae8e5 100755
--- a/php-patchwork-utf8-get-source.sh
+++ b/php-patchwork-utf8-get-source.sh
@@ -52,7 +52,7 @@ pushd $TEMP_DIR
pushd $GIT_DIR
print "Checking out commit..."
$GIT checkout $GIT_COMMIT
- cp composer.json ${SRC_DIR}/composer-${VERSION}.json
+ cp composer.json ${SRC_DIR}/composer.json
popd
TAR_DIR=${GIT_NAME}-${GIT_COMMIT}
diff --git a/php-patchwork-utf8-pr59-modified-for-1-2.patch b/php-patchwork-utf8-pr59-modified-for-1-2.patch
deleted file mode 100644
index 8ce79b6..0000000
--- a/php-patchwork-utf8-pr59-modified-for-1-2.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From a06e40ae49123fe71d78f9d8d94e97826d5ebbae Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Thu, 28 Apr 2016 09:47:06 +0200
-Subject: [PATCH] fix tests for php 5.5.35/5.6.21/7.0.6
-
----
- src/Patchwork/Utf8.php | 4 +++-
- tests/PHP/Shim/IntlTest.php | 2 +-
- tests/Utf8/HhvmTest.php | 3 ++-
- 3 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/src/Patchwork/Utf8.php b/src/Patchwork/Utf8.php
-index 585f063..4363a08 100644
---- a/src/Patchwork/Utf8.php
-+++ b/src/Patchwork/Utf8.php
-@@ -235,7 +235,9 @@ public static function strlen($s)
- }
- public static function strpos($s, $needle, $offset = 0)
- {
-- return grapheme_strpos($s, $needle, $offset);
-+ // ignore invalid negative offset to keep compatility
-+ // with php < 5.5.35, < 5.6.21, < 7.0.6
-+ return grapheme_strpos($s, $needle, $offset > 0 ? $offset : 0);
- }
- public static function strrpos($s, $needle, $offset = 0)
- {
-diff --git a/tests/Patchwork/Tests/PHP/Shim/IntlTest.php b/tests/PHP/Shim/IntlTest.php
-index 1d4d4a7..83b3aa8 100644
---- a/tests/Patchwork/Tests/PHP/Shim/IntlTest.php
-+++ b/tests/Patchwork/Tests/PHP/Shim/IntlTest.php
-@@ -122,7 +122,7 @@ public function testGrapheme_strpos()
- $this->assertSame(false, grapheme_strpos('abc', ''));
- $this->assertSame(false, grapheme_strpos('abc', 'd'));
- $this->assertSame(false, grapheme_strpos('abc', 'a', 3));
-- $this->assertSame(0, grapheme_strpos('abc', 'a', -1));
-+ $this->assertSame(0, grapheme_strpos('abc', 'a', 0));
- $this->assertSame(1, grapheme_strpos('한국어', '국'));
- $this->assertSame(3, grapheme_stripos('DÉJÀ', 'à'));
- $this->assertSame(false, grapheme_strrpos('한국어', ''));
-diff --git a/tests/Patchwork/Tests/Utf8/HhvmTest.php b/tests/Utf8/HhvmTest.php
-index 8a77da0..4eb6866 100644
---- a/tests/Patchwork/Tests/Utf8/HhvmTest.php
-+++ b/tests/Patchwork/Tests/Utf8/HhvmTest.php
-@@ -12,7 +12,8 @@ public function test1()
- public function test2()
- {
- // Negative offset are not allowed but native PHP silently casts them to zero
-- $this->assertSame(0, grapheme_strpos('abc', 'a', -1));
-+ // Starting with 5.5.35, 5.6.21, 7.0.6, PHP refuse them
-+ $this->assertSame(0, grapheme_strpos('abc', 'a', 0));
- }
-
- public function test3()
diff --git a/php-patchwork-utf8.spec b/php-patchwork-utf8.spec
index 7296444..e66896f 100644
--- a/php-patchwork-utf8.spec
+++ b/php-patchwork-utf8.spec
@@ -12,8 +12,8 @@
%global github_owner tchwork
%global github_name utf8
-%global github_version 1.2.6
-%global github_commit f986d18f4e37ab70b792e977c7d85970cf84f164
+%global github_version 1.3.1
+%global github_commit 30ec6451aec7d2536f0af8fe535f70c764f2c47a
%global composer_vendor patchwork
%global composer_project utf8
@@ -44,11 +44,6 @@ URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
-# fix for php 5.5.35/5.6.21/7.0.6
-# https://github.com/tchwork/utf8/pull/59
-# NOTE: Upstream patch modified for version 1.2
-Patch0: %{name}-pr59-modified-for-1-2.patch
-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Relative paths
@@ -62,12 +57,12 @@ BuildRequires: php-iconv
BuildRequires: php-intl
BuildRequires: php-mbstring
BuildRequires: php-pcre
-## phpcompatinfo (computed from version 1.2.6)
-BuildRequires: php-reflection
+## phpcompatinfo (computed from version 1.3.1)
BuildRequires: php-date
BuildRequires: php-exif
BuildRequires: php-filter
BuildRequires: php-json
+BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-xml
## Autoloader
@@ -81,7 +76,7 @@ Requires: php-pcre
Requires: php-iconv
Requires: php-intl
Requires: php-mbstring
-# phpcompatinfo (computed from version 1.2.6)
+# phpcompatinfo (computed from version 1.3.1)
#Requires: php-exif
Requires: php-filter
Requires: php-json
@@ -100,16 +95,12 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
%prep
%setup -qn %{github_name}-%{github_commit}
-: fix for php 5.5.35/5.6.21/7.0.6
-%patch0 -p 1
-
: Create autoloader
cat <<'AUTOLOAD' | tee src/Patchwork/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
- *
- * Created by %{name}-%{version}-%{release}
+ * (created by %{name}-%{version}-%{release}).
*
* @return \Symfony\Component\ClassLoader\ClassLoader
*/
@@ -164,11 +155,24 @@ ln -s \
%check
%if %{with_tests}
-%{_bindir}/phpunit --verbose --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php
-
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php || ret=1
+ run=1
+fi
if which php70; then
- php70 %{_bindir}/phpunit --verbose --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php
+ php70 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php || ret=1
+ run=1
+fi
+if which php71; then
+ php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php || : ignore
+ run=1
fi
+if [ $run -eq 0 ]; then
+%{_bindir}/phpunit --verbose --bootstrap %{buildroot}%{phpdir}/Patchwork/autoload.php
+fi
+exit $ret
%else
: Tests skipped
%endif
@@ -191,6 +195,9 @@ rm -rf %{buildroot}
%changelog
+* Sat Jul 23 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.1-1
+- Updated to 1.3.1 (RHBZ #1332183)
+
* Tue May 03 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.2.6-1
- Updated to 1.2.6
- Added patch "fix for php 5.5.35/5.6.21/7.0.6"