1{ mkDerivation, fetchurl, makeWrapper, lib, php }:
2
3let
4 pname = "php-cs-fixer";
5 version = "3.16.0";
6in
7mkDerivation {
8 inherit pname version;
9
10 src = fetchurl {
11 url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
12 sha256 = "sha256-B4VzfsSwcffR/t4eREMLH9jRWCTumYel6GM4rpumVBY=";
13 };
14
15 dontUnpack = true;
16
17 nativeBuildInputs = [ makeWrapper ];
18
19 installPhase = ''
20 runHook preInstall
21 mkdir -p $out/bin
22 install -D $src $out/libexec/php-cs-fixer/php-cs-fixer.phar
23 makeWrapper ${php}/bin/php $out/bin/php-cs-fixer \
24 --add-flags "$out/libexec/php-cs-fixer/php-cs-fixer.phar"
25 runHook postInstall
26 '';
27
28 meta = with lib; {
29 changelog = "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/${version}";
30 description = "A tool to automatically fix PHP coding standards issues";
31 license = licenses.mit;
32 homepage = "https://cs.symfony.com/";
33 maintainers = with maintainers; [ ] ++ teams.php.members;
34 };
35}