2021-02-27 11:29:20 +01:00
|
|
|
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
2020-10-11 16:44:31 +02:00
|
|
|
let
|
|
|
|
pname = "phpmd";
|
|
|
|
version = "2.8.2";
|
|
|
|
in
|
|
|
|
mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
src = fetchurl {
|
2020-10-11 16:44:31 +02:00
|
|
|
url = "https://github.com/phpmd/phpmd/releases/download/${version}/phpmd.phar";
|
|
|
|
sha256 = "1i8qgzxniw5d8zjpypalm384y7qfczapfq70xmg129laq6xiqlqb";
|
|
|
|
};
|
|
|
|
|
2021-08-01 23:56:33 +02:00
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-10-11 16:44:31 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2022-03-13 16:37:51 +01:00
|
|
|
runHook preInstall
|
2020-10-11 16:44:31 +02:00
|
|
|
mkdir -p $out/bin
|
|
|
|
install -D $src $out/libexec/phpmd/phpmd.phar
|
|
|
|
makeWrapper ${php}/bin/php $out/bin/phpmd \
|
|
|
|
--add-flags "$out/libexec/phpmd/phpmd.phar"
|
2022-03-13 16:37:51 +01:00
|
|
|
runHook postInstall
|
2020-10-11 16:44:31 +02:00
|
|
|
'';
|
|
|
|
|
2021-02-27 11:29:20 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 16:44:31 +02:00
|
|
|
description = "PHP code quality analyzer";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
homepage = "https://phpmd.org/";
|
|
|
|
maintainers = teams.php.members;
|
2021-11-07 18:35:45 +01:00
|
|
|
broken = versionOlder php.version "7.4";
|
2020-10-11 16:44:31 +02:00
|
|
|
};
|
|
|
|
}
|