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

php: bump and switch to new Composer builder
This commit is contained in:
Pol Dellaiera 2023-10-09 18:15:20 +02:00 committed by GitHub
commit 1112c6e505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6224 additions and 77 deletions

View file

@ -17,6 +17,7 @@ composerRepositoryConfigureHook() {
fi
if [[ ! -f "composer.lock" ]]; then
COMPOSER_ROOT_VERSION="${version}" \
composer \
--no-ansi \
--no-install \

View file

@ -1,32 +1,20 @@
{ 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;
};
}
})

File diff suppressed because it is too large Load diff

View file

@ -1,35 +1,25 @@
{ 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;
};
}
})

File diff suppressed because it is too large Load diff

View file

@ -1,36 +1,26 @@
{ stdenv, fetchurl, makeWrapper, lib, php }:
{ lib, fetchFromGitHub, php }:
let
php.buildComposerProject (finalAttrs: {
pname = "phpunit";
version = "10.3.3";
in
stdenv.mkDerivation {
inherit pname version;
version = "10.4.1";
src = fetchurl {
url = "https://phar.phpunit.de/phpunit-${version}.phar";
hash = "sha256-fhgsP/sA2nQXBQ34V2/Zvc+SPiDYWfkEXKKHoD+Heak=";
src = fetchFromGitHub {
owner = "sebastianbergmann";
repo = "phpunit";
rev = finalAttrs.version;
hash = "sha256-AKUMCa8QuXqE0HrMaxR8SvhdoYjL/CmaTzf5UhszPPw=";
};
dontUnpack = true;
# TODO: Open a PR against https://github.com/sebastianbergmann/phpunit
# Missing `composer.lock` from the repository.
composerLock = ./composer.lock;
vendorHash = "sha256-xFXf9Nc6OxvZJ4Bt9zFhhdsJY4VwnztfCE4j5tOqQKQ=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpunit/phpunit.phar
makeWrapper ${php}/bin/php $out/bin/phpunit \
--add-flags "$out/libexec/phpunit/phpunit.phar"
runHook postInstall
'';
meta = with lib; {
meta = {
changelog = "https://github.com/sebastianbergmann/phpunit/blob/${finalAttrs.version}/ChangeLog-${lib.versions.majorMinor finalAttrs.version}.md";
description = "PHP Unit Testing framework";
license = licenses.bsd3;
homepage = "https://phpunit.de";
changelog = "https://github.com/sebastianbergmann/phpunit/blob/${version}/ChangeLog-${lib.versions.majorMinor version}.md";
maintainers = with maintainers; [ onny ] ++ teams.php.members;
platforms = platforms.all;
license = lib.licenses.bsd3;
maintainers = [ lib.maintainers.onny ] ++ lib.teams.php.members;
};
}
})