Unverified Commit 1112c6e5 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #259255 from NixOS/php/use-composer-builder

php: bump and switch to new Composer builder
parents 5d69312c 624495f5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ composerRepositoryConfigureHook() {
    fi

    if [[ ! -f "composer.lock" ]]; then
        COMPOSER_ROOT_VERSION="${version}" \
        composer \
            --no-ansi \
            --no-install \
+13 −25
Original line number Diff line number Diff line
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ fetchFromGitHub, lib, php }:

let
php.buildComposerProject (finalAttrs: {
  pname = "phpstan";
  version = "1.10.37";
in
mkDerivation {
  inherit pname version;

  src = fetchurl {
    url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar";
    sha256 = "sha256-i1h3N11MsKhHx/RJxAthnUbjacA5yZJF6bzmQnmEKzg=";
  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;
  };
}
})
+4636 −0

File added.

Preview size limit exceeded, changes collapsed.

+15 −25
Original line number Diff line number Diff line
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ lib, fetchgit, php }:

let
php.buildComposerProject (finalAttrs: {
  pname = "psalm";
  version = "5.15.0";
in
mkDerivation {
  inherit pname version;

  src = fetchurl {
    url = "https://github.com/vimeo/psalm/releases/download/${version}/psalm.phar";
    sha256 = "sha256-eAvogKsnvXMNUZHh44RPHpd0iMqEY9fzqJvXPT7SE1A=";
  src = fetchgit {
    url = "https://github.com/vimeo/psalm.git";
    rev = finalAttrs.version;
    hash = "sha256-rRExT82+IwgVo7pL3rrTjW/qj/MJf4m4L3PywaeSHYU=";
  };

  dontUnpack = true;
  # TODO: Open a PR against https://github.com/vimeo/psalm
  # Missing `composer.lock` from the repository.
  composerLock = ./composer.lock;
  vendorHash = "sha256-Vho1ri/Qm2SYeXB9ZoXvH1vB/eSBwHnAT/pI4jjUYhU=";

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    install -D $src $out/libexec/psalm/psalm.phar
    makeWrapper ${php}/bin/php $out/bin/psalm \
      --add-flags "$out/libexec/psalm/psalm.phar"
    runHook postInstall
  '';

  meta = with lib; {
    changelog = "https://github.com/vimeo/psalm/releases/tag/${version}";
  meta = {
    changelog = "https://github.com/vimeo/psalm/releases/tag/${finalAttrs.version}";
    description = "A static analysis tool for finding errors in PHP applications";
    license = licenses.mit;
    homepage = "https://github.com/vimeo/psalm";
    maintainers = teams.php.members;
    license = lib.licenses.mit;
    maintainers = lib.teams.php.members;
  };
}
})
+1542 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading