diff options
Diffstat (limited to 'nixpkgs/pkgs/development/php-packages/phpstan/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/php-packages/phpstan/default.nix | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/nixpkgs/pkgs/development/php-packages/phpstan/default.nix b/nixpkgs/pkgs/development/php-packages/phpstan/default.nix index da0b80ad50e0..63b223b888c1 100644 --- a/nixpkgs/pkgs/development/php-packages/phpstan/default.nix +++ b/nixpkgs/pkgs/development/php-packages/phpstan/default.nix @@ -1,32 +1,20 @@ -{ mkDerivation, fetchurl, makeWrapper, lib, php }: +{ fetchFromGitHub, lib, php }: -let +php.buildComposerProject (finalAttrs: { pname = "phpstan"; - version = "1.10.33"; -in -mkDerivation { - inherit pname version; + version = "1.10.37"; - src = fetchurl { - url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar"; - sha256 = "sha256-dFIuCVYmZr6E0181jegKs6d3mA9jPoFqoIY+lyWl7P8="; + src = fetchFromGitHub { + owner = "phpstan"; + repo = "phpstan-src"; + rev = finalAttrs.version; + hash = "sha256-y55bfwE3H/oDCwDq3wrClyX8dhk0p6vEl/CMhqN6LkA="; }; - dontUnpack = true; + vendorHash = "sha256-hjCfrmpn2rYgApenZkHX8fXqPXukh7BVKENkvwIk8Dk="; - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - install -D $src $out/libexec/phpstan/phpstan.phar - makeWrapper ${php}/bin/php $out/bin/phpstan \ - --add-flags "$out/libexec/phpstan/phpstan.phar" - runHook postInstall - ''; - - meta = with lib; { - changelog = "https://github.com/phpstan/phpstan/releases/tag/${version}"; + meta = { + changelog = "https://github.com/phpstan/phpstan/releases/tag/${finalAttrs.version}"; description = "PHP Static Analysis Tool"; longDescription = '' PHPStan focuses on finding errors in your code without actually @@ -35,8 +23,8 @@ mkDerivation { sense that the correctness of each line of the code can be checked before you run the actual line. ''; - license = licenses.mit; + license = lib.licenses.mit; homepage = "https://github.com/phpstan/phpstan"; - maintainers = teams.php.members; + maintainers = lib.teams.php.members; }; -} +}) |