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";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "1.10.15";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "1shsxsrc2kq74s1jbq3njn9wzidcz7ak66n9vyz8z8d0hqpg37d6";
|
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 = ''
|
|
|
|
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 ]}
|
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/";
|
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|