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";
|
2021-02-27 12:23:45 +01:00
|
|
|
version = "2.0.11";
|
2020-10-11 16:37:09 +02:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://getcomposer.org/download/${version}/composer.phar";
|
2021-02-27 12:23:45 +01:00
|
|
|
sha256 = "sha256-6r8pFwcglqlGeRk3YlATGeYh4rNppKElaywn9OaYRHc=";
|
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 = ''
|
|
|
|
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 ]}
|
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/";
|
|
|
|
maintainers = with maintainers; [ offline ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|