Skip to content

Instantly share code, notes, and snippets.

@drupol
Created April 20, 2023 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drupol/33402fd50cd1a6119245110852651b57 to your computer and use it in GitHub Desktop.
Save drupol/33402fd50cd1a6119245110852651b57 to your computer and use it in GitHub Desktop.
PHPUnit with new PHP Hooks
{ stdenv, lib, fetchFromGitHub, php }:
stdenv.mkDerivation (finalAttrs:
let
src = fetchFromGitHub {
owner = "sebastianbergmann";
repo = "phpunit";
rev = finalAttrs.version;
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
};
in {
inherit src;
pname = "phpunit";
version = "10.1.0";
composerVendor = php.buildComposerDeps {
inherit src;
composerLock = ./composer.lock;
vendorHash = "sha256-86s/F+/5cBAwBqZ2yaGRM5rTGLmou5//aLRK5SA0WiQ=";
};
nativeBuildInputs = [
php.packages.composer
php.composerHooks.composerInstallHook
];
buildInputs = [
php
];
noDevArg = " --no-dev";
noScriptsArg = " --no-scripts";
noPluginsArg = " --no-plugins";
installPhase = ''
runHook preInstall
ls -la ${finalAttrs.composerVendor}/.
mkdir -p $out
cp -ar . $out/
runHook postInstall
'';
meta = with lib; {
description = "PHP Unit Testing framework";
license = licenses.bsd3;
homepage = "https://phpunit.de";
changelog = "https://github.com/sebastianbergmann/phpunit/blob/${finalAttrs.version}/ChangeLog-${lib.versions.majorMinor finalAttrs.version}.md";
maintainers = with maintainers; [ onny ] ++ teams.php.members;
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment