mirror of
https://codeberg.org/icewind/flakelight-php.git
synced 2026-06-03 09:54:20 +02:00
check if vendorHash is up to date
This commit is contained in:
parent
3afda04092
commit
293329e37b
2 changed files with 39 additions and 6 deletions
28
checks/vendor-hash.nix
Normal file
28
checks/vendor-hash.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
composerMeta,
|
||||||
|
src,
|
||||||
|
vendor,
|
||||||
|
stdenvNoCC,
|
||||||
|
}: let
|
||||||
|
inherit (composerMeta) version name;
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
inherit src version;
|
||||||
|
pname = "${name}-check-vendor-hash";
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
ln -s ${vendor}/vendor vendor
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
diff -q ${vendor}/composer.lock composer.lock || (echo "vendorHash is out of date" && exit 1)
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -165,7 +165,10 @@ in
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
(optionalAttrs hasPsalm (forPhpVersions "psalm" ./checks/psalm.nix))
|
{
|
||||||
|
vendor-hash = pkgs.callPackage ./checks/vendor-hash.nix {};
|
||||||
|
}
|
||||||
|
// (optionalAttrs hasPsalm (forPhpVersions "psalm" ./checks/psalm.nix))
|
||||||
// (optionalAttrs hasPhpStan (forPhpVersions "phpstan" ./checks/phpstan.nix));
|
// (optionalAttrs hasPhpStan (forPhpVersions "phpstan" ./checks/phpstan.nix));
|
||||||
|
|
||||||
apps = {pkgs, ...}: let
|
apps = {pkgs, ...}: let
|
||||||
|
|
@ -176,9 +179,11 @@ in
|
||||||
php = buildPhpVersion pkgs version;
|
php = buildPhpVersion pkgs version;
|
||||||
})} "$@"'';
|
})} "$@"'';
|
||||||
});
|
});
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
phpunit = ''${getExe pkgs.phpunit} "$@"'';
|
phpunit = ''${getExe pkgs.phpunit} "$@"'';
|
||||||
} // (forPhpVersions "phpunit" pkgs.phpunit);
|
}
|
||||||
|
// (forPhpVersions "phpunit" pkgs.phpunit);
|
||||||
})
|
})
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue