8a45d4525b
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
35 lines
793 B
Nix
35 lines
793 B
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, rustPlatform
|
|
, darwin
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "fend";
|
|
version = "1.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "printfn";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-EV3uxoN6RuQ7grXLcFev1ZCfjVnVIDumQmHdpUm1Jbc=";
|
|
};
|
|
|
|
cargoSha256 = "sha256-lNpFdrriAglLaiWjxVP4JoiBuU+zdLlerAIApIvHHZw=";
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
[[ "$($out/bin/fend "1 km to m")" = "1000 m" ]]
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Arbitrary-precision unit-aware calculator";
|
|
homepage = "https://github.com/printfn/fend";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ djanatyn ];
|
|
};
|
|
}
|