piday25: init at 0-unstable-2025-03-13

This commit is contained in:
Defelo 2025-03-16 11:30:40 +01:00
parent 3544602fb7
commit c1aadaf8ec
No known key found for this signature in database
GPG key ID: 2A05272471204DD3

View file

@ -0,0 +1,42 @@
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
}:
rustPlatform.buildRustPackage {
pname = "piday25";
version = "0-unstable-2025-03-13";
src = fetchFromGitHub {
owner = "elkasztano";
repo = "piday25";
rev = "68b417a3016c58a2948cb3b39c9bde985d82bdb8";
hash = "sha256-58ZBRmB990Tp+/nkuRZA+8cjCRFUBzdzu93Sk5uvKOE=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-3uztB5/VevFyEz3S+VlAUPgDrNDJcwaTnHuXXYAX+MY=";
# upstream does not have any tests
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/piday25 > result
diff -U3 --color=auto <(head -c12 result) <(echo -n 3.1415926535)
runHook postInstallCheck
'';
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch=main" ]; };
meta = {
description = "Multithreaded implementation of the Chudnovsky algorithm to calculate Pi";
homepage = "https://github.com/elkasztano/piday25";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "piday25";
};
}