depot/third_party/nixpkgs/pkgs/development/php-packages/php-cs-fixer/default.nix
Default email 6d4aeb4377 Project import generated by Copybara.
GitOrigin-RevId: 0f213d0fee84280d8c3a97f7469b988d6fe5fcdf
2023-01-11 08:51:40 +01:00

35 lines
1,014 B
Nix

{ mkDerivation, fetchurl, makeWrapper, lib, php }:
let
pname = "php-cs-fixer";
version = "3.13.1";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
sha256 = "4bQrCjuaWN4Dbs1tkk4m1WxSb510ue7G59HA+gQ52yk=";
};
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; {
changelog = "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/${version}";
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;
};
}