2021-02-27 11:29:20 +01:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2020-10-11 16:46:30 +02:00
|
|
|
let
|
|
|
|
pname = "psalm";
|
2021-06-25 13:08:19 +02:00
|
|
|
version = "4.7.3";
|
2020-10-11 16:46:30 +02:00
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/vimeo/psalm/releases/download/${version}/psalm.phar";
|
2021-06-25 13:08:19 +02:00
|
|
|
sha256 = "0d8gxkpm4rc00a8br5wzjpglkwx95kr15s4z3cvxyf6iik1j5r47";
|
2020-10-11 16:46:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
2021-02-27 11:29:20 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 16:46:30 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 16:46:30 +02: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;
|
|
|
|
};
|
|
|
|
}
|