1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

fix phpunit

This commit is contained in:
Robin Appelman 2025-06-10 16:05:43 +02:00
commit 7985255d9d
7 changed files with 85 additions and 16 deletions

63
nix/image/phpunit.nix Normal file
View file

@ -0,0 +1,63 @@
{
lib,
fetchFromGitHub,
nix-update-script,
php,
phpunit,
testers,
versionCheckHook,
}: let
inherit (lib) concatStringsSep splitString take;
phpVersion = concatStringsSep "." (take 2 (splitString "." php.version));
versions = {
"8.1" = {
version = "10.5.46";
hash = "sha256-DtQ6CR4RAGKpZcJA9WZ5ud5ztIBTr8MeVTIhFwbGHYc=";
vendorHash = "sha256-fNv9pWFwYTyw3KEGtmbKNzXFsiDE6oZjRCWhypa/k0A=";
};
"8.2" = {
version = "11.5.22";
hash = "sha256-oXoh/2G0bqPPyvVoQUUdUz8XGyNtRJE3taUFGu2UIsc=";
vendorHash = "sha256-9gLTJe2ft90qGr/d8/Zc/ua7EWyNZ16wPEZRe9sKZf0=";
};
"8.3" = {
version = "12.2.1";
hash = "sha256-D5WI1kv05L8X3Gfw/MCxGdIcqWyWJg68GL9I24z/zIY=";
vendorHash = "sha256-H+XMRMvbUz/WCUdPRmL8nSCqa5YE3Qb1+goEQjjDK70=";
};
"8.4" = {
version = "12.2.1";
hash = "sha256-D5WI1kv05L8X3Gfw/MCxGdIcqWyWJg68GL9I24z/zIY=";
vendorHash = "sha256-H+XMRMvbUz/WCUdPRmL8nSCqa5YE3Qb1+goEQjjDK70=";
};
};
in php.buildComposerProject2 (finalAttrs: {
pname = "phpunit";
inherit (versions.${phpVersion}) version vendorHash;
src = fetchFromGitHub {
owner = "sebastianbergmann";
repo = "phpunit";
tag = finalAttrs.version;
inherit (versions.${phpVersion}) hash;
};
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion { package = phpunit; };
};
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
meta = {
changelog = "https://github.com/sebastianbergmann/phpunit/blob/${finalAttrs.version}/ChangeLog-${lib.versions.majorMinor finalAttrs.version}.md";
description = "PHP Unit Testing framework";
homepage = "https://phpunit.de";
license = lib.licenses.bsd3;
mainProgram = "phpunit";
maintainers = with lib.maintainers; [ onny ];
teams = [ lib.teams.php ];
};
})