summary refs log tree commit diff
path: root/pkgs/top-level/php-packages.nix
diff options
context:
space:
mode:
authorColby Cellador <44584960+ccellado@users.noreply.github.com>2020-05-11 09:59:43 +0300
committerGitHub <noreply@github.com>2020-05-11 08:59:43 +0200
commit3a768184f4823175f8f46a10b811242efaf41e40 (patch)
tree4c98cdd6469342735b67f9e419ef50355797b504 /pkgs/top-level/php-packages.nix
parent47d1cd332cfcc22afdd5d47e61754ce1d9262278 (diff)
downloadnixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar.gz
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar.bz2
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar.lz
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar.xz
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.tar.zst
nixpkgs-3a768184f4823175f8f46a10b811242efaf41e40.zip
phpPackages: phpmd (#87387)
php.packages.phpmd: init at 2.8.2
Diffstat (limited to 'pkgs/top-level/php-packages.nix')
-rw-r--r--pkgs/top-level/php-packages.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index ff9e96f8b97..0fecf30e736 100644
--- a/pkgs/top-level/php-packages.nix
+++ b/pkgs/top-level/php-packages.nix
@@ -202,7 +202,35 @@ in
         maintainers = with maintainers; [ javaguirre ] ++ teams.php.members;
       };
     };
+ 
+    phpmd = mkDerivation rec {
+      version = "2.8.2";
+      pname = "phpmd";
 
+      src = pkgs.fetchurl {
+        url = "https://github.com/phpmd/phpmd/releases/download/${version}/phpmd.phar";
+        sha256 = "1i8qgzxniw5d8zjpypalm384y7qfczapfq70xmg129laq6xiqlqb";
+      };
+
+      phases = [ "installPhase" ];
+      buildInputs = [ pkgs.makeWrapper ];
+
+      installPhase = ''
+        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"
+      '';
+
+      meta = with pkgs.lib; {
+        description = "PHP code quality analyzer";
+        license = licenses.bsd3;
+        homepage = "https://phpmd.org/";
+        maintainers = teams.php.members;
+        broken = !isPhp74;
+      };
+    };
+ 
     phpstan = mkDerivation rec {
       version = "0.12.19";
       pname = "phpstan";