2021-02-27 10:29:20 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, unzip, lib, php }:
|
2020-10-11 15:37:09 +01:00
|
|
|
let
|
|
|
|
pname = "composer";
|
2021-02-27 11:23:45 +00:00
|
|
|
version = "2.0.11";
|
2020-10-11 15:37:09 +01:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2021-02-27 11:23:45 +00:00
|
|
|
sha256 = "sha256-6r8pFwcglqlGeRk3YlATGeYh4rNppKElaywn9OaYRHc=";
|
2020-10-11 15:37:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-02-27 10:29:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 15:37:09 +01: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-02-27 10:29:20 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ unzip ]}
|
2020-10-11 15:37:09 +01:00
|
|
|
'';
|
|
|
|
|
2021-02-27 10:29:20 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 15:37:09 +01:00
|
|
|
description = "Dependency Manager for PHP";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://getcomposer.org/";
|
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|