2021-03-09 03:18:52 +00:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2020-10-16 20:44:37 +00:00
|
|
|
let
|
|
|
|
pname = "psalm";
|
2021-12-25 05:07:40 +00:00
|
|
|
version = "4.15.0";
|
2020-10-16 20:44:37 +00:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-25 05:07:40 +00:00
|
|
|
url = "https://github.com/vimeo/psalm/releases/download/v${version}/psalm.phar";
|
|
|
|
sha256 = "jvUNnA5OTmw3h1O1Ur7pUojgU5IRgwq2U/JF/ByO0EA=";
|
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/psalm/psalm.phar
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/psalm \
|
|
|
|
--add-flags "$out/libexec/psalm/psalm.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 = "A static analysis tool for finding errors in PHP applications";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://github.com/vimeo/psalm";
|
|
|
|
maintainers = teams.php.members;
|
|
|
|
};
|
|
|
|
}
|