[packages/composer] Up to 2.9.5

arekm arekm at pld-linux.org
Sat Apr 4 00:21:45 CEST 2026


commit 872567b6273d97d4dd271925697f27e191584a7f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Apr 4 00:21:36 2026 +0200

    Up to 2.9.5

 autoload.patch             | 47 ++++++++++++++++++++++------------------
 autoload.php               | 53 ++++++++++++++++++++++++----------------------
 composer.spec              | 47 +++++++++++++++++++---------------------
 svn-ignore-externals.patch | 20 -----------------
 update-memory-limit.patch  | 17 ---------------
 5 files changed, 76 insertions(+), 108 deletions(-)
---
diff --git a/composer.spec b/composer.spec
index cec9fc3..e248b7a 100644
--- a/composer.spec
+++ b/composer.spec
@@ -1,36 +1,32 @@
 #
 # Conditional build:
 %bcond_with	tests		# build with tests
-%bcond_without	online		# online self-test
+%bcond_with	online		# online self-test
 
 %if 0%{?_pld_builder:1}
 %undefine	with_online
 %endif
 
-%define		php_min_version 5.3.4
+%define		php_min_version 7.2.5
 Summary:	Dependency Manager for PHP
 Name:		composer
-Version:	1.10.26
+Version:	2.9.5
 Release:	1
 License:	MIT
 Group:		Development/Languages/PHP
 Source0:	https://github.com/composer/composer/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	170c36246e52522e17540a6aaee57d8c
+# Source0-md5:	db62f452564f8042d8206919f9edaf2b
 Source2:	https://raw.githubusercontent.com/iArren/%{name}-bash-completion/86a8129/composer
 # Source2-md5:	cdeebf0a0da1fd07d0fd886d0461642e
 Source3:	autoload.php
 Patch0:		autoload.patch
-Patch1:		update-memory-limit.patch
-Patch2:		svn-ignore-externals.patch
 URL:		https://getcomposer.org/
 BuildRequires:	php-devel
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.673
-# instead of filling duplicate deps for running tests,
-# update composer version that have neccessary runtime dependencies
-BuildRequires:	composer >= 1.7.0
 %{?with_online:BuildRequires:	%{php_name}-cli}
 %if %{with tests}
+BuildRequires:	composer >= 2.0.0
 BuildRequires:	git-core
 BuildRequires:	phpab
 BuildRequires:	phpunit >= 4.8
@@ -41,6 +37,7 @@ Requires:	php(date)
 Requires:	php(filter)
 Requires:	php(hash)
 Requires:	php(json)
+Requires:	php(mbstring)
 Requires:	php(openssl)
 Requires:	php(pcntl)
 Requires:	php(pcre)
@@ -50,25 +47,29 @@ Requires:	php(simplexml)
 Requires:	php(spl)
 Requires:	php(zip)
 Requires:	php(zlib)
-Requires:	php-composer-ca-bundle >= 1.0.2
-Requires:	php-composer-semver >= 1.0.0
-Requires:	php-composer-spdx-licenses >= 1.2
-Requires:	php-composer-xdebug-handler >= 1.1
-Requires:	php-justinrainbow-json-schema >= 3.0
+Requires:	php-composer-ca-bundle >= 1.5
+Requires:	php-composer-class-map-generator >= 1.4.0
+Requires:	php-composer-metadata-minifier >= 1.0
+Requires:	php-composer-pcre >= 2.3
+Requires:	php-composer-semver >= 3.3
+Requires:	php-composer-spdx-licenses >= 1.5.7
+Requires:	php-composer-xdebug-handler >= 2.0.2
+Requires:	php-justinrainbow-json-schema >= 6.5.1
 Requires:	php-psr-log >= 1.0
+Requires:	php-react-promise >= 3.3
 Requires:	php-seld-jsonlint >= 1.4
