depot/third_party/nixpkgs/pkgs/by-name/mi/mini-calc/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

45 lines
1.2 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
gnuplot,
makeWrapper,
testers,
mini-calc,
}:
rustPlatform.buildRustPackage rec {
pname = "mini-calc";
version = "3.1.0";
src = fetchFromGitHub {
owner = "coco33920";
repo = "calc";
rev = version;
hash = "sha256-wROeUi1j5oEUpr7nRge6bRUO0E8W2E34M7DeyK0xmjM=";
};
cargoHash = "sha256-QPkaSJNoxnheECwcK129+PNeRm6+DFOw1wmwBev6oXc=";
nativeBuildInputs = [ makeWrapper ];
postFixup = ''
wrapProgram $out/bin/mini-calc \
--prefix PATH : "${lib.makeBinPath [ gnuplot ]}"
'';
passthru.tests.version = testers.testVersion {
package = mini-calc;
# `mini-calc -v` does not output in the test env, fallback to pipe
command = "echo -v | mini-calc";
version = "v${version}";
};
meta = {
description = "A fully-featured minimalistic configurable calculator written in Rust";
changelog = "https://github.com/coco33920/calc/blob/${version}/CHANGELOG.md";
homepage = "https://calc.nwa2coco.fr";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ sigmanificient ];
mainProgram = "mini-calc";
platforms = lib.platforms.unix;
};
}