2022-12-17 10:02:37 +00:00
|
|
|
{ mkDerivation, fetchFromGitHub, makeWrapper, lib, php, php81 }:
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
pname = "php-parallel-lint";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "1.3.2";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-05-18 14:49:53 +00:00
|
|
|
owner = "php-parallel-lint";
|
2020-10-16 20:44:37 +00:00
|
|
|
repo = "PHP-Parallel-Lint";
|
|
|
|
rev = "v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
# `.gitattibutes` exclude `box.json` from the archive produced git.
|
|
|
|
forceFetchGit = true;
|
|
|
|
sha256 = "SPP1ynxJad2m5wknGt8z94fW7Ucx8nqLvwZVmlylOgM=";
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-03-09 03:18:52 +00:00
|
|
|
makeWrapper
|
2020-10-16 20:44:37 +00:00
|
|
|
php.packages.composer
|
2022-12-17 10:02:37 +00:00
|
|
|
# box is only available for PHP ≥ 8.1 but the purpose of this tool is to validate
|
|
|
|
# that project does not use features not available on older PHP versions.
|
|
|
|
php81.packages.box
|
2020-10-16 20:44:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook preBuild
|
2020-10-16 20:44:37 +00:00
|
|
|
composer dump-autoload
|
2022-11-21 17:40:18 +00:00
|
|
|
box compile
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook postBuild
|
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 parallel-lint.phar $out/libexec/php-parallel-lint/php-parallel-lint.phar
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/php-parallel-lint \
|
|
|
|
--add-flags "$out/libexec/php-parallel-lint/php-parallel-lint.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; {
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Tool to check syntax of PHP files faster than serial check with fancier output";
|
|
|
|
license = licenses.bsd2;
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/php-parallel-lint/PHP-Parallel-Lint";
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ ] ++ teams.php.members;
|
2020-10-16 20:44:37 +00:00
|
|
|
};
|
|
|
|
}
|