-Requires:	php-seld-phar-utils >= 1.0.0
-Requires:	php-symfony2-ClassLoader >= 2.7.7
-Requires:	php-symfony2-Console >= 2.7.7
-Requires:	php-symfony2-Filesystem >= 2.7.7
-Requires:	php-symfony2-Finder >= 2.7.7
-Requires:	php-symfony2-Process >= 2.7.7
+Requires:	php-seld-phar-utils >= 1.2
+Requires:	php-seld-signal-handler >= 2.0
+Requires:	php-symfony-Console >= 5.4.47
+Requires:	php-symfony-Filesystem >= 5.4.45
+Requires:	php-symfony-Finder >= 5.4.45
+Requires:	php-symfony-Process >= 5.4.47
 Requires:	unzip
 Suggests:	bash-completion-%{name}
 Suggests:	git-core
 Suggests:	mercurial
 Suggests:	subversion
-Conflicts:	satis < 1.0.0-1.alpha1.193
+Conflicts:	composer1
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -94,8 +95,6 @@ Pakiet ten dostarcza bashowe uzupełnianie nazw dla Composera.
 %prep
 %setup -q
 %patch -P0 -p1
-%patch -P1 -p1
-%patch -P2 -p1
 
 mv composer.lock{,.disabled}
 # NOTE: do not use %{__php} macro here, need unversioned php binary
@@ -105,7 +104,6 @@ cp -p %{SOURCE3} src/Composer/autoload.php
 
 # AutoloadGenerator needs this runtime
 mv LICENSE res
-
 # move to Composer dir, this will simplify testing
 mv res src/Composer
 ln -s src/Composer/res
@@ -139,7 +137,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.md CHANGELOG.md PORTING_INFO
 %doc src/Composer/res/LICENSE
 %attr(755,root,root) %{_bindir}/composer
 %{php_data_dir}/Composer
diff --git a/autoload.patch b/autoload.patch
index 493e0ea..f5fd5ff 100644
--- a/autoload.patch
+++ b/autoload.patch
@@ -1,6 +1,7 @@
---- composer-1.10.22/bin/composer~	2021-04-27 14:10:45.000000000 +0300
-+++ composer-1.10.22/bin/composer	2021-05-10 18:32:01.839944783 +0300
-@@ -6,7 +6,11 @@
+diff -urNp composer-2.9.5.orig/bin/composer composer-2.9.5/bin/composer
+--- composer-2.9.5.orig/bin/composer	2026-01-29 11:40:53.000000000 +0100
++++ composer-2.9.5/bin/composer	2026-04-03 14:04:15.341204429 +0200
+@@ -30,7 +30,11 @@ if (ini_get('opcache.enable_cli') && ini
  }
  
  setlocale(LC_ALL, 'C');
@@ -13,25 +14,29 @@
  
  use Composer\Console\Application;
  use Composer\XdebugHandler\XdebugHandler;
---- composer-1.9.0/src/Composer/Json/JsonFile.php~	2019-08-02 21:55:33.000000000 +0300
-+++ composer-1.9.0/src/Composer/Json/JsonFile.php	2019-08-11 19:59:58.343540127 +0300
-@@ -34,7 +34,7 @@
-     const JSON_PRETTY_PRINT = 128;
-     const JSON_UNESCAPED_UNICODE = 256;
+diff -urNp composer-2.9.5.orig/src/Composer/Autoload/AutoloadGenerator.php composer-2.9.5/src/Composer/Autoload/AutoloadGenerator.php
+--- composer-2.9.5.orig/src/Composer/Autoload/AutoloadGenerator.php	2026-01-29 11:40:53.000000000 +0100
++++ composer-2.9.5/src/Composer/Autoload/AutoloadGenerator.php	2026-04-03 14:04:15.347015893 +0200
+@@ -467,7 +467,7 @@ EOF;
+         $filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $checkPlatform));
  
--    const COMPOSER_SCHEMA_PATH = '/../../../res/composer-schema.json';
-+    const COMPOSER_SCHEMA_PATH = '/../res/composer-schema.json';
+         $filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
+-        $filesystem->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
++        $filesystem->safeCopy(__DIR__.'/../res/LICENSE', $targetDir.'/LICENSE');
  
