2021-02-27 10:29:20 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2020-10-11 15:43:44 +01:00
|
|
|
let
|
|
|
|
pname = "phpcs";
|
2020-10-24 08:52:44 +01:00
|
|
|
version = "3.5.8";
|
2020-10-11 15:43:44 +01:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar";
|
2020-10-24 08:52:44 +01:00
|
|
|
sha256 = "037mdnpbgd9xaj556pf14h02a4a6f5zzdg58p2z1sivxcygf8aka";
|
2020-10-11 15:43:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
2021-02-27 10:29:20 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 15:43:44 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D $src $out/libexec/phpcs/phpcs.phar
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/phpcs \
|
|
|
|
--add-flags "$out/libexec/phpcs/phpcs.phar"
|
|
|
|
'';
|
|
|
|
|
2021-02-27 10:29:20 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 15:43:44 +01:00
|
|
|
description = "PHP coding standard tool";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
homepage = "https://squizlabs.github.io/PHP_CodeSniffer/";
|
|
|
|
maintainers = with maintainers; [ javaguirre ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|