2021-03-09 03:18:52 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
pname = "phpcs";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "3.7.2";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar";
|
2023-10-19 13:55:26 +00:00
|
|
|
sha256 = "sha256-IEIUwepbqBT7CyYIwZzKLBC/X/zJ8OPUw0qtwBeVF7c=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-16 20:44:37 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook preInstall
|
2020-10-16 20:44:37 +00:00
|
|
|
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"
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook postInstall
|
2020-10-16 20:44:37 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/${version}";
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "PHP coding standard tool";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
homepage = "https://squizlabs.github.io/PHP_CodeSniffer/";
|
|
|
|
maintainers = with maintainers; [ javaguirre ] ++ teams.php.members;
|
|
|
|
};
|
|
|
|
}
|