-     private $path;
-     private $rfs;
---- composer-1.10.22/src/Composer/Autoload/AutoloadGenerator.php~	2021-04-27 14:10:45.000000000 +0300
-+++ composer-1.10.22/src/Composer/Autoload/AutoloadGenerator.php	2021-05-10 18:34:23.023946419 +0300
-@@ -315,7 +315,7 @@
-         $this->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion));
+         if ($this->runScripts) {
+             $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, [], [
+diff -urNp composer-2.9.5.orig/src/Composer/Json/JsonFile.php composer-2.9.5/src/Composer/Json/JsonFile.php
+--- composer-2.9.5.orig/src/Composer/Json/JsonFile.php	2026-01-29 11:40:53.000000000 +0100
++++ composer-2.9.5/src/Composer/Json/JsonFile.php	2026-04-03 14:04:15.345306428 +0200
+@@ -41,8 +41,8 @@ class JsonFile
+     /** @deprecated Use \JSON_UNESCAPED_UNICODE */
+     public const JSON_UNESCAPED_UNICODE = 256;
  
-         $this->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
--        $this->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
-+        $this->safeCopy(__DIR__.'/../res/LICENSE', $targetDir.'/LICENSE');
+-    public const COMPOSER_SCHEMA_PATH = __DIR__ . '/../../../res/composer-schema.json';
+-    public const LOCK_SCHEMA_PATH = __DIR__ . '/../../../res/composer-lock-schema.json';
++    public const COMPOSER_SCHEMA_PATH = __DIR__ . '/../res/composer-schema.json';
++    public const LOCK_SCHEMA_PATH = __DIR__ . '/../res/composer-lock-schema.json';
+ 
+     public const INDENT_DEFAULT = '    ';
  
-         if ($this->runScripts) {
-             $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array(
diff --git a/autoload.php b/autoload.php
index 5cca421..deb7547 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1,33 +1,36 @@
 <?php
 $phpDir = defined('PHP_DATADIR') && PHP_DATADIR ? PHP_DATADIR . '/php/' : '/usr/share/php/';
 
-// Use Symfony autoloader
-if (!isset($loader) || !($loader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
-    if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
-        require_once $phpDir . '/Symfony/Component/ClassLoader/ClassLoader.php';
-    }
+require_once __DIR__ . '/Autoload/ClassLoader.php';
 
-    $loader = new \Symfony\Component\ClassLoader\ClassLoader();
-    $loader->register();
-}
+$loader = new \Composer\Autoload\ClassLoader();
 
-$baseDir = dirname(__DIR__);
+// Composer itself (PSR-4)
+$loader->setPsr4('Composer\\', array(__DIR__));
 
-$loader->addPrefixes(array(
-    'Composer\\'  => $baseDir,
-    // Dependencies
-    'Composer\\CaBundle\\' => array($phpDir),
-    'Composer\\Semver\\' => array($phpDir),
-    'Composer\\Spdx\\' => array($phpDir),
-    'Composer\\XdebugHandler\\' => array($phpDir),
-    'JsonSchema' => array($phpDir),
-    'Psr\\Log\\' => array($phpDir),
-    'Seld\\JsonLint' => array($phpDir),
-    'Seld\\PharUtils\\' => array($phpDir),
-    'Symfony\\Component\\Console\\' => array($phpDir),
-    'Symfony\\Component\\Filesystem\\' => array($phpDir),
-    'Symfony\\Component\\Finder' => array($phpDir),
-    'Symfony\\Component\\Process\\' => array($phpDir),
-));
+// Dependencies (PSR-4)
+$loader->setPsr4('Composer\\CaBundle\\', array($phpDir . 'Composer/CaBundle'));
+$loader->setPsr4('Composer\\ClassMapGenerator\\', array($phpDir . 'Composer/ClassMapGenerator'));
+$loader->setPsr4('Composer\\MetadataMinifier\\', array($phpDir . 'Composer/MetadataMinifier'));
+$loader->setPsr4('Composer\\Pcre\\', array($phpDir . 'Composer/Pcre'));
+$loader->setPsr4('Composer\\Semver\\', array($phpDir . 'Composer/Semver'));
+$loader->setPsr4('Composer\\Spdx\\', array($phpDir . 'Composer/Spdx'));
+$loader->setPsr4('Composer\\XdebugHandler\\', array($phpDir . 'Composer/XdebugHandler'));
+$loader->setPsr4('JsonSchema\\', array($phpDir . 'JsonSchema'));
+$loader->setPsr4('Psr\\Log\\', array($phpDir . 'Psr/Log'));
+$loader->setPsr4('React\\Promise\\', array($phpDir . 'React/Promise'));
+$loader->setPsr4('Seld\\JsonLint\\', array($phpDir . 'Seld/JsonLint'));
+$loader->setPsr4('Seld\\PharUtils\\', array($phpDir . 'Seld/PharUtils'));
+$loader->setPsr4('Seld\\Signal\\', array($phpDir . 'Seld/Signal'));
+$loader->setPsr4('Symfony\\Component\\Console\\', array($phpDir . 'Symfony/Component/Console'));
+$loader->setPsr4('Symfony\\Component\\Filesystem\\', array($phpDir . 'Symfony/Component/Filesystem'));
+$loader->setPsr4('Symfony\\Component\\Finder\\', array($phpDir . 'Symfony/Component/Finder'));
+$loader->setPsr4('Symfony\\Component\\Process\\', array($phpDir . 'Symfony/Component/Process'));
+$loader->setPsr4('Symfony\\Polyfill\\Php73\\', array($phpDir . 'Symfony/Polyfill/Php73'));
+$loader->setPsr4('Symfony\\Polyfill\\Php80\\', array($phpDir . 'Symfony/Polyfill/Php80'));
+$loader->setPsr4('Symfony\\Polyfill\\Php81\\', array($phpDir . 'Symfony/Polyfill/Php81'));
+$loader->setPsr4('Symfony\\Polyfill\\Php84\\', array($phpDir . 'Symfony/Polyfill/Php84'));
+
+$loader->register();
 
 return $loader;
diff --git a/svn-ignore-externals.patch b/svn-ignore-externals.patch
deleted file mode 100644
index e779645..0000000
--- a/svn-ignore-externals.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- composer-1.3.0/src/Composer/Downloader/SvnDownloader.php~	2016-12-24 01:47:04.000000000 +0200
-+++ composer-1.3.0/src/Composer/Downloader/SvnDownloader.php	2016-12-25 00:20:44.725141875 +0200
-@@ -41,7 +41,7 @@
-         }
- 
-         $this->io->writeError(" Checking out ".$package->getSourceReference());
--        $this->execute($url, "svn co", sprintf("%s/%s", $url, $ref), null, $path);
-+        $this->execute($url, "svn co --ignore-externals", sprintf("%s/%s", $url, $ref), null, $path);
-     }
- 
-     /**
-@@ -64,7 +64,7 @@
-         }
- 
-         $this->io->writeError(" Checking out " . $ref);
--        $this->execute($url, "svn switch" . $flags, sprintf("%s/%s", $url, $ref), $path);
-+        $this->execute($url, "svn switch --ignore-externals" . $flags, sprintf("%s/%s", $url, $ref), $path);
-     }
- 
-     /**
diff --git a/update-memory-limit.patch b/update-memory-limit.patch
deleted file mode 100644
index 5dbb293..0000000
--- a/update-memory-limit.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-update command is very memory hungry
-and there's no good solution for that
-as the memory usage is unexpected, just disable it
-
-https://github.com/composer/composer/issues/1898
-
---- composer-1.0.0-14.alpha11/src/Composer/Command/UpdateCommand.php~	2015-11-14 18:21:07.000000000 +0200
-+++ composer-1.0.0-14.alpha11/src/Composer/Command/UpdateCommand.php	2015-11-25 17:46:18.524578082 +0200
-@@ -75,6 +75,8 @@
- 
-     protected function execute(InputInterface $input, OutputInterface $output)
-     {
-+        ini_set('memory_limit', -1);
-+
-         $io = $this->getIO();
-         if ($input->getOption('no-custom-installers')) {
-             $io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/composer.git/commitdiff/872567b6273d97d4dd271925697f27e191584a7f



More information about the pld-cvs-commit mailing list