phpPackages.phan: use `buildComposerProject` builder

+15 -27
+15 -27
pkgs/development/php-packages/phan/default.nix
··· 1 1 { lib 2 + , fetchFromGitHub 2 3 , php 3 - , mkDerivation 4 - , fetchurl 5 - , makeWrapper 6 4 }: 7 - let 8 - php' = php.withExtensions ({ enabled, all }: enabled ++ [ all.ast ]); 9 - in 10 - mkDerivation rec { 5 + 6 + (php.withExtensions({ enabled, all }: enabled ++ (with all; [ ast ]))).buildComposerProject (finalAttrs: { 11 7 pname = "phan"; 12 8 version = "5.4.3"; 13 9 14 - src = fetchurl { 15 - url = "https://github.com/phan/phan/releases/download/${version}/phan.phar"; 16 - hash = "sha256-wZU6YIlH0q18iD044y6Z5gSscBn7cI0AwRwZgT/YhOo="; 10 + src = fetchFromGitHub { 11 + owner = "phan"; 12 + repo = "phan"; 13 + rev = finalAttrs.version; 14 + hash = "sha256-O0dtnDsz6X99B99VbRQf3Wr/xJfsJqd+2l5Z5iWxHyU="; 17 15 }; 18 16 19 - dontUnpack = true; 20 - 21 - nativeBuildInputs = [ makeWrapper ]; 17 + vendorHash = "sha256-yE85MBseJa0VGV5EbjT0te4QT3697YvtumGkMMfZtxI="; 22 18 23 - installPhase = '' 24 - runHook preInstall 25 - mkdir -p $out/bin 26 - install -D $src $out/libexec/phan/phan.phar 27 - makeWrapper ${php'}/bin/php $out/bin/phan \ 28 - --add-flags "$out/libexec/phan/phan.phar" 29 - runHook postInstall 30 - ''; 31 - 32 - meta = with lib; { 19 + meta = { 33 20 description = "Static analyzer for PHP"; 21 + homepage = "https://github.com/phan/phan"; 22 + license = lib.licenses.mit; 34 23 longDescription = '' 35 24 Phan is a static analyzer for PHP. Phan prefers to avoid false-positives 36 25 and attempts to prove incorrectness rather than correctness. 37 26 ''; 38 - license = licenses.mit; 39 - homepage = "https://github.com/phan/phan"; 40 - maintainers = [ maintainers.apeschar ]; 27 + mainProgram = "phan"; 28 + maintainers = with lib.maintainers; [ apeschar ] ++ lib.teams.php.members; 41 29 }; 42 - } 30 + })