commit:     f8beab2f41f763b95f33ad2f8478c2291cbc00f8
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 27 01:23:37 2017 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu Apr 27 12:16:31 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8beab2f

dev-php/composer: version bump 1.3.1 -> 1.4.1.

This commit adds composer-1.4.1 and removes the old composer-1.3.1 at
the same time, allowing me to mess with the autoload.php in-flight. We
had one patch that was giving us trouble with v1.4.1, and this new
ebuild is an experiment to see if we can do away with it. Instead of
installing to /usr/share/php/Composer, the new v1.4.1 will install to
/usr/share/composer, and only create a symlink from /usr/bin/composer
to the "real" executable under /usr/share.

Since the executable loads everything via relative paths, having the
"real" executable under /usr/share (with the rest of its stuff) allows
composer to find what it's looking for out-of-the box, without us
having to point it towards our particular install location. As a
result, I've removed the one patch that did so, and I've updated
autoload.php with the new path.

Thanks are due to Guillaume Seren who did most of the prerequisite
work and stayed on top of the pull request and bug.

Gentoo-Bug: 613898
Closes: https://github.com/gentoo/gentoo/pull/4364

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 dev-php/composer/Manifest                          |  2 +-
 ...composer-1.3.1.ebuild => composer-1.4.1.ebuild} | 22 ++++++-----
 dev-php/composer/files/autoload.php                |  5 ++-
 dev-php/composer/files/composer-update-paths.patch | 46 ----------------------
 4 files changed, 18 insertions(+), 57 deletions(-)

diff --git a/dev-php/composer/Manifest b/dev-php/composer/Manifest
index 623786d0634..aaf64094054 100644
--- a/dev-php/composer/Manifest
+++ b/dev-php/composer/Manifest
@@ -1 +1 @@
-DIST composer-1.3.1.tar.gz 1081862 SHA256 
af40d800c8120c802f80c28cbd80824212111e62e3ef8b96a73ae639cff8f620 SHA512 
3b8c4c708cd3b88b49574c691605ef42c2c083b300f910be3b897350c9c35d9f923f47cbcfa64e19d89c28079f0631350f30db747d89808183d20cb779895afb
 WHIRLPOOL 
6545c1f38e11e4233c4ee6f257a8e0c090c2de2981ea9e00a7de54fe3d4337aaa16e1e873da7db2009ad355e3c6da4d7eb12eec81992233840b26bc2b1a0f373
+DIST composer-1.4.1.tar.gz 1090505 SHA256 
27c0c134d6a151de8e552f4da98a2100973a64a33c462b14bd5cb463cee254dc SHA512 
8fc1e53666151c2b029544216dfc842379763bd3e5085c15c118dfa8ca0da8559a48909cb5ee29f37f6ed07b7572375354a09bd160b9c0828fe40e809defd8a9
 WHIRLPOOL 
3104bbffc6e5241d052454169e88a0a167acf0229f1ed2fbf184eef9ccb5cd4ab00021be431b84389b40fe895fb1e560e8ecc2f7dd99f457c7190877a0fe107e

diff --git a/dev-php/composer/composer-1.3.1.ebuild 
b/dev-php/composer/composer-1.4.1.ebuild
similarity index 69%
rename from dev-php/composer/composer-1.3.1.ebuild
rename to dev-php/composer/composer-1.4.1.ebuild
index 366cc6ed80a..90d53510da0 100644
--- a/dev-php/composer/composer-1.3.1.ebuild
+++ b/dev-php/composer/composer-1.4.1.ebuild
@@ -5,7 +5,7 @@ EAPI=6
 
 DESCRIPTION="Dependency Manager for PHP"
 HOMEPAGE="https://github.com/composer/composer";
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI="${HOMEPAGE}/archive/${PV}.tar.gz -> ${P}.tar.gz"
 
 LICENSE="MIT"
 SLOT="0"
@@ -27,16 +27,20 @@ RDEPEND="
        >=dev-php/symfony-finder-2.7.20
        >=dev-php/symfony-process-2.8.12"
 
