nixpkgs/pkgs/development/php-packages/php-cs-fixer/default.nix
2021-08-01 23:57:28 +02:00

31 lines
887 B
Nix

{ mkDerivation, fetchurl, makeWrapper, lib, php }:
let
pname = "php-cs-fixer";
version = "3.0.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 = "141rkcr0wbsqnc4s5vg4bk4dmxwigwxa3j0vi5c42b5k1lq3sgwr";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
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"
'';
meta = with lib; {
description = "A tool to automatically fix PHP coding standards issues";
license = licenses.mit;
homepage = "http://cs.sensiolabs.org/";
maintainers = with maintainers; [ jtojnar ] ++ teams.php.members;
};
}