2021-03-09 03:18:52 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, unzip, lib, php }:
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
pname = "composer";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "2.4.1";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-6oz2MI7Hb/lkXDgYhBp1iAlrncJ2c0X71L1JLdim3KY=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-03 20:48:10 +00:00
|
|
|
runHook preInstall
|
2020-10-16 20:44:37 +00: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-03-09 03:18:52 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ unzip ]}
|
2021-05-03 20:48:10 +00:00
|
|
|
runHook postInstall
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Dependency Manager for PHP";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://getcomposer.org/";
|
2021-05-28 09:39:13 +00:00
|
|
|
changelog = "https://github.com/composer/composer/releases/tag/${version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|