depot/third_party/nixpkgs/pkgs/development/php-packages/php-cs-fixer/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

33 lines
932 B
Nix

{ mkDerivation, fetchurl, makeWrapper, lib, php }:
let
pname = "php-cs-fixer";
version = "3.11.0";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
sha256 = "sha256-hnSHR/tDX1w/4SV6fafvUHg4JwTQJxfwKaKvEbUWJjs=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/php-cs-fixer/php-cs-fixer.phar
makeWrapper ${php}/bin/php $out/bin/php-cs-fixer \
--add-flags "$out/libexec/php-cs-fixer/php-cs-fixer.phar"
runHook postInstall
'';
meta = with lib; {
description = "A tool to automatically fix PHP coding standards issues";
license = licenses.mit;
homepage = "https://cs.symfony.com/";
maintainers = with maintainers; [ jtojnar ] ++ teams.php.members;
};
}