1{ mkDerivation, fetchurl, lib, php, makeWrapper }:
2let
3 pname = "phpcbf";
4 version = "3.6.0";
5in
6mkDerivation {
7 inherit pname version;
8
9 src = fetchurl {
10 url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcbf.phar";
11 sha256 = "04wb1imm4934mpy2hxcmqh4cn7md1vwmfii39p6mby809325b5z1";
12 };
13
14 dontUnpack = true;
15
16 nativeBuildInputs = [ makeWrapper ];
17
18 installPhase = ''
19 runHook preInstall
20 mkdir -p $out/bin
21 install -D $src $out/libexec/phpcbf/phpcbf.phar
22 makeWrapper ${php}/bin/php $out/bin/phpcbf \
23 --add-flags "$out/libexec/phpcbf/phpcbf.phar"
24 runHook postInstall
25 '';
26
27 meta = with lib; {
28 description = "PHP coding standard beautifier and fixer";
29 license = licenses.bsd3;
30 homepage = "https://squizlabs.github.io/PHP_CodeSniffer/";
31 maintainers = with maintainers; [ cmcdragonkai ] ++ teams.php.members;
32 };
33}