From a6662d8d2d7b499aa5c18fd725a189863b6d21fb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 23 Nov 2016 15:33:29 +0100 Subject: php-lessphp: add fix --- composer.json | 25 +++++++++++++++++++++++++ php-lessphp-pr626.patch | 23 +++++++++++++++++++++++ php-lessphp.spec | 27 +++++++++++++++++++++++++-- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 composer.json create mode 100644 php-lessphp-pr626.patch diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0f06ba0 --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "leafo/lessphp", + "type": "library", + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "autoload": { + "classmap": ["lessc.inc.php"] + }, + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + } +} diff --git a/php-lessphp-pr626.patch b/php-lessphp-pr626.patch new file mode 100644 index 0000000..47c1a7a --- /dev/null +++ b/php-lessphp-pr626.patch @@ -0,0 +1,23 @@ +From 6cabd199faf47a2f38b70e3c98f563817b43273a Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 23 Nov 2016 15:20:43 +0100 +Subject: [PATCH 1/2] fix lib_luma + +--- + lessc.inc.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lessc.inc.php b/lessc.inc.php +index 2292f21..b639c3e 100644 +--- a/lessc.inc.php ++++ b/lessc.inc.php +@@ -1273,7 +1273,7 @@ protected function lib_contrast($args) { + + protected function lib_luma($color) { + $color = $this->coerceColor($color); +- return (0.2126 * $color[0] / 255) + (0.7152 * $color[1] / 255) + (0.0722 * $color[2] / 255); ++ return (0.2126 * $color[1] / 255) + (0.7152 * $color[2] / 255) + (0.0722 * $color[3] / 255); + } + + + diff --git a/php-lessphp.spec b/php-lessphp.spec index 0a38a5d..31349d9 100644 --- a/php-lessphp.spec +++ b/php-lessphp.spec @@ -25,7 +25,7 @@ Name: php-%{composer_project} Version: %{github_version} -Release: 2%{?dist} +Release: 4%{?dist} Summary: A compiler for LESS written in PHP Group: Development/Libraries @@ -33,6 +33,9 @@ License: MIT or GPLv3 URL: http://leafo.net/lessphp Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# https://github.com/leafo/lessphp/pull/626 +Patch0: %{name}-pr626.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests @@ -69,6 +72,7 @@ suitable as a drop in replacement for PHP projects. %prep %setup -qn %{github_name}-%{github_commit} +%patch0 -p1 : Update bin requires and shebang sed 's#$path\s*=.*#$path = "%{phpdir}/%{composer_project}/";#' \ @@ -92,7 +96,22 @@ cp -p plessc %{buildroot}%{_bindir}/ %check %if %{with_tests} -%{_bindir}/phpunit -v tests +# remirepo:11 +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit tests || ret=1 + run=1 +fi +if which php71; then + php71 %{_bindir}/phpunit tests || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/phpunit --verbose tests +# remirepo:2 +fi +exit $ret %else : Tests skipped %endif @@ -114,6 +133,10 @@ rm -rf %{buildroot} %changelog +* Wed Nov 23 2016 Remi Collet - 0.5.0-4 +- add patch for lib_luma and fix FTBFS with PHP 7.1 + https://github.com/leafo/lessphp/pull/626 + * Sun Jun 28 2015 Shawn Iwinski - 0.5.0-2 - Added php-composer(leafo/lessphp) virtual provide -- cgit