2021-02-27 10:29:20 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, unzip, lib, php }:
|
2020-10-11 14:37:09 +00:00
|
|
|
let
|
|
|
|
pname = "composer";
|
2021-07-25 13:59:26 +00:00
|
|
|
version = "2.1.5";
|
2020-10-11 14:37:09 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2021-07-25 13:59:26 +00:00
|
|
|
sha256 = "1v4hjwbv1y5jvj91i2fj8bvmfsymp9ls8h231zd85svfqdy5b5dy";
|
2020-10-11 14:37:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-02-27 10:29:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 14:37:09 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-27 11:53:54 +00:00
|
|
|
runHook preInstall
|
2020-10-11 14:37:09 +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-02-27 10:29:20 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ unzip ]}
|
2021-04-27 11:53:54 +00:00
|
|
|
runHook postInstall
|
2020-10-11 14:37:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-27 10:29:20 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 14:37:09 +00:00
|
|
|
description = "Dependency Manager for PHP";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://getcomposer.org/";
|
2021-05-24 14:47:17 +00:00
|
|
|
changelog = "https://github.com/composer/composer/releases/tag/${version}";
|
2020-10-11 14:37:09 +00:00
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|