-PATCHES=(
-       "${FILESDIR}/${PN}-update-paths.patch"
-)
-
 src_install() {
-       insinto "/usr/share/php/Composer/Composer"
+       insinto "/usr/share/${PN}"
 
        # Composer expects the LICENSE file to be there, and the
        # easiest thing to do is to give it what it wants.
-       doins -r src/Composer/. res LICENSE "${FILESDIR}"/autoload.php
-       dobin bin/composer
-       dodoc README.md
+       doins -r src res LICENSE
+
+       insinto "/usr/share/${PN}/vendor"
+       doins "${FILESDIR}"/autoload.php
+
+       exeinto "/usr/share/${PN}/bin"
+       doexe "bin/${PN}"
+       dosym "/usr/share/${PN}/bin/${PN}" "/usr/bin/${PN}"
+
+       dodoc CHANGELOG.md README.md doc/*.md
+       dodoc -r doc/articles doc/faqs
 }

diff --git a/dev-php/composer/files/autoload.php 
b/dev-php/composer/files/autoload.php
index 5be766d60f4..30d8495a454 100644
--- a/dev-php/composer/files/autoload.php
+++ b/dev-php/composer/files/autoload.php
@@ -6,7 +6,10 @@ if (!class_exists('Fedora\\Autoloader\\Autoload', false)) {
     require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
 }
 
-\Fedora\Autoloader\Autoload::addPsr4('Composer\\', __DIR__);
+\Fedora\Autoloader\Autoload::addPsr4(
+  'Composer\\',
+  __DIR__ . '/../src/Composer'
+);
 
 // Dependencies
 \Fedora\Autoloader\Dependencies::required(array(

diff --git a/dev-php/composer/files/composer-update-paths.patch 
b/dev-php/composer/files/composer-update-paths.patch
deleted file mode 100644
index 754cbabcbcf..00000000000
--- a/dev-php/composer/files/composer-update-paths.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- ./src/Composer/Autoload/AutoloadGenerator.php       2016-11-03 
17:43:15.000000000 +0100
-+++ ./src/Composer/Autoload/AutoloadGenerator.php       2016-11-18 
16:54:55.664985847 +0100
-@@ -291,7 +291,7 @@
-         file_put_contents($targetDir.'/autoload_real.php', 
$this->getAutoloadRealFile(true, (bool) $includePathFileContents, 
$targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, 
$appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, 
$staticPhpVersion));
-
-         $this->safeCopy(__DIR__.'/ClassLoader.php', 
$targetDir.'/ClassLoader.php');
--        $this->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
-+        $this->safeCopy('/usr/share/php/Composer/Composer/LICENSE', 
$targetDir.'/LICENSE');
-
-         if ($this->runScripts) {
-             
$this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, 
$this->devMode, array(), array(
-
---- ./tests/Composer/Test/Json/ComposerSchemaTest.php   2016-11-03 
17:43:15.000000000 +0100
-+++ ./tests/Composer/Test/Json/ComposerSchemaTest.php   2016-11-20 
18:27:43.169665101 +0100
-@@ -87,7 +87,7 @@
-
-     private function check($json)
-     {
--        $schema = json_decode(file_get_contents(__DIR__ . 
'/../../../../res/composer-schema.json'));
-+        $schema = 
json_decode(file_get_contents('/usr/share/php/Composer/Composer/res/composer-schema.json'));
-         $validator = new Validator();
-         $validator->check(json_decode($json), $schema);
-
---- ./src/Composer/Json/JsonFile.php    2016-11-04 02:51:03.844719014 +0100
-+++ ./src/Composer/Json/JsonFile.php    2016-11-18 16:44:06.065969630 +0100
-@@ -156,7 +156,7 @@
-             self::validateSyntax($content, $this->path);
-         }
- 
--        $schemaFile = __DIR__ . '/../../../res/composer-schema.json';
-+        $schemaFile = 
'/usr/share/php/Composer/Composer/res/composer-schema.json';
-         $schemaData = json_decode(file_get_contents($schemaFile));
- 
-         if ($schema === self::LAX_SCHEMA) {
-
---- ./bin/composer      2016-11-18 15:56:40.615898592 +0100
-+++ ./bin/composer      2016-11-18 16:06:05.348912690 +0100
-@@ -5,7 +5,7 @@
-     echo 'Warning: Composer should be invoked via the CLI version of PHP, not 
the '.PHP_SAPI.' SAPI'.PHP_EOL;
- }
-
--require __DIR__.'/../src/bootstrap.php';
-+require '/usr/share/php/Composer/Composer/autoload.php';
- 
- use Composer\Console\Application;
-

Reply via email to