From 103b4e3e08d29dcc0a247418b6bf645019322824 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 2 Nov 2017 16:01:04 +0100 Subject: add upstream patch for PHP 7.1 and 7.2 --- .gitignore | 8 ++++++ 4ed264051ed407d59c2fde4128be176e96e8f22a.patch | 25 ++++++++++++++++++ 5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch | 28 +++++++++++++++++++++ php-EasyRdf.spec | 35 +++++++++----------------- 4 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 .gitignore create mode 100644 4ed264051ed407d59c2fde4128be176e96e8f22a.patch create mode 100644 5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/4ed264051ed407d59c2fde4128be176e96e8f22a.patch b/4ed264051ed407d59c2fde4128be176e96e8f22a.patch new file mode 100644 index 0000000..0b6b057 --- /dev/null +++ b/4ed264051ed407d59c2fde4128be176e96e8f22a.patch @@ -0,0 +1,25 @@ +Adapted for 0.9.0 from + + +From 4ed264051ed407d59c2fde4128be176e96e8f22a Mon Sep 17 00:00:00 2001 +From: Alex Pott +Date: Sun, 29 Oct 2017 12:54:24 +0000 +Subject: [PATCH] Fix PHP 7.1 bug + +--- + lib/Serialiser/GraphViz.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Serialiser/GraphViz.php b/lib/Serialiser/GraphViz.php +index db2ae15d..7c1d8a6b 100644 +--- a/lib/EasyRdf/Serialiser/GraphViz.php ++++ b/lib/EasyRdf/Serialiser/GraphViz.php +@@ -220,7 +220,7 @@ protected function escape($input) + */ + protected function escapeAttributes($array) + { +- $items = ''; ++ $items = array(); + foreach ($array as $k => $v) { + $items[] = $this->escape($k).'='.$this->escape($v); + } diff --git a/5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch b/5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch new file mode 100644 index 0000000..7c5e58c --- /dev/null +++ b/5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch @@ -0,0 +1,28 @@ +Adapted for 0.9.0 from + + +From 5eb5154fec8b3d3df666628ba2f3636c0fa385c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thiemo=20M=C3=A4ttig?= +Date: Fri, 19 Dec 2014 12:45:34 +0100 +Subject: [PATCH] Fix potential bugs and incomplete docs + +--- + lib/Isomorphic.php | 2 +- + lib/Parser/RdfPhp.php | 2 +- + lib/Serialiser/Turtle.php | 2 +- + lib/Sparql/Client.php | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/Isomorphic.php b/lib/Isomorphic.php +index ed3c5a30..ca3c59dd 100644 +--- a/lib/EasyRdf/Isomorphic.php ++++ b/lib/EasyRdf/Isomorphic.php +@@ -96,7 +96,7 @@ public static function bijectionBetween($graphA, $graphB) + if ($groundedStatementsMatch === false) { + // The grounded statements do not match + return null; +- } elseif (count($bnodesA) > 0 or count($bnodesB > 0)) { ++ } elseif (count($bnodesA) > 0 or count($bnodesB) > 0) { + // There are blank nodes - build a bi-jection + return self::buildBijectionTo($statementsA, $bnodesA, $statementsB, $bnodesB); + } else { diff --git a/php-EasyRdf.spec b/php-EasyRdf.spec index 1d67799..617fa4a 100644 --- a/php-EasyRdf.spec +++ b/php-EasyRdf.spec @@ -36,7 +36,7 @@ Name: php-EasyRdf Version: 0.9.0 -Release: 6%{?dist} +Release: 8%{?dist} Summary: A PHP library designed to make it easy to consume and produce RDF Group: Development/Libraries @@ -44,7 +44,10 @@ License: BSD URL: http://www.easyrdf.org Source0: %{url}/downloads/easyrdf-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Upstream patches +Patch0: 4ed264051ed407d59c2fde4128be176e96e8f22a.patch +Patch1: 5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch + BuildArch: noarch # Tests %if %{with_tests} @@ -136,6 +139,8 @@ Group: Documentation %prep %setup -qn easyrdf-%{version} +%patch0 -p1 +%patch1 -p1 %build @@ -153,7 +158,6 @@ AUTOLOAD %install -rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir} cp -rp lib/* %{buildroot}%{phpdir}/ @@ -185,27 +189,13 @@ PHPUNIT rm -f test/EasyRdf/Parser/RedlandTest.php %endif -: Skip tests known to fail since PHP 7.1 -: See https://github.com/njh/easyrdf/issues/276 -%if 0%{?fedora} > 25 -sed \ - -e 's/function testSerialiseDot/function SKIP_testSerialiseDot/' \ - -e 's/function testSerialiseDotUseLabels/function SKIP_testSerialiseDotUseLabels/' \ - -e 's/function testSerialiseDotOnlyLabelled/function SKIP_testSerialiseDotOnlyLabelled/' \ - -e 's/function testSerialisePng/function SKIP_testSerialisePng/' \ - -e 's/function testSerialiseGif/function SKIP_testSerialiseGif/' \ - -e 's/function testSerialiseSvg/function SKIP_testSerialiseSvg/' \ - -e 's/function testDotNotFound/function SKIP_testDotNotFound/' \ - -i test/EasyRdf/Serialiser/GraphVizTest.php -%endif - : Upstream tests %{_bindir}/phpunit --verbose : Upstream tests with SCLs if available SCL_RETURN_CODE=0 # Note: No php71 because of skipped tests above -for SCL in %{?rhel:php54 php55} php56 php70; do +for SCL in %{?rhel:php54 php55} php56 php70 php71 php72; do if which $SCL; then $SCL %{_bindir}/phpunit || SCL_RETURN_CODE=1 fi @@ -216,12 +206,7 @@ exit $SCL_RETURN_CODE %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE.md %doc CHANGELOG.md @@ -238,6 +223,10 @@ rm -rf %{buildroot} %changelog +* Thu Nov 2 2017 Remi Collet - 0.9.0-8 +- add upstream patch for PHP 7.1 +- add upstream patch for PHP 7.2 + * Wed Feb 22 2017 Shawn Iwinski - 0.9.0-6 - Fix FTBS in rawhide (RHBZ #1424061) - Skip tests known to fail since PHP 7.1 (see https://github.com/njh/easyrdf/issues/276) -- cgit