2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, darwin
|
|
|
|
}:
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fend";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "1.0.5";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "printfn";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-y5r9/e3KbEojRIoGG9gBkVbxGrJJJhwVZiiTkpy4NtE=";
|
2020-11-12 09:05:59 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
cargoSha256 = "sha256-iv3Uo3XUAxf+CmiRBm8EzQ2GhglPVqbN/LSofTa6ujw=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
|
2021-02-16 17:04:54 +00:00
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
[[ "$($out/bin/fend "1 km to m")" = "1000 m" ]]
|
|
|
|
'';
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Arbitrary-precision unit-aware calculator";
|
|
|
|
homepage = "https://github.com/printfn/fend";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ djanatyn ];
|
|
|
|
};
|
|
|
|
}
|