2023-03-24 00:07:29 +00:00
|
|
|
{ mkDerivation, fetchurl, makeBinaryWrapper, unzip, lib, php }:
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
mkDerivation (finalAttrs: {
|
2020-10-16 20:44:37 +00:00
|
|
|
pname = "composer";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.5.8";
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "https://github.com/composer/composer/releases/download/${finalAttrs.version}/composer.phar";
|
|
|
|
hash = "sha256-8Hk0+tRPkEjA3IdaUGzKMcwnlNauv8GGfzsfv0jc4sU=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
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
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/composer/composer/releases/tag/${finalAttrs.version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Dependency Manager for PHP";
|
|
|
|
homepage = "https://getcomposer.org/";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ offline ] ++ lib.teams.php.members;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|