1{ lib, callPackage, fetchFromGitHub, php, unzip, _7zz, xz, git, curl, cacert, makeBinaryWrapper }:
2
3php.buildComposerProject (finalAttrs: {
4 # Hash used by ../../../build-support/php/pkgs/composer-phar.nix to
5 # use together with the version from this package to keep the
6 # bootstrap phar file up-to-date together with the end user composer
7 # package.
8 passthru.pharHash = "sha256-mhjho6rby5TBuv1sSpj/kx9LQ6RW70hXUTBGbhnwXdY=";
9
10 composer = callPackage ../../../build-support/php/pkgs/composer-phar.nix {
11 inherit (finalAttrs) version;
12 inherit (finalAttrs.passthru) pharHash;
13 };
14
15 pname = "composer";
16 version = "2.6.5";
17
18 src = fetchFromGitHub {
19 owner = "composer";
20 repo = "composer";
21 rev = finalAttrs.version;
22 hash = "sha256-CKP7CYOuMKpuWdVveET2iLJPKJyCnv5YVjx4DE68UoE=";
23 };
24
25 nativeBuildInputs = [ makeBinaryWrapper ];
26
27 postInstall = ''
28 wrapProgram $out/bin/composer \
29 --prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]}
30 '';
31
32 vendorHash = "sha256-SG5RsKaP7zqJY2vjvULuNdf7w6tAGh7/dlxx2Pkfj2A=";
33
34 meta = {
35 changelog = "https://github.com/composer/composer/releases/tag/${finalAttrs.version}";
36 description = "Dependency Manager for PHP";
37 homepage = "https://getcomposer.org/";
38 license = lib.licenses.mit;
39 maintainers = lib.teams.php.members;
40 };
41})