2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, darwin
|
2022-10-21 18:38:19 +00:00
|
|
|
, pandoc
|
|
|
|
, installShellFiles
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fend";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.1.4";
|
2020-11-12 09:05:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "printfn";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-jg2rMiFXtN3oLru1gTaTyIo5eBEI23paKJiDV6KZZE4=";
|
2020-11-12 09:05:59 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
cargoHash = "sha256-9Gri/EBaUiCpFBL0f132JDD4Zl5v40e8JmlRvm019S4=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
nativeBuildInputs = [ pandoc installShellFiles ];
|
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
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
postBuild = ''
|
|
|
|
patchShebangs --build ./documentation/build.sh
|
|
|
|
./documentation/build.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
installManPage documentation/fend.1
|
|
|
|
'';
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|