dev-php/composer: Add 1.2.2 version
authorGuillaume Seren <guillaumeseren@gmail.com>
Thu, 24 Nov 2016 08:09:45 +0000 (09:09 +0100)
committerMichael Orlitzky <mjo@gentoo.org>
Sun, 18 Dec 2016 23:17:06 +0000 (18:17 -0500)
This package is a source alternative to the phar one.
It use dev-php/fedora-autoloader to provide a PSR4 loader,
for itself (composer) and all the dependencies, bug 439206.

Suggested-by: Michael Orlitzky <mjo@gentoo.org>
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
dev-php/composer/Manifest [new file with mode: 0644]
dev-php/composer/composer-1.2.2.ebuild [new file with mode: 0644]
dev-php/composer/files/autoload.php [new file with mode: 0644]
dev-php/composer/files/composer-update-paths.patch [new file with mode: 0644]
dev-php/composer/metadata.xml [new file with mode: 0644]

diff --git a/dev-php/composer/Manifest b/dev-php/composer/Manifest
new file mode 100644 (file)
index 0000000..0181326
--- /dev/null
@@ -0,0 +1 @@
+DIST composer-1.2.2.tar.gz 1070446 SHA256 c51b4fb71a0d23e26c5be048743459eefca7c9da22a47f757a433cbb33553bb4 SHA512 43c28194f72e13e708af91b9714d028ebf67ce02d830bec0556e434e8296eae0e406e7f8ab3e836b34c3950fceb11cf255c6004e5a56bdd08c3ca0078778d70e WHIRLPOOL 5bf1ae7b2f4ffe3fc9422dd3181f7561fbaf6399cbab6fef1692283e16e9ebd388f61228777475d50bdbaf7911f782568b2a60e1ce53b7cdb6a025f4a89f41af
diff --git a/dev-php/composer/composer-1.2.2.ebuild b/dev-php/composer/composer-1.2.2.ebuild
new file mode 100644 (file)
index 0000000..8e3fdcf
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+DESCRIPTION="Dependency Manager for PHP"
+HOMEPAGE="https://github.com/composer/composer"
+SRC_URI="https://github.com/composer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       dev-lang/php:*[curl]
+       ~dev-php/ca-bundle-1.0.0
+       ~dev-php/cli-prompt-1.0.0
+       ~dev-php/psr-log-1.0.2
+       dev-php/fedora-autoloader
+       ~dev-php/json-schema-2.0.0
+       ~dev-php/jsonlint-1.4.0
+       ~dev-php/phar-utils-1.0.0
+       ~dev-php/semver-1.0.0
+       ~dev-php/spdx-licenses-1.0.0
+       ~dev-php/symfony-console-2.7.9
+       ~dev-php/symfony-filesystem-2.7.20
+       ~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"
+       doins -r src/Composer/. res LICENSE "${FILESDIR}"/autoload.php
+       dobin bin/composer
+       dodoc README.md
+}
diff --git a/dev-php/composer/files/autoload.php b/dev-php/composer/files/autoload.php
new file mode 100644 (file)
index 0000000..5be766d
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/* Autoloader for composer and its dependencies */
+
+$vendorDir = '/usr/share/php';
+if (!class_exists('Fedora\\Autoloader\\Autoload', false)) {
+    require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
+}
+
+\Fedora\Autoloader\Autoload::addPsr4('Composer\\', __DIR__);
+
+// Dependencies
+\Fedora\Autoloader\Dependencies::required(array(
+       $vendorDir . '/JsonSchema/autoload.php',
+       $vendorDir . '/Composer/CaBundle/autoload.php',
+       $vendorDir . '/Composer/Semver/autoload.php',
+       $vendorDir . '/Composer/Spdx/autoload.php',
+       $vendorDir . '/Seld/JsonLint/autoload.php',
+       $vendorDir . '/Symfony/Component/Console/autoload.php',
+       $vendorDir . '/Symfony/Component/Finder/autoload.php',
+       $vendorDir . '/Symfony/Component/Process/autoload.php',
+       $vendorDir . '/Symfony/Component/Filesystem/autoload.php',
+       $vendorDir . '/Seld/PharUtils/autoload.php',
+       $vendorDir . '/Seld/CliPrompt/autoload.php',
+       $vendorDir . '/Psr/Log/autoload.php',
+));
diff --git a/dev-php/composer/files/composer-update-paths.patch b/dev-php/composer/files/composer-update-paths.patch
new file mode 100644 (file)
index 0000000..754cbab
--- /dev/null
@@ -0,0 +1,46 @@
+--- ./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;
+
diff --git a/dev-php/composer/metadata.xml b/dev-php/composer/metadata.xml
new file mode 100644 (file)
index 0000000..d7528ad
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>guillaumeseren@gmail.com</email>
+    <name>Guillaume Seren</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+  <longdescription>
+    Composer is a tool for dependency management in PHP.
+    It allows you to declare the libraries your project depends on
+    and it will manage (install/update) them for you.
+  </longdescription>
+</pkgmetadata>