2021-02-27 11:29:20 +01:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, unzip, lib, php }:
|
2020-10-11 16:37:09 +02:00
|
|
|
let
|
|
|
|
pname = "composer";
|
2022-04-15 14:44:18 +02:00
|
|
|
version = "2.3.5";
|
2020-10-11 16:37:09 +02:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2022-04-15 14:44:18 +02:00
|
|
|
sha256 = "sha256-OztaiZwGpGrsKAcnvfUKrRQzT2vEBDbqdrB7ZQhw2PQ=";
|
2020-10-11 16:37:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 16:37:09 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-27 13:53:54 +02:00
|
|
|
runHook preInstall
|
2020-10-11 16:37:09 +02:00
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D $src $out/libexec/composer/composer.phar
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/composer \
|
|
|
|
--add-flags "$out/libexec/composer/composer.phar" \
|
2021-02-27 11:29:20 +01:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ unzip ]}
|
2021-04-27 13:53:54 +02:00
|
|
|
runHook postInstall
|
2020-10-11 16:37:09 +02:00
|
|
|
'';
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 16:37:09 +02:00
|
|
|
description = "Dependency Manager for PHP";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://getcomposer.org/";
|
2021-05-24 16:47:17 +02:00
|
|
|
changelog = "https://github.com/composer/composer/releases/tag/${version}";
|
2020-10-11 16:37:09 +02:00
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|