lol

phpPackages.phpstan: use `buildComposerProject` builder

+13 -25
+13 -25
pkgs/development/php-packages/phpstan/default.nix
··· 1 - { mkDerivation, fetchurl, makeWrapper, lib, php }: 1 + { fetchFromGitHub, lib, php }: 2 2 3 - let 3 + php.buildComposerProject (finalAttrs: { 4 4 pname = "phpstan"; 5 5 version = "1.10.37"; 6 - in 7 - mkDerivation { 8 - inherit pname version; 9 6 10 - src = fetchurl { 11 - url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar"; 12 - sha256 = "sha256-i1h3N11MsKhHx/RJxAthnUbjacA5yZJF6bzmQnmEKzg="; 7 + src = fetchFromGitHub { 8 + owner = "phpstan"; 9 + repo = "phpstan-src"; 10 + rev = finalAttrs.version; 11 + hash = "sha256-y55bfwE3H/oDCwDq3wrClyX8dhk0p6vEl/CMhqN6LkA="; 13 12 }; 14 13 15 - dontUnpack = true; 16 - 17 - nativeBuildInputs = [ makeWrapper ]; 18 - 19 - installPhase = '' 20 - runHook preInstall 21 - mkdir -p $out/bin 22 - install -D $src $out/libexec/phpstan/phpstan.phar 23 - makeWrapper ${php}/bin/php $out/bin/phpstan \ 24 - --add-flags "$out/libexec/phpstan/phpstan.phar" 25 - runHook postInstall 26 - ''; 14 + vendorHash = "sha256-hjCfrmpn2rYgApenZkHX8fXqPXukh7BVKENkvwIk8Dk="; 27 15 28 - meta = with lib; { 29 - changelog = "https://github.com/phpstan/phpstan/releases/tag/${version}"; 16 + meta = { 17 + changelog = "https://github.com/phpstan/phpstan/releases/tag/${finalAttrs.version}"; 30 18 description = "PHP Static Analysis Tool"; 31 19 longDescription = '' 32 20 PHPStan focuses on finding errors in your code without actually ··· 35 23 sense that the correctness of each line of the code can be checked 36 24 before you run the actual line. 37 25 ''; 38 - license = licenses.mit; 26 + license = lib.licenses.mit; 39 27 homepage = "https://github.com/phpstan/phpstan"; 40 - maintainers = teams.php.members; 28 + maintainers = lib.teams.php.members; 41 29 }; 42 - } 30 + })