2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gnuplot,
|
|
|
|
makeWrapper,
|
2024-06-05 15:53:02 +00:00
|
|
|
testers,
|
|
|
|
mini-calc,
|
2024-05-15 15:35:15 +00:00
|
|
|
}:
|
2024-04-21 15:54:59 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "mini-calc";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "3.2.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coco33920";
|
|
|
|
repo = "calc";
|
|
|
|
rev = version;
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-f2xmc6wzZ5MwwBDYQNoxbFmIclZWd/xOOI4/MCmrnEI=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
cargoHash = "sha256-OiAU94URgOHZ/iNbCF5rE55zfZNkW3bdjPZo05kpIRo=";
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/mini-calc \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ gnuplot ]}"
|
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
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}";
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Fully-featured minimalistic configurable calculator written in Rust";
|
2024-04-21 15:54:59 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|